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 ... 42 43 44 45 46 47 48 49 50 ... 51  | » ]
Michael Feathers

Posts: 448
Nickname: mfeathers
Registered: Jul, 2003

Re: A Set of Unit Testing Rules Posted: Apr 13, 2006 7:32 PM
Reply to this message Reply
Advertisement
> The unit test definition you are suggesting has a rather
> questionable foundation. The definition cherry picks some
> common input/output services but in effect you are saying
> "speed" is a defining characteristic of a unit test.

Just because people already know many of the others.

> The execution speed determines whether the unit test is
> slow or fast, not whether it is a unit test or not. What
> you seem to be leaning on for your definition is test
> independence. A test that does database access is not
> independent. Everything has dependencies at some level so
> that's not a criterion with much practical value either.
>
> A unit test should not depend on other unit tests. You
> define what a "unit" is and you may very well have several
> levels of granularity. Functional tests are tests from the
> user's perspective, be that a human being or another
> system:
>
> http://www-128.ibm.com/developerworks/library/j-test.html
>
>
> Side note: the comment was made that the XP solution to
> slow tests was to optimize the tests. Think about that. Is
> it the test or the UUT (unit under test) that is slow?
> Refactoring is not a unit test speed-up process.

Yes, refactoring is not optimization. The fact is this "slow test" problem is a big deal with many teams. And I can't remember a case where the speed of the code under test was an issue and the code didn't do something with an external system (network, file system, database). I know it can happen, but I haven't run into a team with the problem of compute-intensive unit tests. External system access, leading to glacially slow unit tests, seems to be a much more popular way to fail.

Flat View: This topic has 50 replies on 51 pages [ « | 42  43  44  45  46  47  48  49  50 | » ]
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