File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Scope of JUnit

 
Varun Narula
Ranch Hand
Posts: 90
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Most java programmers test a condition/parameter by sending the output to the system. If the outputs ok, the thing works.
Would JUnit serve any purpose for the most trivial of tests ?
 
Wilfried LAURENT
Ranch Hand
Posts: 269
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One of the interest of JUnit is to provide a framework for unitary testing.
I have recently experienced unit testing with and without the JUnit framework. Of course, the tests had been coded by several developers, who all had their own habits (even if a procedure exists ).
While upgrading, we had to know if the tests were ok.
Running and Checking the 'noJunit' tests results was painful. I had to find out where the test classes were, find all of them, run the test classes individually, read the result of each individual before concluding the tests were ok.
In the second case, with the "Junit" test results I only needed to run a class named 'RootSuite' and read the results as "123 tests runned. Ok"
[ March 12, 2002: Message edited by: Wilfried LAURENT ]
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Varun Narula:
Most java programmers test a condition/parameter by sending the output to the system. If the outputs ok, the thing works.

Does it still work in two minutes? Half an hour? Tomorrow? Next week? In six Months?
With a JUnit-Testsuite you can run hundreds of tests in a matter of seconds to minutes with one mouse click. You can do this every time you need confidence in your code - even when you need it most: when you get short of time and manual testing will get omitted.
Developers indulged in test-first-development will in fact run the testsuite every couple of minutes. This form of feedback can be addictive... ;-)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic