Boundary Value Analysis: 30 Worked Examples

Written By  Crosscheck Team

Content Team

July 30, 2026 9 minutes

Boundary Value Analysis: 30 Worked Examples

Boundary value analysis: 30 worked examples

A signup form says "you must be 18 or older". A tester types 25, sees the form pass, and moves on. Two weeks later a 17-year-old creates an account, because the code says age > 17 in one place and age >= 18 in another, and only one of them runs.

Nobody typed 17. Nobody typed 18. That is the whole bug.

Boundary value analysis is the habit of always typing those two numbers.

Short version

  • A boundary is the point where behaviour changes from allowed to blocked.
  • Bugs cluster at boundaries because programmers mix up < and <=.
  • For each boundary, test three values: one below, the boundary itself, one above.
  • Boundaries hide in dates, page counts, file sizes, and character limits, not just numbers.
  • The 30 examples below give you exact values you can copy into test cases today.

What a boundary actually is

A boundary is the exact point where a system changes its answer.

If a field accepts 1 to 100, then 1 and 100 are boundaries. Below 1 the system says no. Above 100 the system says no. At 1 and 100 it says yes.

Programmers write these rules with comparison operators: < (less than), <= (less than or equal to), > (greater than), >= (greater than or equal to). Choosing the wrong one shifts the boundary by exactly one. This is called an off-by-one error, and it is one of the most common bugs in software.

Boundary value analysis is a black box technique. Black box means you test only what the system does from the outside, without reading the code.

The three-value rule

For every boundary, test three values:

  1. The value just below the boundary
  2. The boundary value itself
  3. The value just above the boundary

For a minimum age of 18, that is 17, 18, and 19.

"Just below" and "just above" depend on the smallest step the field allows. For whole numbers the step is 1. For money it is usually 0.01. For dates it is one day. For timestamps it might be one second or one millisecond.

Bad: "Test the age field with valid and invalid ages."

Good: "Enter 17 — expect the error You must be 18 or older. Enter 18 — expect the form to submit. Enter 19 — expect the form to submit."

The second version can be run by anyone and cannot be argued about.

Numbers and age fields

Six worked examples. In each row, run every value listed.

RuleValues to testWhat you are checking
Age must be 18 or older17, 18, 19The >= vs > mix-up
Age must be under 120119, 120, 121Whether 120 itself is allowed
Quantity between 1 and 100, 1, 2, 9, 10, 11Both ends of the range
Rating from 1 to 5 stars0, 1, 5, 6Zero stars often slips through
Discount percentage 0 to 100-1, 0, 1, 99, 100, 101Negative values and over 100
Team seats, minimum 32, 3, 4Downgrade below the plan minimum

Zero and negative numbers deserve extra attention. A quantity of 0 in a cart often removes the item, which may not be intended. A quantity of -1 can produce a negative order total.

Dates and times

Dates have more boundaries than any other field type, because the calendar itself is full of them.

RuleValues to testWhat you are checking
Booking must be a future dateYesterday, today, tomorrowWhether "today" counts as future
Trial ends after 14 daysDay 13, day 14, day 15The final day of access
Report range: start before endStart = end, start = end + 1 daySame-day ranges
Month rollover31 Jan, 1 Feb, 28 Feb, 1 MarMonth lengths
Leap year28 Feb 2028, 29 Feb 2028, 1 Mar 2028Leap day handling
Year rollover31 Dec 2026 23:59, 1 Jan 2027 00:00Year and week-number logic

Add one more: set your machine to a timezone like Pacific/Auckland (UTC+12) and repeat the "future date" test. A date that is tomorrow for you may still be today on the server.

Pagination and lists

Pagination bugs are boundary bugs almost every time. Assume 10 items per page.

RuleValues to testWhat you are checking
Empty list0 itemsThe empty state renders at all
One page exactly9, 10, 11 itemsWhether a second page appears at 11, not 10
Last page20 items, then open page 2Off-by-one in the final page
Page number out of rangePage 0, page 1, page 999?page=0 and ?page=999 in the URL
Deleting the last item on a pageDelete item 11 of 11 while on page 2The empty page 2 problem
Sorting boundaryTwo items with identical timestampsStable ordering

Try page numbers directly in the address bar, for example https://staging.example.com/orders?page=0. Many apps guard the buttons but not the URL, and you get a blank screen or a crash such as TypeError: Cannot read properties of undefined (reading 'map').

File uploads and sizes

Assume the limit is "images up to 5 MB".

