🔹 What is Boundary Value Testing?
Boundary Value Testing (BVT) is a Black Box Testing technique that focuses on testing the boundary limits of input values rather than random or typical values. It is based on the principle that errors often occur at the extreme ends of input ranges.
📌 Example: If a system accepts numbers from 1 to 100, boundary value testing checks:
- Minimum Value (1)
- Maximum Value (100)
- Just Outside Lower Limit (0)
- Just Inside Lower Limit (2)
- Just Outside Upper Limit (101)
- Just Inside Upper Limit (99)
🔹 Why Use Boundary Value Testing?
✅ Identifies Edge-Case Defects – Most bugs occur at minimum and maximum values.
✅ Reduces Test Cases – Testing boundaries is more efficient than testing all possible values.
✅ Applicable to Numeric, Text, and Date Inputs – Can be used for any range-based input field.
✅ Improves Test Coverage – Covers corner cases that normal testing may miss.
🔹 Boundary Value Testing Example
📌 Example 1: Age Input Field (Valid Range: 18 to 60)
Test Case | Input Value | Expected Outcome |
---|---|---|
Just Outside Lower Limit | 17 | ❌ Error (Invalid) |
Minimum Valid Value | 18 | ✅ Accepted |
Just Inside Lower Limit | 19 | ✅ Accepted |
Just Inside Upper Limit | 59 | ✅ Accepted |
Maximum Valid Value | 60 | ✅ Accepted |
Just Outside Upper Limit | 61 | ❌ Error (Invalid) |
📌 Example 2: ATM Withdrawal Limit (Valid Range: $100 to $5000)
Test Case | Withdrawal Amount | Expected Outcome |
---|---|---|
Below Lower Limit | $99 | ❌ Error (Below Minimum) |
Minimum Valid Amount | $100 | ✅ Approved |
Just Above Minimum | $101 | ✅ Approved |
Just Below Maximum | $4999 | ✅ Approved |
Maximum Valid Amount | $5000 | ✅ Approved |
Above Upper Limit | $5001 | ❌ Error (Exceeds Limit) |
🔹 Types of Boundary Value Testing
1️⃣ Single Boundary Value Analysis
- Tests only one variable at a time.
📌 Example: If a temperature range is 0°C to 100°C, only the min (0°C) and max (100°C) are tested.
2️⃣ Multiple Boundary Value Analysis
- Tests multiple variables simultaneously.
📌 Example: A bank login requires:- Username (5 to 15 characters)
- Password (8 to 20 characters)
- PIN (4 to 6 digits)
Variable | Lower Boundary | Upper Boundary |
---|---|---|
Username | 4 (Invalid), 5 (Valid) | 15 (Valid), 16 (Invalid) |
Password | 7 (Invalid), 8 (Valid) | 20 (Valid), 21 (Invalid) |
PIN | 3 (Invalid), 4 (Valid) | 6 (Valid), 7 (Invalid) |
3️⃣ Robust Boundary Value Analysis
- Includes invalid values beyond the defined range.
📌 Example: For a loan application that accepts $1000 to $50000, test cases would include:- Valid Values: $1000, $50000
- Invalid Values: $999 (Below Minimum), $50001 (Above Maximum)
4️⃣ Worst-Case Boundary Value Analysis
- Combines Boundary Value Testing with Equivalence Partitioning to test all edge cases simultaneously.
📌 Example:
A form accepts a score from 1 to 10. Worst-case testing includes:- Lower Limit: 0 (Invalid), 1 (Valid)
- Just Above Lower: 2 (Valid)
- Just Below Upper: 9 (Valid)
- Upper Limit: 10 (Valid), 11 (Invalid)
🔹 Differences Between Boundary Value Testing & Equivalence Partitioning
Feature | Boundary Value Testing | Equivalence Partitioning |
---|---|---|
Focus | Tests boundary values (min/max limits) | Tests mid-range values within partitions |
Test Cases | Fewer but more targeted test cases | Fewer cases covering broad data ranges |
Best For | Finding edge-case defects | Reducing test case count for efficiency |
Example | If valid age is 18-60, tests 17, 18, 19, 59, 60, 61 | If valid age is 18-60, tests one value per group (e.g., 20, 40, 55) |
🔹 Advantages & Disadvantages of Boundary Value Testing
Advantages | Disadvantages |
---|---|
✅ Reduces test cases while maintaining effectiveness | ❌ Does not test values in the middle of valid ranges |
✅ Focuses on critical areas where bugs are likely | ❌ Not suitable for non-numeric or unordered data |
✅ Detects edge case errors | ❌ Requires additional tests for complex logic |
🔹 When to Use Boundary Value Testing?
✔ When an input field has a fixed numeric range (e.g., age, weight, salary).
✔ When working with form validations (e.g., character limits, passwords).
✔ For financial applications (e.g., ATM withdrawal limits, tax brackets).
✔ When dealing with hardware constraints (e.g., sensor readings, memory allocation).
Conclusion
✅ Boundary Value Testing helps find errors at input limits (min/max).
✅ It is efficient because most defects occur at extreme values.
✅ Works well for numeric inputs, form fields, and transaction limits.
✅ Combining it with Equivalence Partitioning provides maximum test coverage.