← Back to libraryQuestion 310 of 468
📝Manual / FunctionalIntermediate

Boundary Value Analysis (BVA)

📌 Definition:

Boundary Value Analysis is a black-box technique that tests the values at the EDGES of input ranges — because defects cluster at boundaries. For a range, you test the minimum, just below/above it, the maximum, and just below/above it.

📖 Detailed Explanation:

Off-by-one errors and wrong comparison operators (< vs <=) most often occur at boundaries, so BVA targets them. For a valid range 1–100, test: 0 (below min), 1 (min), 2 (just above min), 99 (just below max), 100 (max), 101 (above max). The 'two-value' BVA uses boundary and boundary±1; the 'three-value' adds the value just inside. BVA is almost always used WITH Equivalence Partitioning — partitions find the classes, boundaries test their edges. It's one of the most-asked test-design techniques.

🔑 Key Points:
  • Test edges of ranges: min-1, min, min+1, max-1, max, max+1
  • Boundaries catch off-by-one and </<= operator bugs
  • Complements Equivalence Partitioning (classes + their edges)
  • Two-value vs three-value BVA variants
🌍 Real-World Example:

A password length rule of 8–16 characters is boundary-tested with 7 (invalid), 8 (valid min), 9, 15, 16 (valid max), and 17 (invalid) — catching an off-by-one where the code allowed 7 or rejected 16.

🎯 Scenario-Based Interview Question:

A quantity field accepts 1 to 10. Which specific values does Boundary Value Analysis say to test, and why?