RuleValues to testWhat you are checking
Maximum size4.9 MB, 5.0 MB, 5.1 MBWhether exactly 5 MB is allowed
Empty fileA 0 KB fileZero-length handling
Minimum dimensions, 200x200 px199x199, 200x200, 201x201Dimension checks
Filename length254, 255, 256 charactersFilesystem name limits
Number of files at once9, 10, 11 filesBatch upload limits
Total upload quota1 byte under quota, exactly at quota, 1 byte overQuota maths

Note the difference between 5 MB counted as 5,000,000 bytes and 5 MB counted as 5,242,880 bytes. Files between those two sizes pass one check and fail the other. If a bug appears in that gap, capture the console and network response along with the file size — a tool like Crosscheck records the failing request and browser details automatically when you report from the page.

Money and currency limits

Money uses two decimal places, so the smallest step is 0.01.

RuleValues to testWhat you are checking
Minimum payment of 1.000.99, 1.00, 1.01The minimum charge rule
Free shipping over 50.0049.99, 50.00, 50.01"Over" versus "50 or more"
Refund up to the amount paidPaid 20.00, refund 19.99, 20.00, 20.01Over-refunding
Card limit of 9,999.999,999.98, 9,999.99, 10,000.00Field width and gateway limits
Zero-amount order0.00 after a 100% discount codePayment of nothing
Rounding0.005, 0.015, 33.335Half-up versus half-even rounding

Rounding deserves a test of its own. Split 10.00 three ways and check the parts add back to 10.00 and not 9.99.

Text length limits

Six more, using a 255-character bio field as the example.

RuleValues to testWhat you are checking
Maximum length254, 255, 256 charactersWhether the limit truncates or errors
Minimum length, 8-character password7, 8, 9 charactersPassword rules
Empty and whitespace"" and " " (three spaces)Whether spaces count as content
Multi-byte characters255 emoji, 255 Chinese charactersBytes counted instead of characters
Username uniquenessqa-user and QA-UserCase sensitivity at the edge
Trailing whitespace[email protected] with a trailing spaceTrimming before validation

The multi-byte row catches a real and frequent bug. A field limited to 255 bytes will reject about 63 emoji, even though the user typed far fewer than 255 characters.

How to turn these into test cases

  1. List every field and rule in the feature.
  2. Write the rule as a range, for example "1 to 10 inclusive".
  3. Mark the boundary at each end.
  4. Work out the smallest step for that field: 1, 0.01, one day, one byte.
  5. Write three test values per boundary: below, at, above.
  6. Write the expected result for each value before you run it.

Step 6 is the one people skip. If you decide the expected result after seeing the screen, you will accept whatever the software does.

Mistakes that make this technique fail

Testing only the middle. Entering 50 in a 1-to-100 field proves almost nothing. The middle is where code is most likely to be correct.

Testing only the invalid side. A rule that wrongly rejects 18-year-olds is as bad as one that wrongly accepts 17-year-olds.

Ignoring the client-server split. The browser may block 17 while the API accepts it. Send the request directly with curl or the network tab.

Forgetting that the step is not always 1. For a price field, "just below 50.00" is 49.99, not 49.

Frequently asked questions

What is the difference between boundary value analysis and equivalence partitioning?

Equivalence partitioning groups inputs that should behave the same way and tests one value from each group. Boundary value analysis tests the edges between those groups. Most teams use both together.

Should I use two values or three at each boundary?

Three is the standard and it is safer. Two-value testing only checks the boundary and one neighbour, so it can miss a rule that is shifted the other way. Use two only when test runs are expensive.

Do I need boundary tests if we have automated unit tests?

Unit tests are the best place for boundary values, because they run fast and cover many values cheaply. Still test the boundaries manually once through the interface, since validation often lives in more than one layer.

How do I find boundaries when there is no written specification?

Read the error messages, the placeholder text, and the database column types. A VARCHAR(255) column and a message saying "must be at least 8 characters" both name a boundary.

Is boundary testing useful for dropdowns and checkboxes?

Not directly, since those inputs have no range. Use equivalence partitioning or decision tables for them, and save boundary analysis for fields with ordered values such as numbers, dates, and lengths.

Related Articles

Contact us
to find out how this model can streamline your business!

Trusted by thousands ofengineering teams worldwide.

Add to Chrome
200+ reviews · 100k+ users
Crosscheck browser extension capture controls

Join the Crosscheck Community

Stay in the loop with Crosscheck's newest features and insights.