ITPEC FE Morning April 2020 Question 48
Test data about the part of a program shown in the flowchart below is specified by decision condition coverage (branch coverage). When this test data is changed to being specified by multiple-condition coverage, which of the following is the appropriate test data to be added? Here, the part enclosed by parentheses () represents the set of test data.
- •Test data by 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.