Test Case Design Technique: Boundary Value Analysis (BVA)
Overview
Boundary Value Analysis (BVA) is a black-box testing technique that focuses on testing at the edges (boundaries) of input ranges where errors are most likely to occur. The idea is simple: bugs often occur at the limits of input values, not in the middle.
This technique complements Equivalence Partitioning (EP) by zeroing in on the critical “just-at-the-edge” conditions for maximum bug detection.
Why Use Boundary Value Analysis?
- Many defects occur at the boundaries of input ranges.
- Helps ensure limit conditions are handled properly.
- Reduces test cases while still increasing coverage.
- Especially useful for numeric fields, date ranges, loops, counters, arrays, etc.
How It Works
- Identify input ranges (e.g., min & max values).
- Determine boundaries for valid and invalid input.
- Create test cases for:
- Minimum value (valid)
- Minimum - 1 (invalid)
- Maximum value (valid)
- Maximum + 1 (invalid)
- Optionally, midpoint or typical valid value
Example 1: Age Field (Valid Range: 18–65)
Test Case Description | Input Value | Expected Result |
---|---|---|
Lower boundary (valid) | 18 | Accepted |
Just below lower boundary | 17 | Rejected |
Upper boundary (valid) | 65 | Accepted |
Just above upper boundary | 66 | Rejected |
Mid-range value (optional) | 30 | Accepted |
Example 2: Password Length (Valid: 8–16 characters)
Test Case Description | Input (Length) | Expected Result |
---|---|---|
Lower boundary valid | 8 | Accepted |
Lower boundary invalid | 7 | Rejected |
Upper boundary valid | 16 | Accepted |
Upper boundary invalid | 17 | Rejected |
Mid-value | 12 | Accepted |
Boundary Value Testing for Multiple Fields
If multiple fields have numeric or range-based constraints, test boundaries independently and together.
Example: For a login form with username (3–10 chars) and password (8–16 chars), test:
- Username = 3 (valid), Password = 8 (valid)
- Username = 2 (invalid), Password = 8 (valid)
- Username = 3 (valid), Password = 7 (invalid)
- ... etc.
Variants of BVA
1. Single Boundary Testing
Test only one input at a time while keeping others valid.
2. Multiple Boundary Testing
All input fields are tested with their boundary values simultaneously.
When to Use BVA
- Input ranges (e.g., min/max limits)
- Form validations (e.g., age, salary, percentages)
- Date validations (e.g., start date/end date)
- Loops, pagination, counters, numeric APIs
Best Practices
- Always pair BVA with Equivalence Partitioning for full test coverage.
- Watch out for off-by-one errors—common bugs around boundaries.
- Don't forget negative test cases (outside the boundary).
- Use BVA for both input fields and output values when applicable.
Summary
Boundary Value Analysis is a powerful technique to catch errors that commonly occur at the extremes of input domains. It's a must-use method in a senior QA's toolkit for designing efficient, high-impact test cases.
"If you want to find bugs fast, push the system to its limits—right at the boundaries."
Quick BVA Template
For any field with range [min, max]
:
Case | Value | Description |
---|---|---|
Lower Invalid | min - 1 | Just below range |
Lower Boundary | min | Lowest valid |
Upper Boundary | max | Highest valid |
Upper Invalid | max + 1 | Just above range |
Midpoint (optional) | (min+max)/2 | A typical valid input |