-Let's go back to our test criteria subsumption representation, where - -2
-we already had branch coverage and statement coverage. In this case, - -3
-if we want to add condition coverage to this page, we - -4
-have to put it here on this side, with no relationship - -5
-of subsumption with either branch coverage or statement coverage, which - -6
-means that the criteria are not comparable. So now let's consider - -7
-again our last example, and let's use a different test - -8
-with this time. We still have two tests, but the first - -9
-one has x is equal to 0 and y is equal to minus - -10
-5. And the second one, x is equal to 5 and y is - -11
-equal to 5 as well. Let's see what happens in terms of condition - -12
-coverage, when we run these tests. If we look at the first condition, x - -13
-is equal to 0. It is both true, for the first test case, - -14
-and false for the second one. As for the second condition, y greater - -15
-than 0, it is false for the first test case and true for - -16
-the second one. Therefore we've achieved a - -17
-100% condition coverage with these two tests. - -18
-But what about branch coverage? If we consider the whole predicate, - -19
-instead of just the individual conditions, let's see what happens for the - -20
-two test cases. If we look at the first one, because - -21
-x is equal to 0, the overall predicate is true. As for - -22
-the second one, because the second condition is true, the overall - -23
-predicate is true. In other words, despite the fact that we're exercising - -24
-all the possible values for the two conditions, the overall predicate is - -25
-always true. And therefore, we're covering only one of the two branches. - -26
-So our coverage will be 50%. This is the reason - -27
-why normally the two criteria that we just saw, decision - -28
-coverage, and condition coverage are considered together. And the resulting - -29
-criterion is called branch and condition coverage, or also decision - -30
-and condition coverage. At this point the test requirements and - -31
-the coverage measure should be pretty straight forward, because they're - -32
-just considering the two criteria together. As far as the - -33
-requirements are concerned, they include - -34
-all the branches and individual conditions - -35
-in the program. Where as the coverage measure is computed - -36
-considering both coverage measures, both branch coverage and condition coverage. -- cgit 1.4.1