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?

  1. A10, 40, 90
  2. B17, 18, 64, 65
  3. 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.
Practice this topic Back to topic

Related calculators

Books on Software Development and Project Management Ad

As an Amazon Associate I earn from qualifying purchases.

More Software Development and Project Management questions

  1. The specification says 'issue a warning if the temperature is 85 °C or higher', but the firmware mistakenly contains 'if (t > 85)'. The temperature t is an integer. Which of the following test values can detect this error?
  2. The values of temp and err can be chosen independently of each other. For the code 'if (temp > 80) { fan = HIGH; } else { fan = LOW; } if (err) { log(); }', what is the minimum number of test cases needed to achieve statement coverage (executing every statement at least once)?
  3. The truth values of a, b and c can be chosen independently of each other. For the code 'if (a) { S1; } if (b) { S2; } if (c) { S3; }', what is the minimum number of test cases needed to achieve branch coverage (executing both the true and false outcomes of every decision at least once)?
  4. For the decision 'A and B' (A and B are conditions whose truth values can be set independently), two test cases were run: (A = true, B = false) and (A = false, B = true). Which statement about coverage criteria is correct?
  5. In bottom-up testing, what is built to stand in for a higher-level module that does not exist yet, so that it calls the lower-level module under test, passes it test data and receives the results?