What is the minimum number of test cases required to guarantee both 100% statement coverage and 100% decision coverage?

End

What is the minimum number of test cases required to guarantee both 100% statement coverage and 100% decision coverage?
A . Statement coverage = 3, Decision coverage = 3
B . Statement coverage = 2, Decision coverage = 2
C . Statement coverage = 1, Decision coverage = 2
D . Statement coverage = 2, Decision coverage = 1

Answer: B

Explanation:

The minimum number of test cases required to guarantee both 100% statement coverage and 100% decision coverage is 2. Statement coverage means that every statement in the code is executed at least once by the test cases. Decision coverage means that every possible outcome of each decision (such as if-else statements) is executed at least once by the test cases. To achieve both statement and decision coverage, we need to test two scenarios: one where X > Y and one where X <= Y. This will ensure that all statements and decisions are covered by the test cases. A detailed explanation of statement and decision coverage can be found in A Study Guide to the ISTQB® Foundation Level 2018 Syllabus, pages 61-671.

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments