Two scenarios can give different results if they start with different data—or interfere with each other if they change the same shared database. Test data management (TDM) is the practice of defining and maintaining the data provided to the system under test. For repeatable results, each scenario needs an effectively identical starting state, called a baseline. section 18.1
Choose a baseline that fits the database or service:
- Clean start: begin empty. Each scenario must provide the data it needs. section 18.1
- Seeded: begin with common reference data and default entities. Scenarios add only what their behavior requires; this is recommended when feasible. section 18.1
- Snapshot: begin with a richly populated dataset, such as an anonymized production snapshot or curated data. This can help when direct data insertion or manipulation is unsuitable. section 18.1
A baseline may still need scenario-specific entities. If automation can freely change the service state, it can insert exactly what a scenario needs. Otherwise, it can query the baseline for entities matching stated criteria or use entities manually identified in it. Querying needs a suitable API and fails when no entity matches; both querying and hardcoding depend on the baseline containing suitable data. section 18.1 section 18.7
Figure 18.1 Conflicting modifications when running tests in parallel using a shared database

Parallel scenarios can make conflicting changes when they use a shared database. Resetting a baseline supports repeatability, but running against an external service also requires an isolation strategy, such as serial execution, resource pooling, or exclusive data partitions. section 18.1 section 18.7
