ITPEC FE Subject A April 2025 Question 37

Test cases for the part of a program shown in the flowchart below are created to achieve decision condition coverage (branch coverage). In order to make the test cases achieve multiple-condition coverage, which of the following is the appropriate set of test cases to be added? Here, the part enclosed by parentheses () represents a test case.

Process 1A > 6 or B = 0NoYesProcess 2
•Test cases to achieve decision condition coverage (branch coverage) (A = 4, B = 1), (A = 5, B = 0)

Explanation

(A = 7, B = 0) and (A = 8, B = 2) — multiple-condition coverage needs every true/false combination of the two conditions.

The decision has two conditions, A > 6 and B = 0, so there are 22 = 4 combinations to cover. The existing branch coverage cases give two of them:

  • •(A = 4, B = 1): A > 6 false, B = 0 false, taking No
  • •(A = 5, B = 0): A > 6 false, B = 0 true, taking Yes

Still missing are A > 6 true with B = 0 true, and A > 6 true with B = 0 false. (A = 7, B = 0) gives true, true and (A = 8, B = 2) gives true, false, completing all four.

Answer (d)

Why not others:

  • •(a) — (A = 3, B = 0) repeats false, true and (A = 7, B = 2) adds true, false, so true, true is still missing
  • •(b) — (A = 3, B = 2) repeats false, false and (A = 8, B = 0) adds true, true, so true, false is still missing
  • •(c) — (A = 4, B = 0) repeats false, true and (A = 8, B = 0) adds true, true, so true, false is still missing

Key rule: For multiple-condition coverage, list all 2n true/false combinations of the n conditions and add only the missing ones; branch coverage needs just one Yes and one No outcome.

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.