# Test Data Generation for QA and CI

> Test data generation is often fake CSV or Faker rows. See why foreign keys, table ratios, and constraints make relational test data a separate job.

Canonical: https://subsetra.com/test-data-generation
Language: en

Test data generation for QA and CI

## What people usually mean by “test data generation”

Test data generation creates artificial records so applications can be tried without production data. Search results often look like this: pick a few columns in the browser — name, email, phone, date — and download CSV, JSON, or a handful of SQL INSERTs. Faker and similar libraries do the same inside code.

These tools are not universal, but they should not be dismissed. They are enough to fill an API response, exercise form validation, or put convincing names on a demo screen. They ask for no account, they are fast, and the values they produce are not tied to real people.

The problem is that “test data” sometimes means a file and sometimes means a database. If you have a multi-table schema, foreign keys, and PostgreSQL, MySQL, SQL Server, or Oracle with constraints enabled, importing a fake CSV does not finish test data generation. Technical comparison of methods is on [synthetic data generation](/synthetic-data-generation); what is being produced is on the [synthetic database](/synthetic-database) page.

## When fake row generators are enough

For the jobs below, a mock generator or Faker is often the right tool:

- A single table or flat list of records.
- Columns only need to look plausible individually: valid email format, believable name, random date.
- Output can stay a file (CSV, JSON, a few INSERTs).
- Relationships do not matter, or you can wire a few foreign keys by hand in a small example.

## When they are not enough

When the application runs against a real database, gaps accumulate quickly.

**Foreign keys.** An order without a customer or a payment without an order looks fine in a file; load breaks with constraints enabled. Join tests silently return wrong results.

**Table ratios and linked columns.** Orders per customer, order versus delivery date, city versus country — patterns scatter when columns are filled independently. Performance and reporting tests never see production-like distributions.

**The engine itself.** Types, identity columns, indexes, and bulk load differ between PostgreSQL and Oracle. “Download as SQL” is often a generic INSERT list, not a database built for the target loader and constraint order.

**Repeatability and scale.** Rebuilding the same test every CI run wants a seeded profile and repeatable output. A million-row load test is not a browser-generated CSV job.

**Privacy.** A thin slice from production with light masking looks like quick test data but moves customer records into lower environments — a risk mock generators do not solve, and the same risk as a production copy under KVKK scope.

In short: fake row generation fills columns. Relational test data generation builds a database.

## What relational test data generation adds

Relational test data generation reads the source schema, generates parent tables before children, binds every foreign key to a valid parent, and delivers output loadable on the target engine with constraints enabled. Column values follow patterns learned from the source so tests see production-like behavior, not only “full tables.”

This can be done without copying production rows. A profile is extracted once, read-only; later test databases are generated from that recipe, offline. The same recipe can scale to a small dev copy or a larger load test. A repeatable seed makes it possible to rerun a failing test on the same data.

Hand-written seeds are relational test data generation too — but you carry the relational logic and schema changes. Calling Faker per column and wiring foreign keys yourself is the same. As the schema grows, effort shifts to a tool that reads the schema graph.

## Try it with Lyrebird

Lyrebird is for the second job: relational, loadable synthetic test databases with foreign keys intact. It supports PostgreSQL, MySQL, SQL Server, and Oracle. Community is free, generates up to 5,000 rows per table, and runs locally on Linux, macOS, and Windows. It does not send data externally.

Before connecting to production, you can [compare source and synthetic sides](/lyrebird/samples) of four public examples in the browser. Product narrative and measured results are on the [Lyrebird page](/lyrebird). To see a test database from your schema, [request a demo](/request-demo).

Read how we build [realistic test databases without copying production](/blog/realistic-test-databases-without-copying-production).

For a small schema you can describe in SQL, try the [PostgreSQL test data generation example](/blog/postgresql-test-data-generation). It creates customers and orders with valid foreign keys and a repeatable distribution. For a broader choice, [compare test data generation methods](/test-data-generation-methods).

- [Explore Lyrebird](https://subsetra.com/lyrebird)
- [View sample databases](https://subsetra.com/lyrebird/samples)
- [Request a demo](https://subsetra.com/request-demo)
- [Home](https://subsetra.com/)

## FAQ

### Is test data generation the same as generating fake CSV?

Not the same, though search results often confuse them. Fake CSV or Faker fills columns. Relational test data generation builds a database that preserves schema, foreign keys, and engine constraints. The former is enough for small single-table jobs; the latter is usually required for multi-table applications.

### When are Faker, Mockaroo, or browser generators enough?

When you need a single table, a flat record list, or only plausible-looking fields. Limits appear when foreign-key graphs, table ratios, target-engine constraints, and repeatable CI databases matter.

### What does a relational test data generator do?

It reads the source schema and relationships, generates parent rows before children, and delivers output loadable into a database with constraints enabled. Lyrebird does this from a profile, offline, without copying production rows.

### Can I try it for free?

Yes. Lyrebird Community is free: local profiling, desktop app, and up to 5,000 synthetic rows per table. Sample profiles and source–synthetic comparisons are at `/lyrebird/samples` without installation.
