permaculture playing cards*
The moose likes Testing and the fly likes functional tests vs. unit tests Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » Testing
Bookmark "functional tests vs. unit tests" Watch "functional tests vs. unit tests" New topic
Author

functional tests vs. unit tests

paul wheaton
Trailboss

Joined: Dec 14, 1998
Posts: 20489
    ∞

This thread is in response to the section of the unit testing article called "The Trouble With Too Many Functional Tests".


permaculture Wood Burning Stoves 2.0 - 4-DVD set
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

Designing code that can be truly unit tested is an art. It's not something that every Joe Programmer off the street knows how to do well. The article should acknowledge this fact more. It's easy to make these recommendations, but harder to make people understand that they're really achievable.


[Jess in Action][AskingGoodQuestions]
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30068
    
149

"I don't mind if my unit test suite takes a few minutes to run." But do the other people on your team mind? Does your team lead mind? Your manager? If it take a few minutes instead of a few seconds, do you still run the full suite a dozen times a day? At what point do people stop running the tests at all?

We've never gotten to the point where the unit test suite takes too long for us all to run frequently. It's 1-2 minutes for a few thousand tests.

With the "short running" integration tests, after 6-10 minutes we all stopped running the full suite of tests. That was a sign that it needed refactoring and we got down to a more manageable amount.

I learned that a key here is that people don't always complain the tests are slow. Just slowly stop running them.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
Don't get me started about those stupid light bulbs.
 
subject: functional tests vs. unit tests
 
Similar Threads
Any tools that help to get the big picture
programmer, object tests
Feedback Abbot's use
Skip or order JUnit tests in Eclipse
On unit testing for GUI (supporting SWT ) and web page testing frameworks