tdd

Guide test-driven development with integration-style tests through public interfaces.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

It helps you avoid brittle, implementation-coupled tests by guiding you to write integration-style tests that specify observable behavior, then iterate through the red-green-refactor loop until the system works.

Core Features & Use Cases

  • Behavior-first integration testing: Write tests that validate what the system does through public interfaces, not how it does it.
  • Vertical slicing with tracer bullets: Use one test at a time (red → minimal green → refactor) to prevent “horizontal slicing” where test code outpaces real understanding.
  • Refactoring-safe guidance: Keep tests resilient to internal changes so refactors improve structure without causing unnecessary test churn.

Use cases: Building new features, fixing bugs, and adding confidence to refactors in complex codebases where mocks and private-method assertions would create fragile coverage.

Quick Start

Use the tdd skill when you want to fix a bug or add a feature by writing one integration-style behavior test first, then implementing just enough to make it pass, repeating for the next behavior.

Frequently Asked Questions about tdd

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

FAQPage Schema
How do I write integration tests that validate observable behavior without coupling to implementation details?

Use test-driven development to write integration-style tests that verify observable behavior through public interfaces. This approach avoids private-method assertions, ensuring tests specify what the system does rather than how it works internally.

What is the red-green-refactor loop for building features safely?

The red-green-refactor loop involves writing one failing behavior test, implementing minimal code to pass it, then refactoring safely. This vertical slicing with tracer bullets prevents test code from outpacing real understanding of the feature.

Why do my unit tests break when I refactor internal code structure?

Tests break during refactoring when they are coupled to implementation details via mocking or private-method assertions. Writing behavior-first integration tests through public interfaces keeps tests resilient to internal changes and prevents unnecessary test churn.

How do I use mocking boundaries correctly when fixing bugs with TDD?

Set mocking boundaries at public interfaces to verify observable behavior rather than mocking internal calls. This prevents brittle, implementation-coupled assertions and ensures your bug fixing workflow maintains resistance to fragile test coverage.

Can I use test-driven development for both feature building and bug fixing in complex codebases?

Yes, test-driven development fits both feature building and bug fixing workflows. It guides you to write one integration-style behavior test first, implement just enough to pass, then repeat for the next behavior to add confidence in complex codebases.

When should I avoid horizontal slicing during test-driven development?

Avoid horizontal slicing whenever test code outpaces real understanding of the system. Use vertical slicing with tracer bullets instead, writing one test at a time through red-green-refactor iteration to ensure tests reflect actual behavior.