1. Unit Testing
is a test of the process of a single subroutine in a program, which is a test of the basic components of the software. is the smallest unit of the inspection program, that is, to check whether the module has errors, is the code must be done after the test work.
2. Issues to be concerned with:
1. Target
The function of the module and the definition of the functional specifications of the module or interface specifications of the glue, proving that the module and its specifications are contradictory.
2. Time
Coding--compiling--Unit testing
3. Test Cases
Two types of information are required: The specification of the module and the source code of the module.
Design process: Analyze the logical structure of a module using one or more white-box tests (multiple conditional coverage criteria) and then use the Black-box test method (boundary value analysis) to supplement the test case with the specification of the module.
4. Performer
Program developer or White box tester
Programmers should not test their own modules, but should exchange modules for testing
Programmers who write modules are always the best candidates for testing the module being called
Commissioning of the module is done by the programmer himself
5. Test process
The White box test method is the main, the static check whether the code conforms to the specification, and then dynamically run the code, check the results.
3. Main tasks of unit testing:
module interfaces, local data structures, boundary conditions, independent paths, and error handling
4. Environment for unit testing
By the test module, drive module and the pile module is composed.
When unit testing is not a standalone program, you need to set up some of the auxiliary test modules:
Drive module: Used to simulate the module of the previous level module, equivalent to the main program of the module under test. It is used to receive data, transmit relevant data to the module under test, activate the module under test, and print out the results of the module under test.
Pile module: Used to simulate the module that is called during the working process of the module under test. They typically only have very little data processing.
Software Testing--(6) Module test (unit test)