JUNIT is a unit testing framework for Java Programming Language. JUnit is one of the most successful of all the unit testing frameworks. JUnit has spawned its own ecosystem of Junit extensions. Experience gained with JUnit has been important in the development of test driven development. Eclipse v. 3.1comes with JUnit built into the Workbench. Eclipse with inbuilt Junit allows one to quickly create test case classes and test suite classes to write test code in. With Eclipse, Test Driven Development (TDD), becomes very easy to organize and implement. The class that one will want to test is created first so that Eclipse will be able to find that class under test when one builds the test case class. The test cases are built with the needed imports and extensions for JUnit to run. Once the test case class is built the actual test cases are then coded in by the programmer.
Junit has the following naming conventions:-
It is considered a best practice in testing, to separate the test case code from the application. JUnit convention is that there is a test class created for every application class that does not contain GUI code. Usually all paths through each method in a class are tested in a unit test; however, you do not need to test trivial getter and setter methods.
|