A unit test is a procedure used to verify that a particular module of source code is working properly. The idea about unit tests is to write test cases for all functions and methods so that whenever a change causes a regression, it can be quickly identified and fixed. Ideally, each test case is separate from all others.
Unit testing is mostly done by the developers and not by end-users. The concept is part of the Extreme Programming method of software engineering.
Various unit testing frameworks, based on a design by Kent Beck, have come to be known collectively as xUnit, and are available for many programming languages and development platforms.
Unit testing is the building block to test driven development (TDD).