Skip to content

PATTERN Cited by 1 source

TDD layer over SCM baseline

Definition

The TDD layer over SCM baseline pattern is an opt-in test-first discipline that layers on top of a mandatory SCM workflow. It fires between two SCM states (e.g., feature-claimed and pr-ready), calls down into the SCM substrate for branch operations, but does not call up. The dependency is one-way: SCM is mandatory regardless of whether TDD is adopted.

The layer decomposes the test-first workflow into per-role agents with schema-validated artifact contracts between them, ensuring that tests come first and cannot be deleted or weakened by the implementing agent.

Mechanics

  1. Spec-author turns a requester narrative into a structured feature artifact
  2. Architect-reviewer maps NFRs to architectural decisions (architecture.json)
  3. Test-strategist produces test list with per-AC scenarios (test-list.json)
  4. Scrum-master orchestrates build cycles on experiment branches (using SCM branch primitives)
  5. Driver + Navigator execute RED-GREEN-REFACTOR in paired inner loop

Each role has documented inputs/outputs validated against a schema. Missing or malformed artifacts are treated as failed gates. The test-list is produced before implementation begins — the implementing agent cannot modify it.

Why it matters for agents

Kent Beck (2026 Pragmatic Engineer interview): agents delete tests to make them pass. The TDD layer prevents this by separating test authoring (test-strategist) from implementation (driver) with a gate between them.

Anti-pattern

Allowing the implementing agent to both write and delete tests. Without separation of concerns between test-authoring and implementation, the green bar is trivially achievable by reducing test coverage.

Seen in

Last updated · 542 distilled / 1,571 read