Bugs love edges. Learn why mistakes cluster at the limits of a rule, how to pick 2-value and 3-value boundary tests, and how to find off-by-one bugs in ages, passwords, dates, money, lists and prices.
beginner Mobile & web
Short on time? Switch to the quick version.
Your progress
An online shop launches a summer promotion: “Free shipping on orders of €50 or more!” It’s tested, it ships, and the first weekend goes well. Then the support inbox fills up. Dozens of customers carefully filled their carts to exactly €50.00, and every single one was charged €4.99 for shipping.
The tester had checked a €35 cart (pays shipping) and an €80 cart (free shipping). Both passed. The bug lived in the one place nobody looked: the exact edge, €50.00. The developer had written “more than 50” instead of “50 or more”.
In Equivalence Partitioning you learned to split values into groups that behave the same, like ages 17-and-under, 18–60 and 61-and-over in a fitness app’s sign-up form. A boundary is the edge of one of those groups: the smallest or largest value in a partition.
In the table below, > means “greater than” and >= means “greater than or equal to”; < and <= work the same way for “less than”.
Requirement
Bug in the code
Only caught by
Age 18 or older
age > 18 (should be >=)
18
Free shipping from €50
total > 50 (should be >=)
€50.00
Password max 64 chars
len <= 63 (should be 64)
64 chars
Up to 10 items
qty < 10 (should be <=)
10 items
In every row, a value from the middle of the partition (35, €80, 20 characters, 5 items) passes perfectly. Only a value at the edge reveals the problem. That’s the whole case for BVA: test exactly where the behavior changes.
Check this part
What is an off-by-one error?
Writing age > 18 instead of age >= 18 works for almost every value. Only 18 itself reveals the mistake.
Free shipping applies from €50. The code says total > 50. Which cart reveals the bug?
€35 and €80 behave correctly even with the bug. Only a cart of exactly €50.00, the edge, is wrongly charged for shipping.
Developers easily mix up > and >= or a limit by one, so bugs hide exactly at the edge of a rule.
Part Not started
2-value and 3-value BVA
For the age rule 18–60 we treat the edges of the valid range as the boundaries: 18 (the smallest valid age) and 60 (the largest). 17 and 61 are their outside neighbors.
2-value BVA tests each boundary plus its closest neighbor on the other side:
2-value BVA · age 18–60
≤ 17
Invalid
18 – 60
Valid
≥ 61
Invalid
1718
6061
Four tests: 17, 18, 60, 61.
3-value BVA tests each boundary plus its closest neighbors on both sides:
3-value BVA · age 18–60
≤ 17
Invalid
18 – 60
Valid
≥ 61
Invalid
171819
596061
Six tests: 17, 18, 19 and 59, 60, 61. The extra inner values catch a few sneakier bugs.
Most everyday testing uses 2-value BVA. Teams switch to 3-value for risky rules: money, security, legal age limits.
Finding the boundaries step by step
Start with your partitions. BVA builds on EP. For the age field: 17 or less, 18–60, 61 or more.
Find the step size. What is the smallest possible change? 1 for whole years, 1 for characters, €0.01 for euros, 1 day for dates.
Find each boundary. The smallest and largest value of the valid range: 18 and 60. (17 and 61 are edges too, of the invalid partitions; in this lesson we treat them as the outside neighbors.)
Add the neighbors. One step outside each boundary (17, 61). For 3-value BVA, also one step inside (19, 59).
Write the expected result for each value. 17 is rejected, 18 is accepted, and so on. A boundary test without an exact expected result is just a guess.
2-value BVA
For each boundary, test the boundary value itself and the closest value on the other side of the boundary (in the neighboring partition).
2-value BVA · age 18–60
≤ 17
Invalid
18 – 60
Valid
≥ 61
Invalid
1718
6061
Value
Why
Expected
17
Last invalid value below the range
Rejected
18
Lower boundary, first valid value
Accepted
60
Upper boundary, last valid value
Accepted
61
First invalid value above the range
Rejected
This catches the classic mistakes: > instead of >= at the lower edge (18 is wrongly rejected), age <= 61 instead of age <= 60 (61 is wrongly accepted), or age < 60 instead of age <= 60 (60 is wrongly rejected).
3-value BVA
For each boundary, test the boundary value and the closest value on both sides.
3-value BVA · age 18–60
≤ 17
Invalid
18 – 60
Valid
≥ 61
Invalid
171819
596061
The extra values (19 and 59) look redundant, but they catch bugs that 2-value BVA misses. To see it clearly, switch to a simpler rule for this one example: “18 or older”, with no upper limit. It has a single boundary, 18, so 2-value BVA tests just 17 and 18. Imagine a developer wrote age == 18 (exactly 18) instead of age >= 18:
Value
Correct result
Buggy age == 18
Caught?
17
Rejected
Rejected
No
18
Accepted
Accepted
No
19
Accepted
Rejected
Yes
2-value BVA (17 and 18) passes and the bug ships. Only 19, the inside neighbor, exposes it. (Back in the 18–60 rule, the test at 60 would happen to catch this particular mistake; the inside neighbors mean you don’t have to rely on that luck.)
Method
Values for 18–60
Tests
Best for
2-value
17, 18, 60, 61
4
Everyday features
3-value
17, 18, 19, 59, 60, 61
6
Money, security, legal limits
Check this part
Age must be 18 to 60. What is the 2-value BVA set?
2-value BVA tests each boundary plus its closest neighbor on the other side: 17 and 18 at the lower edge, 60 and 61 at the upper edge.
Which extra values does 3-value BVA add for the same 18–60 rule?
3-value BVA adds the neighbors inside the range: 19 next to 18, and 59 next to 60. Teams use it for risky rules like money, security and legal limits.
2-value BVA tests each boundary and its neighbor outside; 3-value BVA adds the neighbor inside.
Part ProNot started
Boundaries are everywhere
Lengths: password 8–64 characters → 7, 8, 64, 65.
Dates: first and last day of a month, 29 February, 31 December, yesterday / today / tomorrow.
Money: €0.00, €0.01, and the maximum (a €1,000 transfer limit → €1,000.00 and €1,000.01).
Lists: 0 items, 1 item, the maximum, one more than the maximum.
Outputs: free shipping at €50.00, so test €49.99 and €50.00.
Lengths
A banking app requires passwords of 8 to 64 characters. The step is one character.
Password length (8–64 characters)
0 – 7
Too short
8 – 64
Accepted
≥ 65
Too long
789
636465
2-value: 7, 8, 64, 65. 3-value adds 9 and 63. Don't forget 0 (empty), which EP covers.
Practical tips:
Count precisely. Prepare test strings of exact lengths in a notes file (for example Abcdef1! is 8 characters). A character counter tool helps for 64.
Password managers generate long passwords. A real-world max-length bug (a limit of 63 instead of 64) hits exactly those careful users. More in Login and Sign-up.
Dates
Dates have more boundaries than any other data type. The step is usually one day (sometimes one minute).
The step for euros, dollars and pounds is one cent (0.01). Some currencies, like the Japanese yen, have no cents in everyday use, so the step is 1.
A banking app allows transfers from €0.01 to €1,000.00 per day:
Transfer amount (€0.01–€1,000.00)
≤ €0.00
Rejected
€0.01 – 1,000
Sent
≥ €1,000.01
Over limit
0.000.01
1,000.001,000.01
Test €0.00, €0.01, €1,000.00 and €1,000.01. The upper pair is exactly the bug from the banking example in What Is Software Testing?
Also try amounts with more decimals than allowed (€10.999), very large numbers (€99,999,999), and think about rounding: does €0.005 become €0.01 or €0.00?
Lists and counts
Anything you can count has boundaries: items in a cart, photos in a review, results on a page, seats on a flight.
Just like EP, BVA works on outputs. Find the input values that put you right at the edge of a different result.
Shipping cost (output boundaries)
under €20
€4.99
€20 – 49.99
€2.99
≥ €50
Free
19.9920.00
49.9950.00
Build carts worth exactly €19.99, €20.00, €49.99 and €50.00. Also check the message: 'Add €0.01 more for free shipping' should appear at €49.99.
Remember that outputs depend on the final number: a €55 cart with a €5 coupon is exactly €50.00. Does it still get free shipping? See Shopping Cart and Checkout.
A review lets you attach up to 5 photos. Which counts should you test with BVA?
0 (none attached), 1 (the smallest non-empty list), 5 (the maximum) and 6 (one more than allowed) are the edges where count bugs appear.
Free shipping applies to orders of €50.00 or more. Which pair of tests is most likely to find a > vs >= bug?
The step for euros is €0.01. €49.99 and €50.00 sit on either side of the boundary: only €50.00 itself gives the wrong result with this bug, and €49.99 confirms the other side still pays.
Boundaries hide in lengths, dates, money, counts and outputs.
The rest of this lesson is in Bugwise Pro
The last parts of every lesson are part of Bugwise Pro. Sign in to unlock them if you have it.
EP picks one value from the middle of each partition (35); BVA tests the edges (17, 18, 60, 61). EP also covers partitions that have no edges at all, like an empty field or “abc”. Use both, every time.
Equivalence partitioning
Boundary value analysis
Picks
One value from inside each partition
Values at and next to each edge
Age 18–60
12, 35, 72
17, 18, 60, 61
Catches
Whole partitions handled wrongly
Off-by-one and wrong comparisons
Also covers
Empty, “abc”, 25.5 (no edges)
Only ordered values
Together, a strong test set for the age field is: 35 (valid, EP), 17, 18, 60, 61 (BVA), plus empty, abc, 25.5 (EP partitions without edges). That’s 8 tests. You could drop 12 and 72, since 17 and 61 already represent those partitions.
Writing test cases from BVA
One boundary value per test when it’s invalid, and keep every other field valid, so you know which value caused the error (the same rule as in EP).
Put the exact value in the title or data. “Sign-up accepts age 18 (lower boundary)” is far clearer than “Test age boundary”.
Write an exact expected result. Not “works”, but “Account is created and the Goals screen opens”.
Valid boundaries can be combined when the fields are independent: 1 night, 1 guest and check-in today in one booking. If it fails, split it up.
Link back to the requirement, so anyone can see why 64 and 65 matter.
You’ll find complete examples below, and more on the format in How to Write Test Cases. When a boundary test fails, report the exact value and what you expected; the bug report almost writes itself (see How to Write Bug Reports).
Check this part
For the age rule 18–60, which values come from BVA rather than EP?
BVA tests at and next to each edge. EP picks a value from the middle (35) and covers partitions with no edges at all.
Which test does BVA not give you, so EP has to cover it?
An empty field or "abc" has no position on the number line, so there's no edge to test. EP covers those partitions.
EP covers the middle of each partition and the partitions without edges; BVA covers the edges.
The rest of this lesson is in Bugwise Pro
The last parts of every lesson are part of Bugwise Pro. Sign in to unlock them if you have it.
See also: Error Guessing and Checklists, which picks up where the boundaries stop: zero, negatives, other number formats and time zones.
Practice: pick the boundary values
Choose a rule and a mode, then tap the values you would test. After checking, the underline shows which values are valid (green) and invalid (red).
🎯 Boundary game: pick the edge values
Tap the values you would test. Then check your picks.
Fitness app · sign-up
Age must be from 18 to 60 (inclusive).
2-value BVA: for each boundary, test the boundary value and its closest neighbor on the other side. Values move in steps of 1.
Around 18
Around 60
Find the off-by-one bugs
Three of these six rules were implemented with an off-by-one bug; the other three are correct. You can’t see the code, only the results. Test each rule with boundary values, decide whether it’s buggy, then check your verdicts.
🐞 Buggy implementation mode
Some of these six rules have an off-by-one bug. Use boundary values to find out which, then give your verdict.
Sign-up age
Ages 18 to 60 can sign up.
Cart quantity
You can buy 1 to 10 of one item.
Free shipping
Shipping is free from €50.00.
Password length
Passwords must be 8 to 64 characters.
Hotel stay
A booking is 1 to 30 nights.
Promo code length
Codes are 6 to 10 characters.
0/6 verdicts given
Exercise: a hotel booking form
Time to combine both techniques. Derive EP partitions and BVA values for this small travel app spec, type them in, and compare with the model answer.
✍️ Exercise: hotel booking form
Write the EP and BVA values you would test for each field, then compare with the model answer.
Spec · Travel app · "Book a room"
Nights: 1 to 30 whole nights.
Guests: 1 to 4 guests per room.
Check-in date: not in the past; at most 365 days ahead.
All three fields are required.
Separate values with commas. Type empty for a blank field and any word (like abc) for non-numeric input.
Example test cases
TC-BVA-01Sign-up accepts age 18 (lower boundary)edgehigh
'Password must be at most 64 characters' is shown and nothing is saved. If the field cuts pasted text to 64 characters instead, the user is clearly told; a silently shortened password is a bug.
Tip: click a test case to expand it.
Boundary value analysis checklist
0 of 10 checked
Key takeaways
Bugs cluster at edges because developers easily mix up > and >=, or type a limit one too high or too low (an off-by-one error).
A boundary is the smallest or largest value of an ordered partition. Find the step size first (1, €0.01, one day).
2-value BVA: the boundary and its neighbor outside (17, 18 / 60, 61). 3-value BVA adds the neighbor inside (17, 18, 19 / 59, 60, 61).
Boundaries hide in lengths, dates, money, counts and outputs, and in technical limits nobody wrote down.
BVA complementsEquivalence Partitioning: EP covers the middle and edge-less partitions; BVA covers the edges.
Write each boundary test with the exact value and an exact expected result.
Finished this page?Nice work, this page is complete!
Mark it as done to track your progress. It's saved in this browser, no account needed.