The Artima Developer Community
Sponsored Link

Weblogs Forum
A Set of Unit Testing Rules

50 replies on 51 pages. Most recent reply: Jan 21, 2011 2:19 AM by Steve Merrick

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 50 replies on 51 pages [ « | 1 ... 20 21 22 23 24 25 26 27 28 ... 51  | » ]
Vincent O'Sullivan

Posts: 724
Nickname: vincent
Registered: Nov, 2002

Re: "Define" Unit Test Posted: Sep 12, 2005 10:10 PM
Reply to this message Reply
Advertisement
> TDD shifts this definition subtly, but importantly. The
> definition I proposed for the term unit test was the
> tightest definition: a unit is the smallest
> bit of code that can be tested, thus a test is only a unit
> test if it tests the smallest bit of code that can be
> tested (usually a class via its public methods; this was a
> Java project).

It's just nit picking but I'm not sure the use of smallest here is quite correct. Most TDD tests test individual methods (or functions) not classes, thus the smallest unit of code being tested is the method.

It then gets rather vague: Since most methods require more than one test for complete coverage it becomes apparent that any given test may be only part testing a particular method. Therefore the granularity is smaller still, except that an external test cannot see anything smaller than the method signature and therefore cannot 'know' to what extent the test fully or partially tests the method in question.

Flat View: This topic has 50 replies on 51 pages [ « | 20  21  22  23  24  25  26  27  28 | » ]
Topic: Computer About to Play Jeopardy Previous Topic   Next Topic Topic: The Search for Requirements

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use