Test Data Builder

Installation
SKILL.md

Test Data Builder

Produce per-test domain data that is realistic, deterministic, and isolated. The costly failure this prevents is the shared fixture file that becomes an append-only god object: one test tweaks a record, three unrelated tests start flaking, and nobody can delete a fixture row because nobody knows who depends on it. Builders with valid defaults make every test self-describing and every failure reproducible.

Operating procedure

Order matters: defaults must be valid before overrides mean anything, and determinism must be in place before you add realistic randomness.

Step 1: Gather inputs

Collect before writing a factory. Defaults in parentheses; label guesses as guesses.

  1. The domain object(s) under test and their required fields.
  2. The stack's factory library (FactoryBot for Ruby, Fishery or test-data-bot for TypeScript, factory_boy for Python, Bogus/AutoFixture for .NET; default: hand-rolled builder if none exists).
  3. Whether tests touch a real database, and the isolation mechanism available (per-test transaction rollback preferred).
  4. The invariants a "valid" object must satisfy - validations, foreign keys, non-null constraints.

Step 2: Build per test, never share a global fixture

Installs
–
GitHub Stars
19
First Seen
–