Session 3.1 - Boundary Value Analysis
Module 3: Dynamic & Static Testing | Duration: 1 hour
Learning Objectives
- Apply boundary value analysis to reveal failures at input and output limits.
- Design normal and robust boundary test sets from requirements.
- Trace each boundary test to an expected result and defect risk.
What Is Boundary Value Analysis?
Boundary Value Analysis (BVA) focuses tests around the edges of allowed ranges where defects are most likely: minimum, just above minimum, nominal, just below maximum, and maximum.
Off-by-one logic, comparison mistakes (
< vs <=), truncation, and rounding behavior frequently break at limits.Numeric ranges, date limits, text length constraints, file size limits, and threshold-based business rules.
High defect discovery with a small, systematic set of tests instead of random values.
If input range is [10..50], boundary-focused values are:
9, 10, 11, 30, 49, 50, 51
Black-Box Testing Context
Before diving into BVA, it is important to understand where it fits. Black-box testing is a major dynamic testing technique that considers only the functional requirements of the software or module. The internal structure or logic of the software is not examined — the system is treated as a "black box".
The objectives of black-box testing include:
- Testing modules independently for functional correctness.
- Testing the functional validity of the software against requirements.
- Looking for interface errors between components.
- Testing system behavior and checking performance under load or stress.
- Testing the software such that the user/customer accepts the system within defined acceptable limits.
- Boundary Value Analysis (BVA) — this session
- Equivalence Class Testing — Session 3.2
- State Table Based Testing — Session 3.2
- Decision Table Based Testing — Session 3.3
- Cause-Effect Graphing — Session 3.4
- Error Guessing — Session 3.4
Boundary Value Checking (BVC)
BVA is a technique that uncovers bugs at the boundary of input values. Here, boundary means the maximum or minimum value taken by the input domain.
For example, if variable A is an integer between 10 and 255:
- Boundary checking on the lower end:
9, 10, 11 - Boundary checking on the upper end:
254, 255, 256
The standard boundary value checking approach for a single variable with range [min, max] uses these five test points:
| Test Point | Value | Purpose |
|---|---|---|
| Minimum | min | Lowest valid value |
| Just above minimum | min + 1 | Confirms acceptance just inside lower bound |
| Nominal | A middle value | Confirms normal processing works |
| Just below maximum | max - 1 | Confirms acceptance just inside upper bound |
| Maximum | max | Highest valid value |
n input variables in a module, basic BVC generates 4n + 1 test cases. The "+1" accounts for the single test where all variables are at their nominal values simultaneously.
Robustness Testing
The basic BVC idea can be extended by considering values that exceed the boundaries:
- A value just greater than the maximum value (
max + 1) - A value just less than the minimum value (
min - 1)
When test cases are designed considering these additional points beyond the valid range, it is called robustness testing.
| Test Point | Value | Expected |
|---|---|---|
| Below minimum | min - 1 | Reject / Error |
| Minimum | min | Accept |
| Just above minimum | min + 1 | Accept |
| Nominal | A middle value | Accept |
| Just below maximum | max - 1 | Accept |
| Maximum | max | Accept |
| Above maximum | max + 1 | Reject / Error |
n input variables in a module, robustness testing generates 6n + 1 test cases. Each variable contributes 6 boundary points (min-1, min, min+1, max-1, max, max+1) plus 1 all-nominal case.
min-1 or max+1. Robustness tests specifically target this.
Worst-Case & Robust Worst-Case Testing
Standard BVA varies one input at a time while keeping the others at nominal values. Worst-case testing takes a different approach: it considers what happens when multiple variables are simultaneously at their boundary values.
{min, min+1, nominal, max-1, max}, and the test set is the Cartesian product of all variables' boundary sets.
This is more thorough because defects sometimes only appear when multiple inputs are at extreme values simultaneously. For example, a calculation might work fine when one input is at its maximum, but overflow when two inputs are both at their maximum.
n input variables, worst-case testing generates 5n test cases (5 values per variable, all combinations).
The worst case can be further extended if we add robustness. That is, if we consider the extreme values of the variables as in the robust testing method (7 values per variable: min-1, min, min+1, nominal, max-1, max, max+1), we get robust worst-case testing.
n input variables, robust worst-case testing generates 7n test cases.
| Approach | Test Cases (n vars) | Best For |
|---|---|---|
| Normal BVC | 4n + 1 | Quick, low-risk modules |
| Robustness | 6n + 1 | Modules handling user input directly |
| Worst-case | 5n | Critical modules where variable interactions matter |
| Robust worst-case | 7n | Safety-critical or financial systems |
Test Case Count Formulas
Understanding the formulas helps you estimate testing effort before you begin. Here is a quick-reference comparison.
| Method | Formula | n = 3 |
|---|---|---|
| Normal BVC | 4n + 1 | 4(3) + 1 = 13 |
| Robustness | 6n + 1 | 6(3) + 1 = 19 |
| Worst-case | 5n | 53 = 125 |
| Robust worst-case | 7n | 73 = 343 |
Input Boundary Design
Start from each input domain and derive values around every range endpoint.
min, min+1, nominal, max-1, max
min-1, min, min+1, nominal, max-1, max, max+1
- Normal BVA: uses only valid range values.
- Robust BVA: adds just-outside invalid values to confirm rejection.
- Multiple inputs: vary one input at boundaries while keeping others nominal, then rotate.
- Extract exact range and inclusivity from the requirement text.
- Mark
min,max, and one nominal value. - Create normal BVA tests first, then add robust invalid edges.
- Define expected outcome for each value before execution.
- Record observed behavior and map failures to root cause.
Output Boundary Checks
BVA also validates output limits, especially where formula outputs are capped, rounded, or bucketed.
Validate transitions like Grade C to B at exact cutoff marks.
Test around max output caps (e.g., discount capped at 500).
Check behavior at 2-decimal boundaries, rounding up/down, and format limits.
Final Discount = min(0.2 * amount, 500)
Boundary amounts near cap trigger: 2499, 2500, 2501. Verify displayed output stays at 499.8, 500, 500.
Illustrations & Examples
Use these examples to show students how BVA adapts across different data types.
| Boundary Value | Expected | Reason |
|---|---|---|
| 17 | Reject | Below minimum |
| 18 | Accept | Minimum valid |
| 19 | Accept | Minimum + 1 |
| 59 | Accept | Maximum - 1 |
| 60 | Accept | Maximum valid |
| 61 | Reject | Above maximum |
Choose test strings by length, not meaning:
- 7 chars: invalid (
abc123!). - 8 chars: valid lower edge (
abc123!@). - 16 chars: valid upper edge.
- 17 chars: invalid upper overflow.
If grades are A: >=90, B: 80-89, C: 70-79, then critical tests are around 69/70, 79/80, and 89/90.
This shows students that boundaries are not only at global min/max, but also at internal decision thresholds.
Worked Example: Scholarship Eligibility Form
Requirement: Eligible if attendance is between 75 and 100 (inclusive) and CGPA is between 6.0 and 10.0 (inclusive).
| Test ID | Attendance | Expected | Purpose |
|---|---|---|---|
| BVA-01 | 74 | Reject | min-1 invalid |
| BVA-02 | 75 | Accept | min valid |
| BVA-03 | 76 | Accept | min+1 valid |
| BVA-04 | 99 | Accept | max-1 valid |
| BVA-05 | 100 | Accept | max valid |
| BVA-06 | 101 | Reject | max+1 invalid |
| Test ID | Attendance | CGPA | Expected |
|---|---|---|---|
| BVA-07 | 75 | 5.9 | Reject (CGPA below min) |
| BVA-08 | 75 | 6.0 | Accept (both at boundary) |
| BVA-09 | 100 | 10.0 | Accept (both at max boundary) |
| BVA-10 | 101 | 10.0 | Reject (attendance above max) |
- Incorrect exclusive checks such as
attendance > 75instead of>= 75. - Upper range leaks where values over 100 are accepted.
- Wrong validation order causing crash/format errors at extremes.
Common Mistakes
Students often skip
min-1 and max+1, missing rejection logic defects.Words like "between", "up to", "at least" must map to precise operators.
Without expected behavior per test, pass/fail judgement is ambiguous.
Nominal tests are useful, but boundaries should drive the first test set.
Class Activity
- Select one form field with a clear numeric/text limit (age, password length, marks, upload size).
- Write normal and robust boundary value sets.
- Execute each test and capture Pass/Fail with screenshot or log evidence.
- Map each failing case to likely root cause (comparison operator, parsing, rounding, cap rule).
Evaluation rubric (10 marks)
- 2 marks: Clear extraction of range and inclusivity.
- 3 marks: Correct normal + robust test design.
- 3 marks: Accurate expected results and execution evidence.
- 2 marks: Root-cause reasoning for observed failures.
Exit Ticket
Use these 3 quick checks at the end of class to confirm learning.
- Requirement: allowed quantity is 1 to 25 inclusive. Write robust boundary values.
- If code uses
if (score > 40)for pass rule "40 and above", which boundary fails? - Name one difference between input boundary testing and output boundary testing.
Summary & Assignment
BVA is a focused, low-cost way to uncover limit-related defects in both inputs and outputs. Well-chosen edge tests significantly improve confidence in validation logic.