Boundary Value Analysis
// Definition
Testing values immediately at and around boundaries (e.g., min, max, just-below, just-above). Bugs cluster at edges — this technique catches off-by-one errors that equivalence partitioning alone misses.
// Why it matters
Bugs cluster at boundaries — off-by-one errors, < vs <=, the empty case, the max case. BVA says: test the edges of every input range, not the comfortable middle. It's the highest-yield test-design technique because it targets exactly where developers slip, with very few cases.
// How to test
// Field accepts 1–100. Test the boundaries, not just "50".
const cases = [
{ v: 0, ok: false }, // just below min
{ v: 1, ok: true }, // min
{ v: 100, ok: true }, // max
{ v: 101, ok: false }, // just above max
]
cases.forEach(({ v, ok }) => {
cy.get('[data-cy=qty]').clear().type(`${v}`)
cy.get('[data-cy=submit]').click()
cy.get('[data-cy=error]').should(ok ? 'not.exist' : 'exist')
})// Common mistakes
- Testing a value "in range" and assuming the boundaries work too
- Forgetting the empty / null / zero-length boundary
- Missing the just-inside vs just-outside pair (the off-by-one catcher)
// Related terms
Equivalence Partitioning
Dividing the input space into groups where the system should behave identically, then testing one representative value per group. Reduces redundant test cases dramatically without losing coverage.
Decision Table
A truth-table-style testing technique that maps every combination of input conditions to expected outputs. Best for rule-based logic with multiple inputs — exposes missing rules and conflicts at design time.
Test Case
A single, executable specification: preconditions, steps, expected result, and pass/fail criteria for one verification.
Learn more · Software Testing Fundamentals
Chapter 4 · Lesson 2: Boundary Value Analysis