Skip to main content

Module 3 · Test design

Equivalence partitions and boundary values

Choose a small set of inputs that still covers each rule and its edges.

About 10 min reading and 10 min practice (estimates)

Loading progress…

Read

Learning objectives

  • Split an input into valid and invalid partitions.
  • Pick boundary values on and around each edge.
  • Combine both techniques into a small, strong data set.

Explanation

Equivalence partitioning groups inputs the system should treat the same way; testing one value from each group is usually enough. Boundary value analysis then adds the values at the edges of each group, because "less than" versus "less than or equal" mistakes live there.

For a range from min to max, the common two-value approach tests min−1, min, max and max+1. A three-value approach adds min+1 and max−1. Remember invalid partitions too: empty input, wrong type, too long, unexpected characters.

Example: cart quantity (1–10 per line)

PartitionExample valueExpected
Below range (invalid)0Not allowed; the − button is disabled at 1
In range (valid)5Line total = price × 5
Above range (invalid)11Not allowed; the + button is disabled at 10

Boundary values: 0, 1, 2, 9, 10, 11. Six values cover the whole rule, instead of trying every number from 1 to 10.

Common mistakes

  • Testing only a typical value and assuming edges work.
  • Testing only one side of a boundary.
  • Forgetting invalid partitions such as empty, negative or non-numeric input.
  • Applying the technique to money without considering rounding (e.g. 19.999 versus 20.000).

Try

Practise what you just read. Answers are checked here; nothing is graded publicly or counts toward Bug Arena.

Exercise

A password must be 10 to 128 characters long. Which set applies two-value boundary analysis correctly?

Choose one answer.

Review

Check yourself — you should now be able to:

  • Split an input into valid and invalid partitions.
  • Pick boundary values on and around each edge.
  • Combine both techniques into a small, strong data set.

References

Continue

When you’re ready, mark the lesson complete in the Try step and move on.

Marked as read when you reach the end of the lesson.