2-value and 3-value boundaries
Boundary value analysis tests the edges of a range, because off-by-one mistakes (< written for <=, a limit stored one too low) live there. The ISTQB Foundation syllabus defines two variants:
The calculator also lists the three equivalence partitions (below, inside and above the range) with one representative each. Equivalence partitioning says one value per partition is enough to test the behaviour of the partition; the boundary values then test where the partitions meet.
The step decides the neighbours
The closest neighbour of a boundary is one step away, and the step is the smallest difference the input can express. Get it wrong and the test misses the bug:
| Input | Valid range | Step | 2-value boundaries |
|---|---|---|---|
| Age in whole years | 18 to 65 | 1 | 17, 18, 65, 66 |
| Price in cents | 0.01 to 100.00 | 0.01 | 0, 0.01, 100, 100.01 |
| Discount in tenths of a percent | 0 to 50 | 0.1 | -0.1, 0, 50, 50.1 |
A step of 1 on a price field would test 101 and never 100.01, the value an off-by-one in the cents check lets through. The calculator works on whole numbers scaled by the step, so 0.1 + 0.2 comes out as 0.3, not 0.30000000000000004.
Using the generated tests
The pytest and Jest or Vitest blocks list the 3-value set with the expected result for each value. They call accepts(value), a placeholder: replace it with the function, form submit or API call under test. For a value the input should reject, also check how it rejects (an error message, a 400 response), not only that it does.
Ranges are rarely the only rule. A field can have a length limit, a format and a required flag on top; run boundary analysis on each numeric rule, and use the pairwise test generator when several inputs interact.
Sources
Get new posts by email.
Occasional email with new Testland posts and plugin releases.
Unsubscribe any time. Privacy policy