Course contentsShow
← Computer Science
Lesson 2222 of 2,87250. Software TestingFree lesson

Boundary Value Analysis

Testing at the edges of input ranges where defects are most likely to occur.

Boundary Value Analysis

What You'll Learn

You'll discover how to systematically test at the edges of valid input ranges, where bugs most commonly hide.

The Core Concept

Boundary Value Analysis (BVA) is a black-box testing technique that focuses on values at the boundaries between valid and invalid input partitions. While Equivalence Partitioning divides inputs into classes, BVA recognizes that defects cluster around the "edges" of those classes.

Think of a fence separating two properties. Most issues don't occur in the middle of either yard—they happen at the fence line where boundaries meet. Similarly, software bugs often lurk at the transition points between valid and invalid data.

Why Boundaries Matter

Programmers frequently make off-by-one errors, use < instead of <=, or mishandle edge cases. For example, if a function accepts ages 0–120:

  • Minimum boundary: Test -1 (invalid), 0 (valid), 1 (valid)
  • Maximum boundary: Test 119 (valid), 120 (valid), 121 (invalid)

You test just below, at, and just above each boundary. This catches fencepost errors that equivalence partitioning alone might miss.

Relationship to Equivalence Partitioning

BVA complements the partitioning you learned previously. After identifying equivalence classes, you select boundary values from those partitions rather than arbitrary mid-range values. This gives you more focused, efficient test coverage.

When to Apply BVA

Use boundary value analysis whenever inputs have:

  • Numeric ranges (ages, prices, dates)
  • String length constraints
  • Array size limits
  • Time windows

Key Takeaway: Boundary Value Analysis targets the "fence lines" between valid and invalid inputs, testing minimum and maximum boundaries to catch the off-by-one errors and edge-case bugs that developers commonly introduce.