Boundary Value Analysis
Developers often get edges wrong — < instead of <=. Boundary value analysis targets exactly those mistakes.
On this page · 5 min · Beginner
On this page
- Learning objectives
- Explanation
- Code example
- Step by step
- Real-world use
- Common mistakes
- Best practices
- Remember this
- Practice exercise
- Mini quiz
- Related topics
- My notes
- Reading time
- 5 min
- Difficulty
- Beginner
- Updated
- Oct 29, 2026
Related tutorials
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#
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".
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#
- Read the min and max from the requirement.
- Test just below, on and just above each edge.
- Compare actual with expected.
- 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#
Values like 12 in a 8–20 range rarely find bugs.
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
4.99 MB (accept), 5.00 MB (accept), 5.01 MB (reject), 0 bytes (check behaviour)
Mini quiz#
Range 18–60. Which values does three-value BVA test at the lower edge?
Want more? Practise all Manual Testing MCQs · Manual Testing interview questions
My notes#
Saved in this browser.