[Original] white box test case Design Method
The white-box test case design methods are divided into logical coverage test and basic path test.
Logical overwrite includes statement overwrite, decision overwrite, condition overwrite, decision condition overwrite, condition combination overwrite, and path overwrite, as shown in the following figure:
Statement overwrite is to design several test cases to run the tested program so that each executable statement can be executed at least once. Decision coverage is to design several test cases to run the tested program, so that each of the true branches and false branches in the program can go through at least once. Conditional coverage is to design several test cases and run the tested program so that the values of each criterion in the program can be executed at least once. A sufficient test case is designed to ensure that all possible values of each condition in the judgment are executed at least once, and each branch in the judgment is executed at least once. Conditional combination coverage is to design enough test cases to run the tested program, so that all possible combinations of conditional values can be executed at least once. Path testing is to design enough test cases to cover all possible paths in the program.
The basic path test method compresses the Number of Covered paths to a certain limit, and the loop body in the program can only be executed once at most.
Based on the control flow diagram of the program, it analyzes the loop complexity of the control structure, exports the set of basic executable paths, and designs the test cases. The designed test cases must ensure that each executable statement of the program must be executed at least once during the test.