ITPEC FE Morning April 2023 Question 49
Which of the following is an appropriate test case when a test is to be performed with decision condition coverage (branch coverage) on the section of a program shown in the figure below?
Explanation
(A, B) = (False, False) and (True, True) — branch coverage needs the decision A OR B to come out FALSE once and TRUE once.
A OR B is FALSE only when both A and B are False, so any test set with branch coverage must include (False, False).
Both exits of the decision are taken, so the pair in option (c) achieves branch coverage.
Answer (c)
Why not others:
- •(a) — the single case (False, True) gives TRUE, so the FALSE branch is never executed
- •(b) — (False, True) and (True, False) both give TRUE; each condition takes both values (condition coverage), but the FALSE branch is never executed
- •(d) — (False, True), (True, False) and (True, True) all give TRUE, so despite three cases the FALSE branch is still never executed
Key rule: For OR, the FALSE outcome needs every condition False; for AND, the TRUE outcome needs every condition True. Start the test set from that case.
System Development Technology · AI-written, may contain errors
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.