File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Other Open Source Projects and the fly likes Scope of JUnit Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Scope of JUnit " Watch "Scope of JUnit " New topic

Scope of JUnit

Varun Narula
Ranch Hand

Joined: Nov 19, 2001
Posts: 90
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 ?

There are only 10 types of people in this world; those who understand binary and those who dont<p>Varun Narula <br />SCJP, SCWCD, IBM-486 (UML)
Wilfried LAURENT
Ranch Hand

Joined: Jul 13, 2001
Posts: 269
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

Joined: Jul 11, 2001
Posts: 14112
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... ;-)

The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
I agree. Here's the link:
subject: Scope of JUnit
It's not a secret anymore!