GenerateRandomSearch

Input Validation Scenario Generator

Almost every length-validation bug is an off-by-one: the minimum treated as exclusive, the maximum as inclusive, or the value measured before trimming rather than after. This produces the cases that expose exactly those — the boundary itself and one character either side of both limits — and adds the whitespace cases, where a field that trims before measuring and one that measures before trimming quietly disagree.

What this generator does

Produces nine cases for a length rule: empty, one below the minimum, exactly the minimum, one above, one below the maximum, exactly the maximum, one over, and two whitespace cases — each with the outcome it should produce and why.

How to use this tool

  1. Set the minimum and maximum length the field should accept.
  2. Read each case with the outcome it should produce.
  3. Pay attention to the two exact-boundary cases.
  4. Copy the table straight into a test suite.

Understanding the controls

Minimum length
The shortest value the field should accept, from 1 to 20.
Maximum length
The longest it should accept, up to 200 and always above the minimum.
Seed
Chooses which field name the cases are written against.

Common use cases

  • Boundary testing a form field's length rule
  • Catching inclusive-versus-exclusive mistakes at the limits
  • Deciding whether the field trims before or after measuring
  • Documenting intended validation behaviour with examples
  • Regenerating an identical validation suite from a seed

How this generator works

Every expected outcome is derived from the rule applied to the trimmed value, so the table cannot contradict its own limits. The check re-derives each outcome and, crucially, requires cases to exist at exactly each boundary and one either side — a suite missing those is not a boundary suite at all.

Randomness and fairness

Only the field name is random; every case and its expected outcome follow from the two limits. Seeded suites reproduce and are therefore explicitly not cryptographically secure.

For how randomness is produced across the whole site, see how Generate Random works.

Limitations and good to know

  • Length rules only — format rules such as email or postcode patterns need their own cases entirely.
  • Character counting is by code unit, so an emoji or a combining accent may count as more than one character.
  • Only ASCII filler is used in the generated values.
  • No injection or encoding cases; this covers validation logic, not attack payloads.
  • Suites are not stored between visits.

Privacy and your data

Cases are generated in your browser. Nothing about them or your seed is transmitted.