JUnit is an open source framework designed for the purpose of writing and running tests in the Java programming language. JUnit, originally written by Erich Gamma and Kent Beck, has been important in the evolution of test-driven development, which is part of a larger software design paradigm known as Extreme Programming (XP).

JUnit has a graphical user interface (GUI), making it possible to write and test source code quickly and easily. JUnit allows the developer to incrementally build test suites to measure progress and detect unintended side effects. Tests can be run continuously. Results are provided immediately. JUnit shows test progress in a bar that is normally green but turns red when a test fails. An ongoing list of unsuccessful tests appears in a space near the bottom of the display window. Multiple tests can be run concurrently. No subjective human judgments or interpretations of test results are required. The simplicity of JUnit makes it possible for the software developer to easily correct bugs as they are found.

Although JUnit was originally written for Java, spinoffs have developed for several other programming languages. The entire family of related testing frameworks is called xUnit.

This was last updated in August 2010

Continue Reading About JUnit

Dig Deeper on Software design and development