ISQI Certified Tester Foundation Level — Question 16
How many test cases are necessary to cover all the possible sequences of statements (paths) for the following program fragment?
Assume that the two conditions are independent of each other : -if (Condition 1)then statement 1else statement 2if (Condition 2)then statement 3
Answer options
- A. 2 Test Cases
- B. 3 Test Cases
- C. 4 Test Cases
- D. Not achievable
Correct answer: A
Explanation
The correct answer is A, as the independent conditions allow for a combination of outcomes. Since each condition can be either true or false, only two test cases are needed to cover all paths: one where both conditions are true and one where both are false. Options B, C, and D are incorrect because they either overestimate the required test cases or suggest that coverage is impossible.