ISTQB-ATTA practice question 3 of 15

Which additional set of test cases is needed to achieve both 100% statement coverage and 100% decision coverage? 3 credits [K3]

Full set: 65 questions
Answer options
A: exam question Correct answer
B: exam question
C: exam question
D: exam question
Correct Answer:
A. https://kxbjsyuhceggsyvxdkof.supabase.co/storage/v1/object/public/file-images/ISTQB_ATTA/page_2_img_1.jpg
Explanation

The analysis assumes the first condition in the code is IF x >= 0 THEN instead of IF x > 0 THEN. With the original code (x > 0), none of the provided options would add the necessary coverage. Given the corrected code and the existing test cases TC1(x=1, y=1) and TC2(x=-1, y=-1):
1. TC1 (x=1, y=1): Covers x >= 0 as TRUE and y > 0 as TRUE. This single test case achieves 100% statement coverage.
2. TC2 (x=-1, y=-1): Covers x >= 0 as FALSE.
3. Missing Coverage: The decision outcome for y > 0 as FALSE has not been tested. To test this, a case is needed where x >= 0 is TRUE and y > 0 is FALSE (i.e., y <= 0). Test case A (x=0, y=0) satisfies these conditions, covering the missing decision outcome and achieving 100% decision coverage.

Why Incorrect

Regarding the question as written (IF x > 0): All options are incorrect, as none provide a test case where x > 0 and y 0 (False) branch. B: This test case (x=1, y=1) is identical to the existing TC1 and provides no new statement or decision coverage. C: With the corrected code (x >= 0), this case (x=0, y=1) makes x >= 0 TRUE and y > 0 TRUE, which is already covered by TC1. D: This is identical to option C and is therefore also incorrect for the same reason.

References

1. ISTQB® Certified Tester Advanced Level - Technical Test Analyst Syllabus Version 1.1 (2021)

Section 2.3.1

"Statement and Decision Testing". This section defines decision coverage as requiring each decision outcome (both TRUE and FALSE branches) to be exercised. The analysis directly applies this principle to identify the missing decision outcome.

2. Ammann

P.

& Offutt

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

"Coverage Criteria

" provides the formal definitions for graph-based coverage

including Edge Coverage

which is equivalent to decision/branch coverage. The logic for finding a test case to cover a specific edge (decision outcome) follows the principles outlined here.

Scroll to Top