ITPEC FE Subject A April 2024 Question 37

There is a program module that is executed only when the integer value of integer x is 25 ≤ x < 50. When testing this module using boundary value analysis, which of the following is an appropriate combination of values to be tested?

Explanation

24, 25, 49, 50 — test each edge of the valid range together with the nearest invalid value just outside it.

For integers, 25 ≤ x < 50 means the valid values are 25 to 49.

  • •Lower edge: 25 is the smallest valid value and 24 the largest invalid value below it
  • •Upper edge: 49 is the largest valid value and 50 the smallest invalid value above it

Answer (a)

Why not others:

  • •(b) 24, 25, 50, 51 — treats 50 as if it were valid; since x < 50 excludes 50, the valid edge is 49 and 51 is not next to any boundary
  • •(c) 25, 26, 49, 50 — misses 24, the invalid value just below the lower edge; 26 is an interior value
  • •(d) 25, 26, 50, 51 — misses both invalid neighbours on the lower side and the valid edge 49 on the upper side

Key rule: Turn the condition into the actual first and last valid values before choosing boundary tests: with a strict inequality, the last valid integer is one less than the limit.

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.