tdd-patterns

Provide TDD and ATDD patterns for designing and validating implementations.

Updated May 10, 2026
One-click install
npx skills add https://github.com/rob-broadley/ai-airbase --skill tdd-patterns-rob-broadley
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd-patterns
Source: https://github.com/rob-broadley/ai-airbase/tree/main/cadre/skills/tdd-patterns
Command: npx skills add https://github.com/rob-broadley/ai-airbase --skill tdd-patterns-rob-broadley

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It solves the difficulty of designing and validating code changes safely by providing established TDD and ATDD patterns that keep implementations honest from the outermost behavior to the smallest units.

Core Features & Use Cases

  • Walking skeleton: Start with the thinnest production slice that exercises the full stack end-to-end to prove the pipeline before adding real logic.
  • Outside-in vs inside-out: Choose a TDD school that matches your knowledge of the interface and your need to drive design from acceptance boundaries or from the core domain model.
  • Double-loop TDD: Coordinate an acceptance-level loop with a faster unit-level loop so user value is preserved while design details are driven iteratively.
  • Test double selection: Pick the simplest double (dummy, stub, spy, mock, fake) to reduce brittleness and over-mocking risk.
  • Contract testing, property-based tests, approval tests, and characterisation tests: Apply specialized testing styles for service contracts, invariant-driven logic, snapshot/approval of complex outputs, and safety nets for legacy behavior.

Quick Start

Ask for a TDD plan for a new story that includes an end-to-end walking skeleton, a chosen test-double strategy, and the sequence of acceptance and unit tests to drive the first implementation step.

Frequently Asked Questions about tdd-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I choose the right test double for my TDD workflow?

Choosing the right test double involves picking the simplest option—dummy, stub, spy, mock, or fake—to reduce brittleness and over-mocking risk. Selecting minimal doubles keeps your unit tests focused and resilient to changes in neighboring components.

What's the best way to start TDD on a new non-trivial story?

The best way to start TDD on a non-trivial story is building a walking skeleton: the thinnest end-to-end production slice that proves your pipeline works. This establishes a safe foundation before you iteratively add real domain logic.

How does double-loop TDD coordinate acceptance and unit tests?

Double-loop TDD coordinates an outer acceptance-level loop with a faster inner unit-level loop. This sequencing preserves user value at the boundary while iteratively driving low-level design details until the acceptance criteria are fully satisfied.

When should I use property-based tests instead of standard example tests?

Use property-based tests when validating invariant-driven logic where traditional example-based tests miss edge cases. This testing style automatically generates diverse inputs to verify mathematical properties or data contracts that must hold universally.

How do I safely add tests to legacy code without changing behavior?

Safely modify legacy code by writing characterization tests and approval tests to capture existing behavior as a safety net. These specialized test styles snapshot current complex outputs, allowing you to refactor with confidence without altering functionality.

Should I use outside-in or inside-out TDD for my current feature?

Use outside-in TDD when you know the interface and want to drive design from acceptance boundaries. Choose inside-out TDD when you need to build up from the core domain model before addressing outer behavior layers.