Differences between conditional coverage, path coverage, statement coverage, and branch coverage in software testing
For example
If a and B then Action1
If C or D then Action2
The statement overwrites the weakest. Program All the statements in can be executed once. In the above example, you only need to design a test case so that a = true B = true c = true.
Branch coverage, also known as decision coverage, allows each decision in the program to take the true branch and take the false branch at least once, that is, the true and false of the judgment have been satisfied. In the above example, You need to design a test case so that it meets the following conditions respectively (1) A = true, B = true, c = true, D = false (2) A = true, B = false, c = false, D = false.
Condition coverage: the possible values of each condition in each judgment must be met at least once. In the above example, the first judgment should take into account a = true, A = false, B = true, B = false. The second judgment should take into account c = true, c = false, D = true, D = false, so in the above example, you can design a test case to meet the following conditions: (1) A = true, B = true, c = true, D = true (2) A = false, B = false, c = false, D = false.
Path overwrite: overwrite all possible paths in the program. Therefore, you can design test cases to meet the following conditions: (1) A = true, B = true, c = true, D = true (2) A = false, B = false, C = false, D = false (3) A = true, B = true, c = false, D = false (4) A = false, B = false, c = true, D = true.
No matter the method of overwriting, the correctness of the program cannot be guaranteed.