tdd

Implement test-driven development with a red-green-refactor cycle.

Updated May 16, 2026
One-click install
npx skills add https://github.com/ckyeon/claude-code-settings --skill tdd-ckyeon
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd
Source: https://github.com/ckyeon/claude-code-settings/tree/main/user/shared/skills/tdd
Command: npx skills add https://github.com/ckyeon/claude-code-settings --skill tdd-ckyeon

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill helps developers to apply test-driven development practices, ensuring high code quality and maintainability.

Core Features & Use Cases

  • Test-Driven Development Philosophy: Provides guidance on writing good tests and avoiding common pitfalls.
  • Anti-Patterns: Warns against 'horizontal slicing' and other ineffective testing approaches.
  • Workflow: Outlines the TDD workflow including planning, tracer bullets, and incremental loop.
  • Checklist: Offers a checklist for each cycle to ensure effective test coverage.
  • Deep Modules: Discusses the design principle of small interfaces with deep implementations.
  • Interface Design: Provides best practices for designing interfaces that are easy to test.
  • Mocking Guidelines: Explains when and how to use mocks for external dependencies.
  • Refactoring: Suggests refactoring candidates after the TDD cycle.

Quick Start

Start the TDD workflow by first confirming the required interface changes and behaviors to test with the user. Then, write a single test that confirms one behavior about the system, ensuring it fails (RED), and then write minimal code to pass the test (GREEN).

Frequently Asked Questions about tdd

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

FAQPage Schema
What is the red-green-refactor loop in test-driven development?

The red-green-refactor loop in test-driven development involves writing a failing test for a specific behavior, implementing minimal code to pass the test, and then refactoring the code to improve design and maintainability while ensuring tests stay green.

How do I start writing tests before implementation using TDD?

To start writing tests before implementation, first confirm the required interface changes and behaviors. Write a single test that confirms one behavior, ensure it fails, write minimal code to pass the test, and incrementally repeat this cycle for comprehensive test coverage.

When should I use mocks for external dependencies in software testing?

You should use mocks for external dependencies in software testing when isolating the system under test from external systems. Proper mocking guidelines ensure tests remain deterministic and focus strictly on the module's internal behavior rather than external integration points.

How do I avoid horizontal slicing and other testing anti-patterns?

Avoid horizontal slicing and testing anti-patterns by following strict test-driven development workflows that prioritize incremental vertical slices, deep module design with small interfaces, and behavior-driven development principles to ensure effective test coverage.

How do I design interfaces that are easy to test and maintain?

Design interfaces that are easy to test by applying the deep modules principle, which advocates for small interfaces with deep implementations. This approach minimizes the surface area requiring testing while encapsulating complex behavior behind simple contracts.

What are the common refactoring candidates after completing a TDD cycle?

Common refactoring candidates after a TDD cycle include simplifying complex implementations, deepening module interfaces, and removing code duplication. The TDD process suggests evaluating these candidates once the green phase is reached to ensure high code quality.