tdd

Enforce test-driven development with red-green-refactor cycles and integration tests.

Updated Mar 24, 2026
One-click install
npx skills add https://github.com/stevenengland/sten-agent-skills --skill tdd-stevenengland
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd
Source: https://github.com/stevenengland/sten-agent-skills/tree/main/skills/tdd
Command: npx skills add https://github.com/stevenengland/sten-agent-skills --skill tdd-stevenengland

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Test-driven development guides teams to build features by specifying tests first, reducing regressions and enabling clearer requirements.

Core Features & Use Cases

  • Tracer Bullet: write a single end-to-end test to validate a user-visible behavior and implement the minimum code to pass.
  • Incremental RED↔GREEN↔REFACTOR: repeat small cycles to steadily extend functionality and improve design.
  • Workflow Guidance: plans, reviews, and refactor checkpoints that keep the public interface stable.

Quick Start

Write a failing test for a simple feature, then implement the minimal code to make it pass.

Frequently Asked Questions about tdd

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

FAQPage Schema
What is test-driven development and how does it reduce software regressions?

Test-driven development (TDD) reduces regressions by enforcing a red-green-refactor cycle where you write failing tests first, implement minimal code to pass, then refactor. This clarifies requirements and ensures early feedback during iterative feature development.

How do I start writing tests for a new feature using TDD?

To start TDD for a feature, use the tracer bullet approach: write a single end-to-end integration test validating a user-visible behavior, implement the minimum code to pass, then incrementally expand functionality through repeated red-green-refactor cycles.

Does TDD work for bug fixes in iterative development cycles?

Yes, TDD suits bug fixes in iterative cycles by specifying a failing test that reproduces the bug, implementing the fix to turn it green, and refactoring safely. This workflow integrates planning and review checkpoints to keep interfaces stable.

What is the best way to maintain a stable public interface while refactoring tested code?

The best way to maintain a stable public interface during refactoring is using TDD workflow checkpoints. These guide incremental red-green-refactor loops, ensuring integration tests pass before and after design improvements without altering external behavior.

When should I write integration tests instead of isolated unit tests in TDD?

Write integration tests in TDD when validating end-to-end user-visible behaviors, such as during the initial tracer bullet phase. This provides early feedback on system interactions before expanding into incremental, isolated specification cycles.

Why does my test suite keep breaking when I refactor my code?

Test suites break during refactoring when public interfaces change or tests lack isolation. TDD mitigates this by enforcing refactor checkpoints after the green phase, ensuring design improvements preserve the specified behavior and keep public interfaces stable.