ISTQB-ATTA practice question 4 of 15

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

Full set: 65 questions
Answer options
A: 2
B: 3 Correct answer
C: 4
D: 5
Correct Answer:
B. 3
Explanation

Condition Determination Coverage (CDC) requires that each individual condition is shown to independently affect the decision's outcome. For the expression (A AND B), we need test cases to satisfy this.
1. To show condition 'A' determines the outcome, we hold 'B' constant (True) and vary 'A': (A=True, B=True) results in True, while (A=False, B=True) results in False.
2. To show condition 'B' determines the outcome, we hold 'A' constant (True) and vary 'B': (A=True, B=True) results in True, while (A=True, B=False) results in False. Combining these requires a minimum of three unique test cases: (T,T), (F,T), and (T,F).

Why Incorrect

A. 2 test cases are insufficient as they cannot demonstrate that each of the two conditions independently affects the outcome. This would be the minimum for branch coverage.
C. 4 test cases would be required for Multiple Condition Coverage (MCC), which tests every possible combination of outcomes for the conditions (T,T), (T,F), (F,T), (F,F).
D. 5 test cases are excessive for a decision with only two conditions and would only be plausible for a more complex decision with three or more conditions.

References

1. ISTQB Advanced Level Syllabus

Technical Test Analyst

Version 3.1.1 (2019)

Section 2.3.2

"Condition Determination Coverage". The syllabus states

"This technique requires that for each decision

test cases are created to execute each condition with both the TRUE and the FALSE outcome

and that each condition is shown to independently affect the outcome of the decision." The logic for requiring N+1 test cases for N independent conditions is a direct application of this principle.

2. Ammann

P.

& Offutt

J. (2016). Introduction to Software Testing (2nd ed.). Cambridge University Press. Chapter 8

Section 8.3.3

"Active Clause Coverage". This academic text (which covers the same concept under a different name) explains that for a clause (condition) c in a predicate p

we need a pair of tests where c evaluates to true and false

all other clauses have the same values

and the predicate p evaluates to true and false respectively. For (A and B)

this requires 3 test cases. DOI: https://doi.org/10.1017/CBO9781316771273

Scroll to Top