Black Box · Specification-Based

Boundary Value Analysis

Test the edges of equivalence partitions. Bugs cluster at boundaries — off-by-one errors, fencepost mistakes, and incorrect comparisons (< vs ≤) almost always appear at the exact limit.

Junior Senior ISTQB CTFL v4.0 — 4.2.2

What it is

Boundary Value Analysis (BVA) is an extension of Equivalence Partitioning. Once you have your partitions, instead of picking a value in the middle, you test the values at and around the boundary between partitions.

Why boundaries? Developers tend to make off-by-one errors. A spec that says "accept 18–65" might be coded as > 18 instead of >= 18 — a bug that only appears at exactly 18.

2-value BVA (ISTQB standard)

For each boundary, test two values: the boundary itself, and the value just beyond it.

  • For a range 18–65: test 18 (in), 17 (out), 65 (in), 66 (out).

3-value BVA (robust)

Test three values at each boundary: the value just below, the boundary itself, and the value just above.

  • At lower boundary (18): test 17, 18, 19
  • At upper boundary (65): test 64, 65, 66

3-value BVA gives stronger coverage but doubles your test count. Use it when the boundary logic is critical or complex.

Real-world NZ Example: KiwiSaver Eligibility

In New Zealand, to join KiwiSaver independently (without legal guardian consent), you must be 18. You can begin withdrawing your savings at 65. Using 2-value BVA, your test cases are:

  • 17: Invalid (just below independent age)
  • 18: Valid (minimum independent age)
  • 64: Valid (just below withdrawal age)
  • 65: Valid (minimum withdrawal age)
  • 66: Valid (above withdrawal age — still eligible to contribute, but state contribution stops)

Worked example

Password length field: minimum 8 characters, maximum 20 characters.

Password length — 2-value BVA test cases
ValueLengthBoundary?Expected
"passwor"7Just below minRejected
"password"8Minimum boundaryAccepted
"12345678901234567890"20Maximum boundaryAccepted
"123456789012345678901"21Just above maxRejected

Combined with EP: BVA gives you boundary tests; EP gives you mid-range tests. Together they cover: one value per valid partition (EP), the boundaries of each partition (BVA), and one representative invalid value per invalid partition (EP). This is standard practice at junior level and above.

ISTQB mapping

ISTQB CTFL v4.0 reference
Syllabus refTopicLevel
4.2.2Boundary Value AnalysisCTFL Foundation
FL-4.2.2 K3Apply 2-value BVA to derive test casesFoundation LO
FL-4.2.2 K3Apply 3-value BVA to derive test casesFoundation LO

Common mistakes

  • Forgetting the "just outside" value — testing only the boundary itself misses off-by-one errors.
  • Mixing BVA and EP carelessly — BVA tests the boundary; EP tests the middle. Don't conflate them.
  • Non-numeric boundaries — BVA applies to anything ordered: dates, string lengths, list sizes, file sizes, priority levels.
  • Inclusive vs exclusive confusion — always check whether the spec says "<" or "≤" before choosing your boundary values.

Always pair with Equivalence Partitioning — EP defines the partitions, BVA tests their edges.

When multiple input boundaries interact, consider Decision Table Testing or pairwise combinatorial testing.

NZ example — KiwiSaver contribution rates

KiwiSaver employee contribution rates have defined thresholds: 3%, 4%, 6%, 8%, 10%. A contribution rate field that accepts values from 3 to 10 (as a percentage, integers only) has boundaries at 3 (minimum) and 10 (maximum).

KiwiSaver contribution rate — BVA test cases

  • 2-value BVA: test 2 (just below minimum — should reject), 3 (minimum — should accept), 10 (maximum — should accept), 11 (just above maximum — should reject).
  • 3-value BVA adds: 4 (just above minimum — accept) and 9 (just below maximum — accept).

The off-by-one error risk is real here: a developer coding > 3 instead of >= 3 would reject the minimum valid contribution rate, leaving employees unable to set 3%.

Try it yourself

KiwiSaver contribution rate — 2-value BVA

A KiwiSaver contribution rate field accepts whole numbers from 3 to 10 (inclusive). Using 2-value BVA, fill in all 4 boundary test values and select the expected result for each.

# Test value Expected result
1
2
3
4

Full answer — 2-value BVA for contribution rates 3–10:
#Test valueBoundary typeExpected result
12Just below lower boundaryReject
23Lower boundary (minimum)Accept
310Upper boundary (maximum)Accept
411Just above upper boundaryReject

Bonus (3-value BVA): Add 4 (just above lower boundary — Accept) and 9 (just below upper boundary — Accept).