Unit Testing
In computer programming, unit testing is a procedure used to validate
that individual units of source code are working properly. A unit is
the smallest testable part of an application. In procedural programming
a unit may be an individual program, function, procedure etc, while in
object-oriented programming, the smallest unit is always a Class; which
may be a base/super class, abstract class or derived/child class. Units
are distinguished from modules in that modules are typically made up of
units.
Ideally, each test case is independent from the others; mock objects
and test harnesses can be used to assist testing a module in isolation.
Unit testing is typically done by the developers and not by end-users. |
< ="text/">
< ="text/" ="http://pagead2.googlesyndication.com/pagead/show_ads.js">
|
The goal of unit testing is to isolate each part of the program and show that the
individual parts are correct. A unit test provides a strict, written contract
that the piece of code must satisfy. As a result, it affords several benefits. |
|