tdd

Guide test-driven development through the red-green-refactor loop.

Updated May 25, 2026
One-click install
npx skills add https://github.com/AcendWay/ai-skills-library --skill tdd-acendway
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd
Source: https://github.com/AcendWay/ai-skills-library/tree/main/skill-folders/tdd
Command: npx skills add https://github.com/AcendWay/ai-skills-library --skill tdd-acendway

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

TDD helps you build or fix software with confidence by forcing tests to validate real, user-facing behavior instead of brittle implementation details.

Core Features & Use Cases

  • Vertical-slice testing: Use one test at a time (red → green → refactor) so each new capability is proven end-to-end.
  • Integration-style verification: Exercise the public interface and real code paths, producing tests that survive refactors.
  • Behavior-first planning: Prioritize which behaviors matter most, then design interfaces that make testing natural.

Quick Start

Ask the AI to design a red-green-refactor TDD plan for your next feature or bugfix, focusing on the public interface behaviors you want to prove first.

Frequently Asked Questions about tdd

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

FAQPage Schema
How does red-green-refactor TDD work for building new features?

Red-green-refactor TDD works by writing a failing test for a desired behavior, implementing the minimum code to pass it, and then refactoring safely. It forces tests to validate real public interface behavior instead of brittle implementation details.

What's the best way to write integration tests that survive refactoring?

The best way to write integration tests that survive refactoring is to exercise the public interface and real code paths. This behavior-first approach ensures tests verify vertical-slice functionality end-to-end without breaking during implementation changes.

How do I plan test design for a new feature using TDD?

To plan test design for a new feature using TDD, prioritize which behaviors matter most and design public interfaces that make testing natural. This behavior-first planning guides the red-green-refactor loop to produce reliable, tracer-bullet tests.

Can I use TDD for fixing bugs with integration-style verification?

Yes, you can use TDD for fixing bugs with integration-style verification. The red-green-refactor loop applies to bugfixes by writing a failing test that reproduces the bug, implementing the fix to reach green, and refactoring without breaking existing tests.

Why do my tests break when refactoring code?

Tests break when refactoring code because they likely validate brittle implementation details instead of real user-facing behavior. TDD solves this by using integration-style verification that exercises the public interface, producing tests that survive refactors.

When should I not use test-driven development for a task?

You should not use test-driven development for tasks lacking a clear public interface or behavior to verify. TDD requires planning interface behaviors and writing tracer-bullet tests, making it suited for features and bugfixes needing integration-style verification rather than pure structural changes.