This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Testing and the fly likes Keeping tests in sync Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Engineering » Testing
Bookmark "Keeping tests in sync" Watch "Keeping tests in sync" New topic
Author

Keeping tests in sync

Shane Hartman
Greenhorn

Joined: May 29, 2003
Posts: 4
What is the best way to keep tests in sync, we have a development group of over 30 programmers and an off-shore arm. While we have been coming down hard on those who do not keep the tests up to date when they make changes, I wonder if their is a better way.
Vincent Massol
Author
Ranch Hand

Joined: Aug 09, 2003
Posts: 70
Originally posted by Shane Hartman:
What is the best way to keep tests in sync, we have a development group of over 30 programmers and an off-shore arm. While we have been coming down hard on those who do not keep the tests up to date when they make changes, I wonder if their is a better way.

Yes, simply set up a continuous build process (using Ant/CruiseControl or Maven). Make the test run as part of the build and make Ant/Maven fail the build when the tests fail. Make the continuous build send an email to the project mailing list on failure.
-Vincent
JUnit in Action author


-Vincent<br /><a href="http://www.manning.com/massol" target="_blank" rel="nofollow">JUnit in Action</a> author
Shane Hartman
Greenhorn

Joined: May 29, 2003
Posts: 4
We have that setup now, and that is how we know the tests failed and who failed them becuase source control records the name of the developer. Where it has really gotten us is when a new method is added an not test case is built.
Jon Strayer
Ranch Hand

Joined: Dec 04, 2002
Posts: 133
Originally posted by Shane Hartman:
We have that setup now, and that is how we know the tests failed and who failed them becuase source control records the name of the developer. Where it has really gotten us is when a new method is added an not test case is built.

I can't automate the notification for you, but if you use Maven it will use JCoverage to generate a coverage report (that you can then used to detect missing tests).


Jon
Karthik Guru
Ranch Hand

Joined: Mar 06, 2001
Posts: 1209
Originally posted by Vincent Massol:

Maven). Make the test run as part of the build and make Ant/Maven fail the build when the tests fail.

I have'nt been able to do this. We use ANT. Any idea as to how i s'd make the build fail if even one test fails.
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Any idea as to how i s'd make the build fail if even one test fails.

Set the haltonfailure="on" attribute into your <junit ... > task.


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
 
jQuery in Action, 2nd edition
 
subject: Keeping tests in sync