Privacy engineering

Create Synthetic Test Data Without Copying Real Customer Records

Build test fixtures from required behaviors and invented records, with checks that stop production data from entering development workflows.

Synthetic test data should begin with a model of the behavior you need to exercise, not a copy of the customer database. A useful fixture represents the shape, relationships and edge cases of the application while avoiding real people’s records. Replacing names in an export is a different activity: the remaining fields and relationships may still identify someone or reveal sensitive facts.

Consider a scheduling application used by several organizations. Engineers need to test overlapping bookings, inactive members, different time zones and cancellation rules. They do not need actual customer names, private appointment descriptions or real contact details to reproduce those behaviors. A deliberately constructed set of fictional organizations can make the tests more understandable as well as reduce unnecessary data exposure.

The practical goal is a repeatable fixture system with a known origin, explicit coverage and a clear boundary against production data. Calling a file synthetic does not establish any of those properties.

Define the behavior before the records

List the decisions the application must make. For the scheduling example, those include whether two bookings conflict, which organization owns a room, whether an inactive member can create a booking and what happens across a daylight-saving transition. Each decision implies particular relationships or values in the fixture.

Write expected outcomes alongside the scenarios. A pair of overlapping bookings should produce a known conflict. A member from a different organization should be denied access to a private booking. A cancellation should release availability according to the product’s actual rules. This makes the data useful for testing rather than merely realistic-looking.

The NIST Privacy Framework provides a voluntary approach to managing privacy risk. It is useful context for asking why data is processed and where risks arise, but it does not certify a particular fixture or make generated data automatically anonymous. The design choices in this guide are an engineering workflow for reducing unnecessary use of real records.

Separate correctness fixtures from load fixtures. A small named scenario is easier to understand when diagnosing a failed rule. A large generated dataset can exercise performance characteristics, but its volume alone does not demonstrate that important business cases were covered.

Build an invented domain model

Create fictional organizations, users, resources and events from scratch. Preserve the relationships that matter to the application: membership, ownership, state transitions and references. Avoid importing a real customer graph and replacing only the display fields, because the graph itself can carry identifying information.

Use visibly fictional identifiers and non-deliverable or controlled test destinations. Do not generate plausible contact details that may belong to real people. The test environment should also prevent outbound messages from reaching arbitrary recipients, so a fixture mistake cannot send notifications outside the test boundary.

Choose names that help explain the scenario. A resource called a shared room in a fictional north office is more informative than a random string when the test concerns cross-organization access. Randomness can still be useful for broad input exploration, but explanatory fixtures should remain readable.

Document the intended relationships in a short diagram or table. If a test fails because a member belongs to two organizations, the reviewer should be able to see that this was deliberate. Hidden assumptions inside a generator make both privacy review and debugging harder.

Represent distributions without copying people

Some tests need variation in size, frequency or missing values. Define that variation as a parameter of the generator rather than extracting a row-level sample from production. For example, a performance fixture may contain a few organizations with many bookings and many organizations with fewer bookings.

Explain why those shapes matter to the test. A skewed distribution may expose a slow query for a heavily used resource. A high proportion of optional fields left empty may reveal assumptions in the interface. These are engineering hypotheses to test, not claims that the fixture precisely represents the customer population.

If aggregate operational measurements are used to choose parameters, review how those measurements were produced and whether small groups could reveal individuals. Keep the generator independent of the underlying records. A summary statistic does not justify attaching the original export to the test project.

Avoid claiming that realistic output proves privacy. A generated record can accidentally resemble a real person, and a model trained on sensitive data may introduce additional concerns. The safest ordinary fixture workflow is to construct the needed cases deliberately and keep its inputs free of personal records.

Make generation reproducible

A reproducible generator helps an engineer recreate a failing test without circulating a database snapshot. Record the generator version, configuration and random seed where randomness is used. Keep those parameters free of secrets and make the expected fixture version part of the test setup.

Separate stable identifiers from incidental ordering. If every run assigns different identifiers to the same scenario, assertions and diagnostic output become harder to compare. Stable scenario keys can coexist with a randomized background dataset when the two purposes are clearly separated.

Treat the generator as maintained code. Review changes to relationships and state distributions because they can silently remove coverage. A faster generator is not an improvement if it stops producing the conflict or boundary condition that a regression test relies on.

Include cleanup and reset behavior. A test suite that starts with invented records can become contaminated if later steps copy external data into it or persist manual debugging changes. Resetting to a known fixture state should be a routine operation rather than a risky manual deletion.

Block production data at the boundary

Document which systems may feed the test environment. A development database should not gain access to production backups simply because an engineer needs to reproduce a bug. Make the approved route explicit: describe the behavior, create a minimal fictional example and add it to the fixture library.

Review import tools, support attachments and analytics exports as potential entry points. Personal data can arrive in a spreadsheet or screenshot even when the database itself is synthetic. The boundary applies to the whole debugging workflow, including issue trackers and shared chat channels.

Use automated checks where they are useful, but be clear about their limits. A scan can identify known sensitive field names or suspicious patterns; it cannot prove that every value is harmless. Pair checks with provenance records and review of how the data was created.

The data flow mapping guide can help identify these routes. Add test environments, artifact stores and support systems to the map so that temporary debugging copies do not remain invisible to retention and access decisions.

Review fixtures for the failures they can hide

Synthetic data can be too clean. Include missing optional fields, long values, unusual characters, duplicate display names and state changes that occur in an inconvenient order. The purpose is to expose assumptions without borrowing real records.

Test authorization boundaries with at least two fictional organizations and several roles. A single-tenant fixture cannot reveal an accidental cross-tenant lookup. Include a resource that exists but belongs to another organization, and verify that the response does not disclose its private details.

For date and time behavior, use explicit time zones and carefully selected boundary cases. For text, include examples that exercise the application’s actual language and encoding requirements. Do not describe a few invented strings as comprehensive internationalization coverage; record which behaviors were tested and which remain outside scope.

Review attachments and binary files too. A fictional database paired with a real customer document is not a synthetic test package. Create safe sample files with controlled contents, and make their purpose clear in the fixture manifest.

Keep a fixture manifest with the tests

A useful manifest records the generator version, scenario list, expected outcomes, data origin, permitted destinations and reset process. Add the owner responsible for maintaining it and the tests that depend on each important scenario.

When a production defect is reported, translate it into the smallest invented case that reproduces the behavior. Explain which properties were preserved and which were intentionally omitted. This produces a reusable regression test without making the original customer’s record a permanent development dependency.

Finally, review whether the fixture still matches the application’s current rules. New permissions, integrations or retention features may require new cases. A synthetic dataset is a maintained testing instrument, not a one-time privacy label. Its value comes from transparent construction, repeatable behavior and a reliable separation from real customer data.