ITPEC FE Morning April 2023 Question 49
ITPEC FE Morning April 2023 — Question 49 of 80
Decision Condition Coverage (Branch Coverage) — select test cases that cover both decision outcomes.
Condition: A OR B
Branch coverage requires that the decision (A OR B) evaluates to both True and False at least once.
- •
A OR B = FALSE→ both A and B must beFalse - •
A OR B = TRUE→ at least one must beTrue
(c) covers both branches:
| Test case | A | B | A OR B | Branch |
|---|---|---|---|---|
| 1 | False | False | FALSE | FALSE path |
| 2 | True | True | TRUE | TRUE path |
Why not others:
- (a) (False, True) → only TRUE branch covered; no FALSE branch
- (b) (False, True) and (True, False) → both give TRUE; FALSE branch never covered
- (d) Three test cases — covers both branches but is redundant; not the minimal set
Key rule: Branch coverage = every decision outcome (TRUE/FALSE) must occur at least once. For OR, getting FALSE requires all conditions to be False.
AI-generated — may contain errors
The original exam layout is preserved in the image so diagrams, formulas, tables, and code remain accurate.
This question comes from an official ITPEC past paper. ITPEC Practice is an independent study tool and is not affiliated with ITPEC. See the official FE past-paper collection or Report an issue.