Junit Articles about
Junit
 

Information About

Junit




JUnit should not be confused with G Unit


JUnit is a Unit Testing framework for the Java Programming Language . Created by Kent Beck and Erich Gamma , JUnit is one, and arguably the most successful, of the XUnit family of frameworks that originated with Kent Beck's SUnit . JUnit has spawned its own ecosystem of JUnit extensions .


Experience gained with JUnit has been important in the development of Test-driven Development , and as a result, some knowledge of JUnit is often presumed in discussions of test-driven development, for example in the book ''Test-Driven Development: By Example'', ISBN 0-321-14653-0 by Kent Beck.

JUnit has been ported to other languages, including C# ( NUnit ), Python ( PyUnit ) and C++ ( CppUnit ). This family of unit testing frameworks is referred to collectively as XUnit . TestNG has many of the same goals as JUnit.

"Hello world" example in JUnit:

public class HelloWorld extends TestCase
{
public void testMultiplication()
{
  • 2=4:

  • 2);

  • }

}

(compare with the similar example for Mauve .)

The method testMultiplication will be discovered automatically by reflection.


EXTERNAL LINKS



BOOKS ON JUNIT