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 ... 23 24 25 26 27 28 29 30 31 ... 51  | » ]
Bill Poitras

Posts: 2
Nickname: wpoitras
Registered: Sep, 2005

Re: A Set of Unit Testing Rules Posted: Sep 13, 2005 12:11 PM
Reply to this message Reply
> Nice ideas, but I disagree the unit using config files is
> not test case. For example I use spring bean factory to
> delivery complex beans into my test case.

Although Spring does provide abstract JUnit classes for instantiating Spring objects from a Spring context, what you are describing are not considered unit tests. If you take a look at the unit tests that the Spring samples and library itself they almost exclusively instantiate objects using "new" and wire up collaborators that are mock objects.

This post is really about trying to create true unit tests first. Then if more complex integration tests are needed, those are separate. Michael is trying to foster the idea that unit tests are for testing the proper behavior of a single object and try not to worry whether calling the database, thread library, transaction manager, other objects you write etc actually work, because they should. Or in the case of other objects you write, you'll write unit tests for those.

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

Sponsored Links


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