How to generate synthetic test data

By the Ground team

To generate synthetic test data without production records, describe your tables, how they join and what cases the application must handle. Ground builds the related tables you can inspect and export. Pin a checked export to use the same rows in local development and CI.

Write the request around your tests

Name the tables and how they relate, the values that must agree (a total and its line items, a date and the dates after it), and the cases your code must handle: missing values, duplicates, rare statuses, boundary dates.

Ground builds keys that point to real rows, computed columns that follow their inputs, and time series in order.

  1. Check types and required fields against the consuming system.
  2. Check dependent fields together, such as a city and its postal code.
  3. Start with small row counts for integration tests; raise them for load tests.
  4. Keep the downloaded tables with the test that uses them.

Build a relational test database without production data

The Acme Cloud fixture contains 83,061 rows across 8 linked tables. Load the pinned export into PostgreSQL and check foreign keys, invoice totals and four required cases.

Use organizations as parents of subscriptions and invoices. Require every invoice to use its organization’s currency and every amount due to equal subtotal less credit. Ask for credited and overdue invoices so tests exercise both cases.

Example request

Generate synthetic SaaS billing and support data for a PostgreSQL test database. Include organizations, users, subscriptions, invoices, integrations, tools, usage events and tickets. Preserve their relationships. Include credited and overdue invoices, cancelled organizations and unresolved tickets.

Adjust it in the editor

The overview canvas shows every table and how they connect. Open a table to see its rows and each column's details. Ask Surveyor how many rows meet a condition, or to add rows or a column.

To change the structure, add a table, column or relationship, or change row counts, then regenerate.

Automate with the API

Create a dataset with an idempotency key, poll its build and confirm the design if requested. Download the completed dataset by version, save its ZIP and checksum with your CI artifacts and replay those exact bytes when a test fails.

Common questions

How do I get the same data again?

Keep a versioned export and its checksum with your tests. Load that export on each run.

Can I test related tables?

Yes. Describe the tables and how they relate; keys in child tables point to rows that exist in their parents.

Try it with your own dataset

Get started, see pricing or use the API.

Review security and privacy when evaluating Ground for your team.

Read the Markdown guide

Related guides