# Test data management

> Test Data Management: What It Covers and Who Owns It. Canonical page: <https://zapple.tech/glossary/test-data-management/>

Test data management is how a team creates, protects, shares and refreshes the data its tests run on. Done well, tests get realistic data on demand and no real customer data sits in test systems. Done badly, releases wait for environments and tests fail for reasons that have nothing to do with the code.

## What does test data management cover?

Tests need data: users, orders, accounts, products. Test data management is the set of habits that decide where that data comes from, who may see it, and how it gets back to a known state. It covers four jobs: getting data, protecting it, sharing it between teams and environments, and resetting it so the next run starts clean.

It is often invisible until it breaks. Automation that passes on a developer's machine and fails in the shared environment is frequently a data problem, not a code problem. For how this fits a wider plan, see our post on [test automation strategy mistakes](/blog/test-automation-frameworks/what-is-the-best-test-automation-strategy-5-mistakes-to-avoid/).

## Production copy, masked data or synthetic data: which fits your case?

You have five sources. They trade privacy against realism and effort.

| Source | Privacy exposure | Realism | Upkeep | Refresh time |
|:--|:--|:--|:--|:--|
| Raw production copy | Highest: real personal data in test systems | Highest | Low until an incident | Slow, a full copy |
| Masked production copy | Medium: depends on how well the masking is done | High | Masking rules change with every schema change | Slow to medium |
| Subset of masked data | Medium, smaller surface | High for covered cases | Subset rules must keep related records together | Faster |
| Synthetic data | Low if generated from scratch | Varies: misses odd real cases unless modelled | Generator needs tuning | Fast, on demand |
| Hand-built fixtures | None, if the values are invented | Low, only the cases you wrote | Grows with the suite | Instant, per test |

Masking sounds simple and is not. The goal is that nobody can link a record back to a person, which is a different goal from "the field looks scrambled". Treat a removed name as the start of the question, not the end. [GDPR Recital 26](https://eur-lex.europa.eu/eli/reg/2016/679/oj) says that pseudonymised data which could be attributed to a person with additional information is still information on an identifiable person, and that to judge identifiability you account for "all the means reasonably likely to be used, such as singling out". Ask your legal owner how that applies to your data.

For generated data, the [Synthetic Data Vault documentation](https://docs.sdv.dev/sdv) describes a library that trains a model on your real tables and samples any amount of synthetic data from it, with tools to measure how close it is to the original. That is a vendor's description of its own tool. It does not tell you whether the result is safe for your data, so ask your security owner to review it.

For the data a single test needs, fixtures are often enough. [Playwright's documentation](https://playwright.dev/docs/test-fixtures) says fixtures establish the environment for each test and are isolated between tests, and [pytest](https://docs.pytest.org/en/stable/explanation/fixtures.html) documents the same idea for Python. Where a test needs a real database, [Testcontainers](https://testcontainers.com/guides/introducing-testcontainers/) can start one in a container for the run. You then fill it from one of the sources above.

## Who should own test data, and what does poor test data cost a release?

Name one owner per data set. In our experience the shared environment database is the one with no owner, and that is where problems collect. For data that has to line up across several services, see our [integration testing services](/services/integration-testing-services/).

Poor test data shows up as:

- **Flaky tests.** Two suites change the same record. One passes, the other fails, and the failure moves between runs.
- **Blocked environments.** A refresh takes a day, so a release waits for it.
- **Personal data in test systems.** A masked copy that was never reviewed, readable by every contractor with access.
- **False confidence.** Hand-built data covers only the cases someone remembered.

A workable split: platform or QA owns the shared environment data and its refresh; each team owns the fixtures that create what its tests need. Put the refresh in the pipeline, not in a person's calendar. For where that fits, read how to build a [QA automation pipeline](/blog/types-of-automation-testing/guide-to-creating-qa-automation-pipeline/) and [continuous testing in DevOps](/blog/test-automation-frameworks/how-to-use-continuous-testing-in-devops/).

## How is it related to service virtualization and data-driven tests?

Service virtualization replaces a dependency you cannot get; test data management supplies the data inside the ones you can. Both topics share one conference session: a [talk recording from Alaska Airlines](/blog/aqa-process/ryan-papineau-alaska-airlines-service-virtualization-and-test-data-management-the-journey/) covers them together. See [service virtualization](/glossary/service-virtualization/) for the first. Running one test over many rows of data is data-driven testing, which is a separate term.

## What does Zapple.Tech do about it?

If your tests fail for reasons nobody can explain, start with the evidence. Zapple.Tech starts with a one-week QA audit of one product area. It looks at its tests, pipeline and release process, and ends in a written report on what is at risk and what to fix first, plus a pilot plan you can run with Zapple.Tech or without it. Read more on the [QA audit and assessment](/services/audit-and-assessment/) page.

Tell us about your environments in the form below.

## FAQ

### What is test data management?

Test data management, or TDM, covers how a team gets, prepares, protects and refreshes the data used in testing. It includes choosing between masked production data, subsets, synthetic data and hand-built fixtures, deciding who owns each data set, and keeping test environments supplied without exposing real personal data.

### What is the difference between data masking and synthetic test data?

Masking starts from real records and hides or replaces the sensitive fields. Synthetic data is generated from scratch, often by a model trained on real data's structure. Masked data keeps real-world quirks but carries re-identification risk if done badly. Synthetic data avoids copying people but may miss odd real cases.

### Can you use production data for testing?

A raw copy of production data is a privacy and security risk, because personal data then lives in systems with weaker controls. The usual alternatives are to mask or de-identify it first, subset it, or generate synthetic data. Ask your security and legal owners what your regulators and contracts require before you copy anything.

### Who is responsible for test data?

One named owner per data set. Often it is QA or a platform team for shared environment data, and each team for the fixtures inside its own tests. The failure to avoid is the shared database nobody owns, where any team can change a record another team's tests depend on.

### What does a test data management tool do?

A tool typically automates one or more steps: discovering sensitive fields, masking them, cutting a subset, generating synthetic records, and refreshing environments on demand. Whether you need one depends on how many environments and how much data you manage. Small teams often start with scripts and fixtures.

## Sources

- [Regulation (EU) 2016/679 (GDPR), Recital 26 (legal text in force, read 2026-12-05)](https://eur-lex.europa.eu/eli/reg/2016/679/oj)
- [Synthetic Data Vault documentation, Welcome to the SDV (current docs)](https://docs.sdv.dev/sdv)
- [Playwright documentation, Fixtures (current docs)](https://playwright.dev/docs/test-fixtures)
- [pytest documentation, About fixtures (current docs)](https://docs.pytest.org/en/stable/explanation/fixtures.html)
- [Testcontainers guides, Introducing Testcontainers (current docs)](https://testcontainers.com/guides/introducing-testcontainers/)
