ISTQB-CTFL-FOUNDATION practice question 17 of 35

A program is used to control a manufacturing line (turn machines on and off. start and stop conveyer belts, add raw materials to the flow. etc.). Not…

Full set: 403 questions
A program is used to control a manufacturing line (turn machines on and off. start and stop conveyer belts, add raw materials to the flow. etc.). Not all actions are possible at all times. For example, there are certain manufacturing stages that cannot be stopped - unless there is an emergency. A tester attempts to evaluate if all such cases (where a specific action is not allowed) are covered by the tests. Which coverage metric will provide the needed information for this analysis?
Answer options
A: Code coverage
B: Data flow coverage
C: Statement coverage
D: Branch Coverage Correct answer
Correct Answer:
D. Branch Coverage
Explanation

The scenario describes a system with control flow logic where specific actions are allowed or disallowed based on certain conditions (i.e., manufacturing stages). This logic creates decision points in the code (e.g., "IF stage is X, THEN disallow action Y"). Branch coverage is a white-box metric that measures whether the outcomes of all such decision points have been tested (i.e., both the 'true' and 'false' branches of an IF statement). This metric directly confirms whether the tests have exercised the logic that prevents forbidden actions.

Why Incorrect

A. Code coverage is a general category. Branch coverage is a specific, more rigorous type of code coverage that is appropriate here.
B. Data flow coverage focuses on variable usage paths, which is not the primary concern for testing control flow logic about permissible actions.
C. Statement coverage only ensures that each line of code is run, but it does not guarantee that all decision outcomes have been tested.

References

1. ISTQB® Certified Tester Foundation Level Syllabus v4.0, Section 4.3.2, "Statement and Branch Testing," explains that "Branch coverage measures the coverage of branches" and is stronger than statement coverage. It states that 100% branch coverage implies 100% statement coverage. The scenario is a classic example where testing decision outcomes is critical.

2. ISTQB® Glossary of Testing Terms v4.0, Definition of "branch coverage": "The percentage of branches that have been exercised by a test suite."

Scroll to Top