Generate Boundary and Equivalence Partition Test Cases
Reads field constraints (min/max/length/format) and returns boundary and equivalence-partition cases for each, values just inside, on, and just outside the boundary, with technique labels (BVA or EP) per case.
When to use it
- You have field-level constraints (length, range, format) and need disciplined coverage.
- You're auditing an existing test suite for missing boundary cases.
- You're teaching ISTQB techniques and need worked examples.
- You want to combine with `generate-test-data-fixtures` for full test-data coverage.
The prompt
<role>You are an ISTQB-certified test designer. You apply boundary value analysis (BVA) and equivalence partitioning (EP) with literal precision: "boundary" means on the boundary, not "around it".</role> <context>For every numeric or length constraint, you produce three values: just inside the valid range, on the boundary, and just outside. For every value range, you identify equivalence partitions (one valid, one or more invalid) and produce one representative value per partition.</context> <task>For the field constraints below, generate a table of test inputs covering:- For each numeric/length constraint: just-inside / on / just-outside triples (per boundary, so a min and a max give 6 values total)- For each value range or enum: one EP representative per valid partition and one per invalid partition- Mark each row with the technique label (BVA or EP) and a classification (valid / invalid)</task> <input>Field constraints: {constraints}</input> <constraints>- Table columns: Field, Value, Classification (Valid / Invalid), Technique (BVA / EP / BVA+EP).- For BVA, never use "representative" values: use the literal boundary triples. For length boundaries, the string must have exactly the stated length: count it.- For EP, use realistic values that obviously belong to that partition.- Include 1-2 hybrid cases (BVA+EP) per numeric/length field where BVA and EP intersect (e.g., on-boundary + invalid type).</constraints> <output_format>A Markdown table with the 4 columns above, followed by a 1-2 sentence "Coverage gap" paragraph noting any constraints that have no obvious boundary (e.g., format constraints: no triples possible).</output_format> <approach>Before writing, list the partitions and boundaries for each field.</approach>## RoleISTQB-certified test designer. Literal precision in BVA and EP. ## ContextBVA = three values per constraint (just-inside, on, just-outside). EP = one representative per valid/invalid partition. ## TaskFor the field constraints below, generate a table with:- BVA triples per numeric/length constraint- EP representatives per partition (valid and invalid)- Technique label + classification per row ## Input- Field constraints: {constraints} ## Constraints- Columns: Field, Value, Classification (Valid / Invalid), Technique (BVA / EP / BVA+EP).- BVA uses literal boundary triples, never "representative". Length-boundary strings must have exactly the stated length.- EP uses realistic values.- Include 1-2 hybrid BVA+EP cases per numeric/length field. ## Output formatMarkdown table + 1-2 sentence Coverage gap paragraph for non-boundary constraints (formats). ## ApproachList partitions and boundaries per field before drafting.Example
Input
Field constraints: - age: integer, 18-99 inclusive - username: string, 3-20 chars, alphanumeric + underscore - score: integer, 0-100 inclusive - country: enum, one of US / CA / MX
Output
| Field | Value | Classification | Technique | |----------|------------------------|----------------|-----------| | age | 17 | Invalid | BVA (lower, just-outside) | | age | 18 | Valid | BVA (lower, on) | | age | 19 | Valid | BVA (lower, just-inside) | | age | 98 | Valid | BVA (upper, just-inside) | | age | 99 | Valid | BVA (upper, on) | | age | 100 | Invalid | BVA (upper, just-outside) | | age | 18.5 | Invalid | EP (non-integer) | | age | -5 | Invalid | EP (negative) | | age | "18" | Invalid | BVA+EP (on boundary, string instead of integer) | | username | "ab" | Invalid | BVA (lower, just-outside) | | username | "abc" | Valid | BVA (lower, on) | | username | "abcd" | Valid | BVA (lower, just-inside) | | username | "nineteen_chars_yes1" | Valid | BVA (upper, just-inside) | | username | "twenty_chars_exactly" | Valid | BVA (upper, on) | | username | "twenty_one_chars_long" | Invalid | BVA (upper, just-outside) | | username | "has space" | Invalid | EP (invalid char class) | | username | "user42" | Valid | EP (alphanum partition) | | username | "ab!" | Invalid | BVA+EP (min length 3, invalid char) | | score | -1 | Invalid | BVA (lower, just-outside) | | score | 0 | Valid | BVA (lower, on) | | score | 1 | Valid | BVA (lower, just-inside) | | score | 99 | Valid | BVA (upper, just-inside) | | score | 100 | Valid | BVA (upper, on) | | score | 101 | Invalid | BVA (upper, just-outside) | | score | 100.5 | Invalid | BVA+EP (just above max, non-integer) | | country | "US" | Valid | EP (enum member) | | country | "CA" | Valid | EP (enum member) | | country | "MX" | Valid | EP (enum member) | | country | "UK" | Invalid | EP (not in enum) | Coverage gap: 'country' is an enum so no BVA triples exist, it's a pure EP field. Username's character-class rule (alphanumeric + underscore) is covered by one positive (alphanum) and one negative (space) EP case but doesn't have all variations of invalid character classes (Unicode, control chars); add those via the test-data fixtures prompt if needed.
Common pitfalls
- Model picks 'around' the boundary (e.g., 17 and 19) but skips the boundary itself (18). Re-prompt to require literal on-boundary.
- BVA and EP get conflated: every case labeled BVA. Demand the EP label on partition-representative cases.
- Composite boundaries (min length AND alphanumeric) get one combined case instead of separate cases per constraint.
- Model may produce duplicate values for different fields' boundaries: review for accidental overlap.
Tips
- Feed constraints exactly as written in the spec: don't paraphrase 'between 18 and 99' as '18+', the model loses upper bound.
- Combine BVA and EP coverage with `generate-test-data-fixtures` to get JSON-ready data plus the analysis table.
- For composite constraints (length AND format), run the prompt twice, once for length, once for format, and merge.
- Use this with `decision-table` tool for combinatorial coverage when fields interact.
- Models miscount string lengths: paste each length-boundary value into the character counter before using it.
FAQ
Is BVA alone enough?
No. BVA catches off-by-one errors at boundaries; EP catches errors specific to a value class (negative numbers, wrong type, invalid format). Real defects hide in both. Use both together for a baseline.
Can this replace a full test case generator?
No: this generates atomic input values, not end-to-end test scenarios. Use `generate-test-cases-from-requirements` for scenarios, then this prompt to enrich the data for each.
What about composite boundaries (e.g., field length AND complexity together)?
Split into separate fields in the input. The model handles independent constraints well but conflates joint ones. Then merge results into a decision table for combined coverage.
Does BVA still matter in 2026 with property-based testing tools available?
Yes: property-based tools (Hypothesis, fast-check) explore many values but rarely hit the exact boundary on the first try. BVA gives a fast, deterministic regression net.