Software Development and Project Management
A program sets the admission fee by age (an integer of 0 or more): ages 0 to 17 pay the child fee, 18 to 64 the adult fee, and 65 or older the senior fee. Which set of test values is most appropriate for boundary value analysis to check the boundaries where the fee category changes?
- A10, 40, 90
- B17, 18, 64, 65
- C18, 65
Show answer and explanation
Answer: B. 17, 18, 64, 65
Because defects tend to cluster at the boundaries between equivalence classes, boundary value analysis tests the values immediately on both sides of each boundary. At the child/adult boundary 17 and 18 are chosen, and at the adult/senior boundary 64 and 65, giving the four values 17, 18, 64 and 65. Errors such as writing '<' instead of '<=' in a condition may not be found by testing only one side of a boundary. 10, 40 and 90 are equivalence-partitioning values chosen as representatives of each category, and they cannot check errors at the boundaries.
- A. These are equivalence-partitioning values, one representative per category, and they do not check how the boundaries are handled.
- B. Correct. The values immediately on both sides of each of the two boundaries are tested.
- C. These are only the first values of the new categories. For example, if the child-fee condition were mistakenly written as 'under 17', age 18 would still correctly get the adult fee, so the error would not be found.
Continue: 9 more Software Development and Project Management questions