tdd

Guide test-first development with behavior-focused public-interface tests.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you build features and fix bugs test first, so you can verify behavior early and avoid brittle tests tied to implementation details.

Core Features & Use Cases

  • Behavior-Focused Testing: Write tests against public interfaces so they describe what the system does, not how it is built.
  • Red-Green-Refactor Workflow: Move one behavior at a time from a failing test to the smallest passing implementation, then improve the design safely.
  • Mocking at Boundaries: Mock only external systems such as APIs, databases, time, randomness, or the file system when necessary.
  • Use Case: Use this Skill when adding a checkout flow, fixing a bug with confidence, or creating integration tests that survive refactors.

Quick Start

Use this skill to choose one behavior to test first, write the smallest failing test, and iterate red-green-refactor until the feature is complete.

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 survive refactoring without breaking on internal changes?

Behavior-focused tests validate public interface outputs rather than internal implementation details, ensuring they survive refactoring. By asserting observable system behavior through public APIs, tests remain valid even when internal code structures change during refactoring.

What is the red-green-refactor workflow in test-driven development?

The red-green-refactor workflow involves writing a failing test first, implementing the smallest code to make it pass, then safely improving the design. This iterative process moves one behavior at a time from failing test to minimal passing implementation to clean refactored code.

When should I use mocking in integration testing?

Mocking should be applied only at system boundaries such as external APIs, databases, time, randomness, or the file system. Boundary mocking isolates external dependencies during integration testing while keeping the core business logic tested against real interactions.

How do I fix a bug using test-first development?

Bug fixing with test-first development starts by writing a failing test that reproduces the specific bug behavior. You then implement the smallest code change to make the test pass, verifying the fix works early while ensuring the behavior remains correct through observable assertions.

Does test-first development require specific testing frameworks or dependencies?

Test-first development requires no specific testing frameworks or external dependencies. It applies behavior-focused, public-interface testing principles across any software project, needing only minimal implementations and observable assertions to guide the red-green-refactor workflow.

What is the best way to add a new feature using test-driven development?

Adding a feature with test-driven development starts by choosing one behavior to test first, writing the smallest failing test, and iterating red-green-refactor until complete. This tracer-bullet approach verifies behavior early and builds confidence through minimal, observable passing implementations.