Skip to main content

BorderlineData

BLOG

Beginner's Guide to Boundary Value Analysis

If you’ve been in software development for more than five minutes, you’ve probably heard someone say, “Check the boundaries.” It sounds like advice from a life coach trying to help you deal with a toxic coworker, but in QA, it’s the difference between a smooth release and a 3 a.m. production page.

Let’s demystify Boundary Value Analysis (BVA) without the dry textbook definitions that make you want to faceplant into your keyboard.

The Core Problem: Developers are Human (Usually)

When developers write code, they use conditional logic. You know the drill:

  • if (age >= 18)
  • if (cartTotal < 500)

Human brains are hardwired to handle the “happy middle” of these ranges perfectly. If a system allows a user to buy between 1 and 10 tickets, a developer will write code that works beautifully for 5 tickets.

But where do humans consistently trip over their own shoelaces? The transitions. They use a > instead of a >=, or they start an array index at 1 instead of 0. Because of this, bugs love to camp out at the exact borders of your input fields.

The "Three-Point" Strategy

To catch these bugs, we use BVA. Instead of testing every number from 1 to 10 (which is a waste of your precious life), we test the exact edges.

For any boundary, there are three critical spots to hit:

  1. The Boundary Itself (On): The exact limit (e.g., 1 and 10).
  2. Just Below the Boundary (Off/Below): The step right below (e.g., 0 and 9).
  3. Just Above the Boundary (Off/Above): The step right above (e.g., 2 and 11).
[0]  <-- Invalid (Below)
-------

[1]  <-- Valid Minimum (On)

[2]  <-- Valid (Above)

...

[9]  <-- Valid (Below)

[10]  <-- Valid Maximum (On)

-------

[11]  <-- Invalid (Above)
Advertisement

Why Bother?

Because testing 5 tells you nothing about whether the developer accidentally locked out people who are exactly 18 years old. By targeting the points where the logic flips from valid to invalid, you find 80% of the defects with 20% of the effort.

Pro Tip: Next time you see an input field with a limit, don’t type “hello.” Type exactly one character over the limit. Watch the system sweat.