In computer programming, unit testing is a procedure used to validate that individual modules or units of source code are working properly.
More technically one should consider that a unit is the smallest testable part of an application. In a Procedural Design a unit may be an individual program, function, procedure, web page, menu etc. But in Object Oriented Design, the smallest unit is always a Class; which may be a base/super class, abstract class or derived/child class.
A unit test is a test for a specific unit. Ideally, each test case is independent from the others; mock objects can be used to assist testing a module in isolation. Unit testing is typically done by the developers and not by end-users.What some people fail to grasp is the distinction between unit testing, functional testing, integration testing, and system testing. Far too frequently what people call ``unit'' tests are really ``integration'' tests. The distinction is important because frequently if you set out to write a unit test but find that you can't without first booting up half of the other components in your app it's a safe bet that you've broken encapsulation and are too tightly coupled to other pieces of the system. In general you should be able to write any unit test with basic language objects or the help of a few mock objects http://en.wikipedia.org/wiki/Mock_Object.
K. Rhodes 2007-05-18