Given the following decision: IF X < 5 OR Y > 10 THEN
Which of the following sets of test inputs will achieve full MC/DC coverage?
Options:
A.
X=4 and Y=7
X=6 and Y=12
X=5 and Y=10
B.
X=4 and Y=11
X=7 and Y=10
C.
X=5 and Y=8
X=2 and Y=12
X=4 and Y=4
D.
X=3 and Y=10
X=5 and Y=15
X=0 and Y=15
Answer:
B
Explanation:
To achieve full Modified Condition/Decision Coverage (MC/DC), each condition within a decision must be shown to independently affect the outcome of the decision. For the decision IF X < 5 OR Y > 10 THEN, the conditions are:
Condition 1: X < 5
Condition 2: Y > 10
We need to test these conditions in such a way that each condition independently influences the decision outcome. Let's analyze the options:
Option A:
X=4 and Y=7 (X < 5 is true, Y > 10 is false; overall decision true)
X=6 and Y=12 (X < 5 is false, Y > 10 is true; overall decision true)
X=5 and Y=10 (X < 5 is false, Y > 10 is false; overall decision false)
This set achieves full MC/DC coverage because each condition is shown to independently affect the outcome.
Option B:
X=4 and Y=11 (X < 5 is true, Y > 10 is true; overall decision true)
X=7 and Y=10 (X < 5 is false, Y > 10 is false; overall decision false)
This set achieves full MC/DC coverage because it demonstrates both conditions independently affecting the outcome.
Option C:
X=5 and Y=8 (X < 5 is false, Y > 10 is false; overall decision false)
X=2 and Y=12 (X < 5 is true, Y > 10 is true; overall decision true)
X=4 and Y=4 (X < 5 is true, Y > 10 is false; overall decision true)
This set does not fully achieve MC/DC coverage as it does not demonstrate the impact of Y > 10 being false while X < 5 is false.
Option D:
X=3 and Y=10 (X < 5 is true, Y > 10 is false; overall decision true)
X=5 and Y=15 (X < 5 is false, Y > 10 is true; overall decision true)
X=0 and Y=15 (X < 5 is true, Y > 10 is true; overall decision true)
This set does not achieve MC/DC coverage because it does not show the decision outcome when both conditions are false.
Therefore, the correct answer is B. X=4 and Y=11, X=7 and Y=10.