Boundary Value Analysis (BVA)
Definition
Boundary Value Analysis is a black-box test case design technique based on the observation that errors tend to occur at the boundaries (edges) of input ranges, rather than in the middle — so test cases are designed specifically around these boundary values.
Core Principle
For a valid input range [min, max], test at:
- min (the boundary itself)
- min − 1 (just below the boundary, invalid)
- min + 1 (just above the boundary, valid)
- max (the boundary itself)
- max − 1 (just below the boundary, valid)
- max + 1 (just above the boundary, invalid)
Example
For an input field accepting age 1 to 100:
| Test Value | Expected Result |
|---|---|
| 0 | Invalid (below min) |
| 1 | Valid (min boundary) |
| 2 | Valid (min + 1) |
| 99 | Valid (max − 1) |
| 100 | Valid (max boundary) |
| 101 | Invalid (above max) |
This gives 6 test cases instead of testing every value from 1-100.
Why BVA Works
- Off-by-one errors (
<vs<=,>vs>=) are among the most common programming mistakes - Testing at boundaries catches these errors far more efficiently than random or middle-range testing
Extended BVA (Robustness Testing)
Some variants also test extreme/invalid values (e.g., min − 2, max + 2) to check robustness against grossly invalid input.
Advantages
- Highly effective at finding real-world bugs (many bugs cluster at boundaries)
- Efficient — requires very few test cases relative to the input range
- Simple and systematic to apply
Limitations
- Doesn't cover errors that occur inside the range, away from boundaries
- Less effective for inputs without clear numeric boundaries (e.g., free-text fields)
When to Use
- Whenever input has a defined valid range (numeric ranges, string lengths, array indices, dates)
Exam tip: A near-guaranteed numerical question: "Design boundary value test cases for input range X to Y" — always give the 6 standard boundary points (min−1, min, min+1, max−1, max, max+1).