Original Date: 01/23/1995
Revision Date: 01/18/2007
Information : Software Unit Testing
Sandia National Laboratories' Surety Assessment Center developed a process guidebook to help improve past practices in software unit testing. Policy, techniques, standards, metrics, tools, and training are part of this process model.
Debugging software errors in system test was difficult and costly and many errors were not found until system test. However, using standard testing techniques on the individual functions or units, software errors could be detected early in development. Many software programmers had not been exposed to software unit testing, were reluctant to perform extra testing to a "good" program, and had not been required to show evidence as part of their work requirement. If unit testing was done, it was not forwarded to the customers, other programmers, or the system integrator. The system integrator would do unit testing in a system context, costing up to 100 times as much.
The new unit test process begins with establishing testable unit requirements from the software design documents. Testware design produces sampling and combining rules, sample sets, transition sequence rules, sequence sets, test case descriptions, and test case sequences. Software design produces the data structures, functions, and domain definitions. Simple rules for choosing test cases generate test scripts which can be applied to the unit through a testware driver and stubs. The test case catalog traces test cases to the unit's requirements, and the test results give repeatable pass/fail indications and a measure of testing comprehensiveness. The test execution framework is simple C language source code, completely isolating the software unit under test. The unit software to be tested does not need any simple "hooks" inserted to enable automated testing.
Designing for testability creates modular software with clearly defined interfaces. Regression testing of the unit software ensures code integrity. The unit testing process at Sandia helps developers to perform effective unit testing. The process reports what is known about each units' behavior, guaranteeing the system integrator of proven capabilities.
For more information see the
Point of Contact for this survey.