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 questionsCondition 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).
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.
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
Keep practicing
Take the free ISTQB-ATTA practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other ISTQB-ATTA practice questions
- Question 3Which additional set of test cases is needed to achieve both 100% statement coverage and …
- Question 6It has been suggested to organize a performance test to find out more regarding the third…
- Question 7To address reliability a number of measures will be taken throughout the development and …
- Question 8A developer has spent three days looking at a system that crashes now and then. The probl…
- Question 9Based on the state diagram above, how many test cases are needed to achieve 1-switch cove…
- Question 10What is the value of statement coverage achieved by test case 1 from test set A? 2 credit…
