Test implementation

/qa:test-data

Generate test-data factories and fixtures

Typed factories, builders, fixtures, and seeding/cleanup helpers, synthetic-only.

USAGE/qa:test-data <entity or domain, e.g. user, order>
Test implementationCTFL v4.0 §1.4Automation

What it does

Builds typed, parallel-safe data factories/builders for an entity, paired seeding and teardown helpers, and wires them into fixtures so specs get data declaratively. Synthetic data only; secrets pulled from the configured store, never hardcoded.

When to use it

Tests need data setup for an entity or domain.

Prerequisites

qa.config.yml (run /qa:qa-init first); an entity backed by a test condition or OpenAPI schema; a fixtures/framework (run /qa:scaffold if none). Honors paths.*, test_data.*, stack.*, tooling.*, risk_areas.

Output

Typed factories/fixtures + seed/cleanup helpers under paths.tests_dir, plus paths.docs_dir/TEST-DATA-<entity>.md (29119-3 Test Data / Environment Requirements).

Mechanics

How it works

  1. Read config and resolve test_data.*/stack.*/paths.*; route to /qa:qa-init if config is missing
  2. Resolve the entity; require it to map to a test condition or an OpenAPI schema (else route to /qa:test-design)
  3. Build typed factories/builders that are contract-valid, parallel-safe (unique id per call), in the repo's language
  4. Add seeding (prefer api over db) with a paired teardown in reverse dependency order
  5. Enforce sensitive-data rules: synthetic/anonymized only, secrets from test_data.secrets_store
  6. Wire factories into existing fixtures so specs get data declaratively
  7. Write the Test Data Requirements doc with a traceability table and a measurable coverage summary

Why it works

The theory behind it

Test implementation (CTFL v4.0 §1.4) — preparing test data is implementation testware; synthetic-only data enforces the no-real-PII privacy rule applied throughout the toolkit.

CTFL v4.0 §1.4

Example

See it in use

test-data
> /qa:test-data "order"

✓ Correct when Data is synthetic-only and each test can build/own its own order (parallel-safe).