-And this criterion is called Modified Condition/Decision Coverage, - -2
-also called MC/DC. This criterion is very important because - -3
-it is often required for safety critical applications. - -4
-For example, the FAA, the Federal Aviation Administration, requires - -5
-for all the software that runs on commercial - -6
-airplanes to be tested according to the Modified Condition/Decision - -7
-Coverage. So what is the key idea behind the - -8
-MC/DC criterion? It is to test only the important - -9
-combinations of conditions instead of all of them, and limit - -10
-the testing cost by excluding the other combinations. And the way - -11
-in which it works is by extending branch and decision - -12
-coverage with the requirement that each condition should affect the decision - -13
-outcome independently. So let's see what this means with an - -14
-example that will also show you how you can reduce the - -15
-number of combinations in this way. I am going to - -16
-show you an example of how MC/DC works using this predicate - -17
-which consists of three conditions. a, b, and c, which are all - -18
-in and, so the overall predicate is a and b and c. - -19
-The first thing I'm going to do is to show you how - -20
-many test cases we will need to satisfy the multiple condition coverage - -21
-for this simple predicate. Which means, how many test cases we will - -22
-need to test all the possible combinations of true and false values - -23
-for these conditions. So I'm going to populate this table. And as you - -24
-can see, at the end we have eight test cases. Each test case - -25
-tests a different combination of values for a, b, and c. - -26
-I'm also showing, for each test case, the outcome of the overall - -27
-predicate. So, for example, if we look at the first one, the - -28
-first test case, will be such that a is true, b is - -29
-true, and c is true. And therefore, the overall outcome of - -30
-the predicate is true. Now lets consider the first condition, a. As - -31
-I said a minute ago, what we want to test are the - -32
-important combination. Which are the comibatinos - -33
-in which a single condition independently - -34
-effects the outcome of the overall predicate. So if we consider a - -35
-and we look at this possible set of this cases. Let's try to - -36
-find two test cases such that the only difference between the two - -37
-test cases is the value of a, and the overall outcome of the - -38
-predicate is different. If we look at the table, we can see - -39
-that this is true for test cases one and five. If we look - -40
-at these two cases, we can see that the overall of the predicate - -41
-in the two cases is true and false, and that the only difference - -42
-between the value of the conditions in the value of a. So - -43
-these test cases satisfy exactly what we wanted. There are two test - -44
-cases in which the value of a independently decides the overall value - -45
-of the predicate. What we do, therefore, is to add these first - -46
-two test cases to our set of tests down here. Now let's - -47
-focus on b and let's try to find two test cases such - -48
-that the value of b is the only value that changes between - -49
-the two test cases, but the overall value of the predicate is - -50
-different, the same thing we did for a. And in this case, - -51
-we can see that if we select test case number one, and test - -52
-case number three, we have exactly that situation. b is true in the - -53
-first case, false in the second one, a and c don't change, but - -54
-the overall value of the predicate changes. And now you can notice - -55
-something else. That even though we selected two test cases, tested two values, - -56
-one we already had. So, we only need three test cases overall to - -57
-test a and b according to MC/DC. Now, let's look at our last - -58
-condition, c. At this point, we know the game, so we - -59
-just have to look for two test cases that satisfy our - -60
-requirements. And in this case, one and two are suitable candidates. - -61
-And once more, because we already have one, we just have to - -62
-add two to our list. So as you can see from - -63
-this example, we went from having eight test cases needed to cover - -64
-all the possible combinations of conditions to only four test cases - -65
-to satisfy the MC/DC criteria. So let's see where MC/DC stands in - -66
-our substantion hierarchy. This is what we had so far - -67
-in the hierarchy and this is where the MC/DC criterion will - -68
-stand. MC/DC criterion is stronger than branch and condition coverage. - -69
-Why? Because it requires every single condition to be true and - -70
-false. And therefore, this section was a condition coverage criteria. - -71
-And it also requires every predicate to be true and false - -72
-and therefore, this section is branch coverage. And in addition, - -73
-it's got the additional requirements that the true and false values, - -74
-all the conditions have to also decide the overall - -75
-value of the predicate. So it's stronger. Which is more - -76
-thorough than branch and condition coverage and, as usual, - -77
-also stronger than branch coverage, statement coverage, and condition coverage. -- cgit 1.4.1