tdd

Guide test-driven development cycles with public-interface tests.

Updated May 7, 2026
One-click install
npx skills add https://github.com/hgxszhj/mattpocock_skills --skill tdd-hgxszhj
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd
Source: https://github.com/hgxszhj/mattpocock_skills/tree/main/skills/engineering/tdd
Command: npx skills add https://github.com/hgxszhj/mattpocock_skills --skill tdd-hgxszhj

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Tests often couple to implementation, making refactors painful; TDD emphasizes validating behavior through public interfaces so tests remain robust to internal changes.

Core Features & Use Cases

  • Vertical slicing via tracer bullets: write a single failing test for one behavior, then implement just enough code to pass.
  • Integration-style tests that exercise real code paths through public APIs.
  • Workflow disciplined cycles: plan, test, implement, and refactor with fast feedback.

Quick Start

Begin with a tracer bullet: write one failing test for the desired behavior, then implement only enough code to pass it.

Frequently Asked Questions about tdd

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

FAQPage Schema
How do I write tests that don't break during refactoring?

To prevent tests from breaking during refactoring, validate behavior through public interfaces rather than coupling to internal implementation details. This test-driven development approach ensures your tests remain robust when internal code structures change.

What is the tracer bullet workflow in test-driven development?

The tracer bullet workflow in test-driven development involves writing a single failing test for one behavior, then implementing just enough code to pass it. This vertical slicing method builds features incrementally through disciplined red-green-refactor cycles.

How do I start test-driven development for a new feature?

To start test-driven development for a new feature, begin with a tracer bullet: write one failing test for the desired behavior, then implement only enough code to pass it. Follow this with iterative refinement and disciplined refactoring.

Why use integration tests for test-driven development instead of unit tests?

Integration tests are used in test-driven development because they exercise real code paths through public APIs, ensuring software behaves correctly end-to-end. This approach validates actual behavior rather than testing isolated implementation details.

Can I use test-driven development for fixing bugs?

Yes, test-driven development can be applied to bug fixes across projects. You write a failing test that reproduces the bug, implement the fix to make it pass, and then refactor the code while maintaining fast incremental feedback.

When should I not use test-driven development?

Test-driven development may not suit contexts where fast incremental feedback is impossible or where public interfaces are unstable. The approach requires disciplined cycles of planning, testing, implementing, and refactoring to be effective.