25-Comp-B11 Advanced Software Design · December 2018
Nivaar worked solution (AI-drafted; not reviewed by a licensed engineer) · Last updated
Question text not reproduced: the examination questions are © Engineers and Geoscientists BC. Open the official past paper (linked at the top of this page) to read the question, then follow the worked solution below.
Approach. The valid input domain is the closed interval [$10.00, $1,200.00]. Boundary Value Analysis (BVA, Question 6) is the standard technique for choosing a small, high-yield set of test inputs for a bounded numeric input: rather than sampling arbitrary interior points, BVA specifically targets the boundary itself and its immediate neighbourhood, since off-by-one errors in range-checking code (> instead of ≥, < instead of ≤) manifest exactly at a boundary and nowhere else. A complete BVA set for a single bounded range covers five distinct classes: a value just BELOW the minimum (invalid), the minimum itself (valid boundary), a NOMINAL interior value (valid), the maximum itself (valid boundary), and a value just ABOVE the maximum (invalid).
| Option | Values | Classes covered | Boundaries hit? |
|---|---|---|---|
| A | 6.00, 9.00, 55.00, 900.00 | invalid-low (x2), nominal (x2) | Neither boundary tested |
| B | 8.50, 150.00, 1200.00 | invalid-low, nominal, boundary-max | Max only; no invalid-high, no boundary-min |
| C | 5.12, 10.00, 500.00, 1200.00, 1500.30 | invalid-low, boundary-min, nominal, boundary-max, invalid-high | Both boundaries tested, with an invalid neighbour on each side |
| D | 5.00, 600.00, 1300.00, 1500.00 | invalid-low, nominal, invalid-high (x2) | Neither boundary tested; redundant second invalid-high |
| E | 10.00, 150.00, 1300.00 | boundary-min, nominal, invalid-high | Min only; no invalid-low, no boundary-max |
Why C is the best choice. Only C exercises all five BVA classes: 5.12 (just below the minimum, must be rejected), 10.00 (the minimum itself, must be accepted — this is exactly the value an off-by-one >-instead-of-≥ bug would wrongly reject), 500.00 (an ordinary interior value, confirming the "obviously valid" case also works), 1,200.00 (the maximum itself, must be accepted — the value an off-by-one <-instead-of-≤ bug would wrongly reject), and 1,500.30 (just above the maximum, must be rejected). Every other option leaves at least one boundary untested: A tests neither boundary; B and E each test only ONE boundary and are each missing an invalid case on the untested side; D tests neither exact boundary value and wastes a test on a redundant second invalid-high value that adds no new coverage.
| Item | Result |
|---|---|
| Valid range | $10.00 ≤ price ≤ $1,200.00 |
| BVA classes needed | invalid-low, boundary-min, nominal, boundary-max, invalid-high (5 classes) |
| Best selection | Option C — the only set covering all 5 classes |