Recently in the review software worker here today to summarize the various white box tests covered ~

Order from high coverage to low coverage:

1.Path coverage
2.Combinatory coverage(multiple condition/combination coverage)
3. The Clause/ the Branch coverage
例 句 : The Clause is for coverage.
例 句 : The government has Branch coverage of the country.
6.Statement coverage

Here’s an example:

Path coverage – Path coverage



For path coverage, every combination of every path is traversed.

Here I have marked the abcDEF paths that may fork. For path coverage, I should go through the following paths:

acef

bcef

acdf

bcdf

Multiple condition coverage/combination coverage combinatory coverage

Every combination of clauses in every judgment is covered

X >3 and z<10

x>3 z<10 x>3 and z<10
1 T T T
2 T F F
3 F T F
4 F F F

X ==4 or y>5

x==4 y>5 x==4 or y>5
1 T T T
2 T F F
3 F T F
4 F F F

A set of test cases: (you will find that after inspection can meet all of the above 8) 1) {x = 4, y = 6, z = 5} 2) {x = 4, y = 3, z = 10} 3) {x = 3, y = 4, z = 5} 4) {x = 3, y = 6, z = 11}

Condition/judgment override
Clause coverage



The different true and false values of each clause in each judgment are taken once

X == 3 x==4 y == 3 x== 3 y == 3 x== 3 And so on and so forth

A set of test cases:

  1. {x=4, y=5, z=5}
  2. {x=3, y=6, z=15}
Judge to cover branch coverage



Marked on the graph, each judgment is followed by a result of T and F.

Judgment coverage is covered in test cases that can take at least one T and at least one F for each judgment.

A set of test cases:

  1. {x=4, y=5, z=5}
  2. {x=2, y=5, z=5}