Skip to main content
Back to Blog

Freeze Generated Test Data Before CI Needs It

Random test data can reveal a bug and hide it on the next run. Generate a small batch, save the exact failing record, and add deliberate boundary cases.

Shashank Rawlani

Engineering Leader | Builder | Problem Solver | AI Engineer

Published Oct 14, 20262 min read
View AI-ready Markdown
Four generated record rows appear in a left panel. One green row crosses into a dashed fixture box and ends at a fixed marker. Two orange side paths stop at crossed-out markers before the box.
Listen to this article · 3 min

Use the Test Data Generator to make a small batch of plausible records, then copy the chosen records into a checked test fixture. Each click produces new random values, so the tool is useful for preparing data and exploring layouts, not for reproducing the same values on every CI run.

A form test fails only when a long name wraps onto a second line. Re-running it with newly generated data changes the input again, and the failure disappears. The data is useful because it revealed a boundary; the test becomes useful only after the boundary value is saved.

Generate a batch you can inspect

Open the tool, select Full Name, UUID, and Job Title, set the row count to two, and press Generate. Switch between JSON and CSV to choose the format your fixture loader accepts. The generator produces two records with those three keys. On the live page, one run produced:

[
  {"name":"Sofia Agarwal","uuid":"344d7e85-5527-4382-80c3-2ea219dbacef","job_title":"QA Engineer"},
  {"name":"Ava Williams","uuid":"4919f380-de38-4786-8b49-f8a4331db841","job_title":"Backend Engineer"}
]

Your names and IDs will differ. The CSV export has the same columns: name,uuid,job_title. The page can copy or download the current output; switching format does not generate a new batch.

Save the case that found a problem

The implementation uses Math.random() for names, IDs, and most other fields. It has no seed control. If a generated record exposes a bug, copy that exact record into a fixture and give the test an assertion about the observed behavior. Do not ask the tool to regenerate it next run.

The field list includes email, phone, password, and card-shaped values. Treat them as display and validation samples only. The generated email domain can be a real mail provider, and the password generator is also based on Math.random(); neither belongs in a live account or a security test. Use reserved addresses and a dedicated test payment provider when the workflow could send mail or process a card.

Random rows do not cover boundaries

Two plausible people will not reliably produce an empty string, a maximum-length name, or a duplicate ID. Add those cases by hand. Use the generator for ordinary records and use deliberate fixtures for the conditions that make a test meaningful.

Is the output repeatable? No seed is exposed. Save the exact rows you want to run again.

Can I download 1,000 rows? The page's row-count control tops out at 100. For larger, repeatable datasets, write a seeded generator in the test project and keep its seed with the run evidence.

Keep the input that exposed the bug

Generate a handful of records for one form. Save one ordinary case and one manually chosen boundary case as fixtures. Record the failing input with the test result so the next run exercises the same condition.

The data generator