Back to the glossary

Test levels and methods

Boundary value analysis

Boundary value analysis is a technique for deriving test cases that deliberately checks values at and just beside the limits of an allowed range, because that is where many defects hide.

Also known as: boundary testing

Why the boundaries?

Defects rarely happen in the middle of a range, but at its edges: < instead of <=, a counter that is off by one, an overflow at 255. Boundary value analysis exploits this and saves many test cases that would show nothing new anyway.

An example

An input accepts values from 10 to 100. Useful test values are:

  • 9 and 10 at the lower boundary
  • 100 and 101 at the upper boundary
  • a value from the middle, such as 50, as the normal case

Five test cases cover the behaviour well, instead of checking 91 individual values.

Together with equivalence partitioning

Boundary value analysis is usually combined with equivalence partitioning: inputs are split into groups that should behave the same, such as “valid”, “too small” and “too large”, and one representative of each is tested along with the boundaries between them. This works for form fields just as well as for sensor values or time windows.