Junior · Black Box Technique

Boundary Value Analysis (BVA)

Bugs love to hide at the edges. Learn how to test the exact limits where one behavior switches to another — catching the "off-by-one" errors that middle-of-the-road testing misses.

Junior ISTQB CTFL 4.2.2 — K3 Apply ~12 min read + exercise

1 The Hook — The $50 Free Shipping Trap

A Wellington clothing brand offered "Free Shipping on orders of $50 or more." A tester tried a $10 order (shipping charged) and a $100 order (free shipping). Both worked. They skipped the boundary.

On launch day, a customer ordered exactly $50.00 worth of socks. The system charged them $7.50 for shipping. The developer had coded if (total > 50) instead of if (total >= 50). That single missing equals sign cost the company $5,000 in refunds and a social media headache. BVA would have caught it with one single test case: $50.00.

2 The Rule — The Edge Effect

Test the boundary value itself, and the value immediately outside of it.

In the ISTQB Foundation Level, we use 2-value BVA. For every boundary, you pick two values:

  • The Boundary: The exact limit (e.g., 50).
  • The "Out" Value: The value just outside (e.g., 49.99).

3 The Analogy — The Fence Post Error

Analogy

The 10-Metre Fence.

If you want to build a 10-metre fence with a post every 1 metre, how many posts do you need? Most people say 10. The answer is 11. You forgot the post at 0. Boundaries are tricky because our brains naturally skip the start and end points. BVA forces you to count the posts, not just the gaps.

4 Watch Me Do It — NZ Postcodes

Scenario: You're testing an address form. The NZ Postcode field must be exactly 4 digits long. Anything else (3 digits or 5 digits) is rejected.

  • Identify the Lower Boundary: 4 digits is the minimum. (Test: 1010 — Valid)
  • Identify the "Below" Value: 3 digits. (Test: 601 — Invalid)
  • Identify the Upper Boundary: 4 digits is the maximum. (Test: 9012 — Valid)
  • Identify the "Above" Value: 5 digits. (Test: 12345 — Invalid)
NZ Postcode (4 Digits) — 2-Value BVA
ValueLengthPartitionExpected
"601"3Below min (Invalid)Rejected
"1010"4Lower boundary (Valid)Accepted
"9012"4Upper boundary (Valid)Accepted
"12345"5Above max (Invalid)Rejected

5 Decision Tool — 2-Value vs. 3-Value

Sometimes 2 values aren't enough. Here's how to choose:

✅ 2-Value BVA (Standard)

  • Test the Boundary and Outside.
  • Best for: Standard form fields.
  • Efficiency: Fast, low test count.

🛡 3-Value BVA (Robust)

  • Test Below, Boundary, and Above.
  • Best for: High-risk financial code.
  • Coverage: Catches "off-by-one" on both sides.

6 Common Mistakes

🚫 Testing far from the edge

I used to think: If 18 is the boundary, testing 10 is fine for the "Invalid" case.
Actually: BVA requires testing the nearest possible value. If you test 10, you might miss a bug where the code accepts 17. The only way to be sure is to test 17.

🚫 Ignoring non-numeric boundaries

I used to think: BVA is only for numbers.
Actually: BVA applies to dates (first/last of the month), strings (empty vs. 1 char), and lists (max file attachments). If it has a limit, it has a boundary.

7 Now You Try — KiwiSaver Contribution

🎯 Interactive Exercise

Scenario: A KiwiSaver form accepts whole number contribution rates from 3% to 10% inclusive.

Using 2-value BVA, identify the 4 test values:

Lower Boundary

3 (Valid)

Just Below Lower

2 (Invalid)

Upper Boundary

10 (Valid)

Just Above Upper

11 (Invalid)

8 Self-Check

Q1. A spec says "Under 18s are not allowed." What is the boundary value?

18. Since 18 is the point where the rule changes, it's your boundary. You would test 18 (Allowed) and 17 (Not Allowed).

Q2. Can BVA be used without Equivalence Partitioning?

No. You first need to use EP to find the "Valid" and "Invalid" buckets. Once you know where the buckets are, BVA tells you to test the edges of those buckets.

9 Interview Prep

"Where do most defects occur in a range-based field?"

Answer: "Most defects occur at the boundaries. Developers often make off-by-one errors by using the wrong comparison operator, such as 'greater than' instead of 'greater than or equal to'. BVA is specifically designed to target these high-risk areas."