test-driven-development

Guides writing failing tests before implementation using the red-green-refactor cycle.

4|Updated Jun 19, 2026
One-click install
npx skills add https://github.com/douglance/sdlc-plugin --skill test-driven-development-douglance
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/douglance/sdlc-plugin/tree/main/.rulesync/skills/test-driven-development
Command: npx skills add https://github.com/douglance/sdlc-plugin --skill test-driven-development-douglance

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Code changes and bug fixes often ship without tests that actually protect the behavior, leading to regressions and untrustworthy test suites. This Skill enforces a disciplined test-first workflow so every behavior change is defined and guarded by a failing test before implementation begins. ## Core Features & Use Cases - Red-Green-Refactor Cycle: Write a failing test that reaches its assertion (strong RED), implement the minimal code to pass (GREEN), then clean up while tests stay green. - Regression Tests for Bugs: Reproduce any reported bug with a failing test before attempting a fix, proving both the defect and the fix. - Test Design Guidance: Apply the test pyramid, test size classification (small/medium/large), specification-based and structure-based case selection, test oracles, and anti-pattern avoidance. - Use Case: A bug report says completing a task does not set its timestamp. Write a failing test asserting completedAt is a Date, confirm it fails, implement the fix, and watch the test pass with no regressions. ## Quick Start Ask the AI to implement a new feature or fix a bug using test-driven development, starting with a failing test that reproduces the expected behavior.

Frequently Asked Questions about test-driven-development

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

FAQPage Schema
How do I practice test-driven development on a bug fix?▼

Write a test that reproduces the bug first and confirm it fails, proving the defect exists. Then implement the fix, watch the test pass, and run the full suite to confirm no regressions.

What is the red-green-refactor cycle in TDD?▼

RED means writing a failing test whose assertion runs and fails for the expected reason. GREEN means writing the minimum code to pass it. REFACTOR means cleaning up the implementation while tests stay green.

When should I not use test-driven development?▼

Skip TDD for pure configuration changes, documentation updates, or static content changes that have no behavioral impact. TDD applies whenever a change could alter or break existing behavior.

Should tests use mocks or real implementations?▼

Prefer real implementations first, then fakes, stubs, and finally mocks. Mock only at boundaries where real dependencies are slow, non-deterministic, or have uncontrollable side effects like external APIs or email sending.

Why do my tests pass but production still breaks?▼

Over-mocking and testing implementation details cause tests to verify call sequences instead of real behavior. Assert on observable state and outputs, and use mutation checks to confirm tests can actually fail.