CTFL_SYLL_4.0 · Question #97
You are using boundary value analysis to determine your test data. What values should you use to test a routine that requires an integer input (x) to be greater than zero and less than 100 to…
The correct answer is B. -1, 1, 99, 101. Option B (-1, 1, 99, 101) is correct because two-point boundary value analysis tests one value just outside (invalid) and one value just inside (valid) each boundary. Since the condition is x > 0 and x < 100, the lower boundary sits at 0 and the upper at 100 - making 1 the…
Question
You are using boundary value analysis to determine your test data. What values should you use to test a routine that requires an integer input (x) to be greater than zero and less than 100 to achieve 100% minimum coverage using the two-point boundary value analysis technique?
Options
- A0, 100
- B-1, 1, 99, 101
- C0, 1, 99, 100
- D-1, 0, 1, 99, 100, 101
How the community answered
(26 responses)- A4% (1)
- B73% (19)
- C8% (2)
- D15% (4)
Explanation
Option B (-1, 1, 99, 101) is correct because two-point boundary value analysis tests one value just outside (invalid) and one value just inside (valid) each boundary. Since the condition is x > 0 and x < 100, the lower boundary sits at 0 and the upper at 100 - making 1 the first valid value and -1 invalid on the low side, and 99 the last valid value and 101 invalid on the high side.
Why the distractors fail:
- A (0, 100) tests the exact boundary points themselves, not values on either side - this misunderstands what BVA is probing.
- C (0, 1, 99, 100) includes the actual boundaries (0 and 100) alongside the nearest valid values, which blends approaches but doesn't correctly apply two-point BVA.
- D (-1, 0, 1, 99, 100, 101) is the correct answer for three-point BVA (below, at, and above each boundary) - a common trap answer on this topic.
Memory tip: Think of two-point BVA as "fail then pass" at each fence - you test the value that just misses the condition and the value that just meets it, so you have exactly two points per boundary.
Topics
Community Discussion
No community discussion yet for this question.