Manual Testing · Test Design

Boundary Value Analysis

Developers often get edges wrong — < instead of <=. Boundary value analysis targets exactly those mistakes.

Beginner 5 min Lesson 9 of 24
Before you start:Equivalence Partitioning
0/24 in Manual Testing
On this page · 5 min · Beginner

Learning objectives#

  • Identify boundaries from requirements
  • Choose boundary test values
  • Apply BVA to lengths, dates and amounts
  • Combine with equivalence partitioning

Explanation#

For a range min–max, test min-1, min, min+1, max-1, max and max+1 (the three-value approach). A two-value approach uses min-1, min, max, max+1.

Boundaries exist for numbers, string lengths, dates, file sizes, counts and money.

Off-by-one errors (> instead of >=) are among the most common defects.

Code example: Password length 8–20#

TextPassword length 8–20 Illustrative
Value (length)   Expected
7                Rejected: "Use 8–20 characters"
8                Accepted   ← min
9                Accepted
19               Accepted
20               Accepted   ← max
21               Rejected


Bug found: length 20 rejected → code used "length < 20" instead of "length <= 20".
Expected output
Six boundary tests reveal an off-by-one bug that typical “normal” values would never hit.

This example is illustrative. Copy or download it and run it in your own environment; the expected output is shown above.

Step-by-step explanation#

  1. Read the min and max from the requirement.
  2. Test just below, on and just above each edge.
  3. Compare actual with expected.
  4. Report off-by-one defects with the exact value.

Real-world use case#

Loan amount limits, file upload sizes, OTP lengths and date ranges for bookings.

Common mistakes#

Testing only “middle” values

Values like 12 in a 8–20 range rarely find bugs.

Forgetting non-numeric boundaries

Lengths, dates (31 Jan / 1 Feb) and file sizes have edges too.

Best practices#

  • List every range in the requirements
  • Test both sides of each boundary
  • Include dates and lengths
  • Report the exact failing value

Remember this#

Bugs live at the edges.

min-1, min, min+1, max-1, max, max+1.

Off-by-one = < vs <=.

Practice exercise#

Your task: An upload accepts files up to 5 MB. Which sizes do you test?

Show solution
Text Illustrative
4.99 MB (accept), 5.00 MB (accept), 5.01 MB (reject), 0 bytes (check behaviour)

Mini quiz#

Boundary Value Analysis quizMultiple choice Question 1 of 1

Range 18–60. Which values does three-value BVA test at the lower edge?

Score so far: 0/0

Want more? Practise all Manual Testing MCQs · Manual Testing interview questions

My notes#

Saved in this browser.

Progress is saved in this browser. Sign in to sync.