Boundary value analysis (BVA) is a test design technique that places test inputs at the edges of each valid range, because that is where off-by-one errors live. This generator produces those values for six data types — integers, floats, strings, dates, arrays and currency amounts — and labels each one with whether a correct implementation should accept it, so the output is a ready-made test table.
Enter a range of 1 to 100 and you get 0, 1, 2, 50, 99, 100 and 101. Then come the values outside your spec that real systems still receive: zero, negatives, the int32 and int64 maximums, numbers beyond JavaScript's safe-integer range, NaN, Infinity, -0, null, undefined and a missing key.
How to use it
- Pick a data type.
- Enter the lower and upper bounds from your requirement — or, for strings and arrays, the maximum length.
- Keep include null and empty cases on unless your input can never be absent.
- Export the table as JSON or CSV and feed it to a parameterised test, using the
Should Acceptcolumn as the expected result.
What you can control
- Integers: min−1, min, min+1, midpoint, max−1, max, max+1, zero, negative, int32 max, int64 max and an integer beyond
Number.MAX_SAFE_INTEGER. - Floats: values just outside each bound, the smallest positive double,
-0,Infinity,NaN,0.1, the largest double and scientific notation. - Strings: empty, one character, maximum length and one over, padding, whitespace only, newlines, Unicode, HTML, a null byte and emoji.
- Dates: leap day, 29 February in a non-leap year, 31 April, a DST spring-forward gap, a leap second, the Unix epoch, before the epoch, the 2038 overflow and
9999-12-31. - Arrays: empty, one element, maximum length and one over, duplicates, nested arrays, mixed types and an embedded
null. - Currency: the integer cases plus leading zeros, a thousands separator and three decimal places.
null,undefinedand an absent key for every type.
Using the table in a test
import json
import pytest
CASES = json.load(open("fixtures/quantity_boundaries.json")) # exported from this tool
@pytest.mark.parametrize("case", CASES, ids=lambda c: c["Case"])
def test_quantity_validation(case, client):
response = client.post("/cart/items", json={"sku": "ABC-1", "quantity": case["Value"]})
assert (response.status_code == 201) == case["Should Accept"]
Each row becomes a named test — below minimum, int32 maximum, null — so a failure tells you exactly which edge broke. Values are exported as strings; convert them if your API is strict about JSON types, and give the missing key row a small branch that omits the field instead of sending it. The guide Boundary value analysis with examples goes further into choosing ranges and combining boundaries.
Testing ideas
- Client and server separately. Run the table through the UI and directly against the API. A form that blocks 101 does not stop a script from sending it.
- Type coercion. Send
"100"as a string and100as a number. Loose comparison in JavaScript or PHP can accept one and reject the other. - Database limits. A
VARCHAR(255)column with a 255-character UI limit still fails on a 255-character string of emoji in some collations. Use the string cases with the Unicode edge case generator. - Dates in your zone. The DST case is for US Eastern time; generate it again for each zone you serve.
What this is not
The generator cannot know your requirement — it trusts the bounds you enter. If the requirement itself is wrong (is 100 allowed or not?), the table will faithfully test the wrong thing. Agree on inclusive or exclusive bounds before you start.