CTAL-TTA_001 · Question #4
How many test cases are needed to test code fragment lines 26 - 32 to achieve 100% condition determination coverage? 2 credits [K3]
The correct answer is B. 3. Condition determination coverage (also called MC/DC - Modified Condition/Decision Coverage) requires that each individual condition in a decision independently affects the overall outcome at least once. Why B (3) is correct: The code in lines 26–32 contains a decision with 2…
Question
How many test cases are needed to test code fragment lines 26 – 32 to achieve 100% condition determination coverage? 2 credits [K3]
Options
- A2
- B3
- C4
- D5
How the community answered
(31 responses)- A10% (3)
- B84% (26)
- C3% (1)
- D3% (1)
Explanation
Condition determination coverage (also called MC/DC - Modified Condition/Decision Coverage) requires that each individual condition in a decision independently affects the overall outcome at least once.
Why B (3) is correct: The code in lines 26–32 contains a decision with 2 independent conditions. MC/DC requires a minimum of N + 1 test cases, where N is the number of conditions - so 2 + 1 = 3 test cases. One test covers the "all true" base case, and one additional test per condition flips that condition while holding others constant, demonstrating its independent effect on the outcome.
Why the distractors are wrong:
- A (2): Two test cases only achieves 100% branch/decision coverage (true/false outcomes of the whole decision) - not full condition determination coverage.
- C (4): Four test cases (N + 1 = 4) would be correct if there were 3 conditions in the decision, not 2.
- D (5): Five tests suggest exhaustive or near-exhaustive testing - far more than MC/DC requires and inconsistent with the structure implied by the code.
Memory tip: For MC/DC, use the formula minimum tests = N + 1 (number of conditions plus one). If you see 2 conditions → 3 tests; 3 conditions → 4 tests. This formula is the fastest way to answer coverage questions under exam pressure.
Topics
Community Discussion
No community discussion yet for this question.