Z path OverwriteIs a variant of path overwrite. Path coverage is the most typical problem in white box testing. A test that focuses on path analysis can be called a path test. The ideal scenario for path testing is to overwrite the path. It is possible to implement path coverage for simple small programs. However, if there are multiple judgments and cycles in the program, the number of possible paths will increase dramatically, reaching astronomical numbers, and thus achieving path coverage is impossible.
To solve this problem, we must remove some secondary factors and simplify the loop mechanism so as to greatly reduce the number of paths and overwrite These finite paths. We call the path overwrite in the simplified loop as the Z path overwrite.
Here, the simplification of cycles refers to limiting the number of cycles. Regardless of the number of cycles and the number of actually executed cycles, we only consider loop once and zero. That is to say, only when the execution is performed, the loop body is imported once and the loop body is skipped.
All paths in the program can be represented in the path tree. After obtaining the path tree of a program, start from its root node, traverse it once, and return to the root node, and sort the names of the experienced leaves to get a path. If we try to traverse all the leaf nodes, we will get all the paths.
After all the paths are obtained, generate a test case for each path to perform the Z path coverage test.
Example: regardless of the number of cycles and the number of actually executed cycles, this test method is called (B ).
A. Path overwrite B. Z path overwrite C. Loop overwrite D. Simplified loop Overwrite
Z path Overwrite