nerdexam
iSQI

CTAL-TTA_001 · Question #6

How many test cases are needed to test code fragment lines 26 - 32 to achieve 100% multiple condition coverage? 2 credits [K3]

The correct answer is D. 8. Multiple Condition Coverage (MCC) requires testing every possible combination of truth values for all atomic (individual) boolean conditions in a decision. The formula is 2^N, where N is the number of atomic conditions. The code in lines 26–32 contains 3 atomic conditions, so…

Structure-Based Testing

Question

How many test cases are needed to test code fragment lines 26 – 32 to achieve 100% multiple condition coverage? 2 credits [K3]

Options

  • A2
  • B3
  • C4
  • D8

How the community answered

(24 responses)
  • A
    17% (4)
  • B
    8% (2)
  • C
    4% (1)
  • D
    71% (17)

Explanation

Multiple Condition Coverage (MCC) requires testing every possible combination of truth values for all atomic (individual) boolean conditions in a decision. The formula is 2^N, where N is the number of atomic conditions.

The code in lines 26–32 contains 3 atomic conditions, so 2^3 = 8 test cases are required to cover all combinations (TTT, TTF, TFT, TFF, FTT, FTF, FFT, FFF) - making D correct.

  • A (2) is wrong - 2 test cases would only satisfy branch/decision coverage (true/false) for a single condition, or MCC for just 1 condition (2^1 = 2).
  • B (3) is wrong - 3 is not a power of 2 and has no direct role here; it's a common trap because it looks like "one per line" thinking, or may be confused with MC/DC which needs N+1 tests.
  • C (4) is wrong - 4 would be correct if there were only 2 atomic conditions (2^2 = 4), not 3.

Memory tip: For MCC, think "2 to the power of conditions" - count every individual boolean variable or comparison in the decision, then raise 2 to that count. If you see 3 conditions in a compound if, you immediately know 8 test cases are needed.

Topics

#multiple condition coverage#coverage criteria#test case count#white-box testing

Community Discussion

No community discussion yet for this question.

Full CTAL-TTA_001 Practice