tdd

Apply the red-green-refactor loop to develop features through public interfaces.

1|Updated Apr 14, 2025
One-click install
npx skills add https://github.com/meteoricprovider/cursor-installer --skill tdd-meteoricprovider
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd
Source: https://github.com/meteoricprovider/cursor-installer/tree/main/.claude/skills/tdd
Command: npx skills add https://github.com/meteoricprovider/cursor-installer --skill tdd-meteoricprovider

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Tests should verify behavior through public interfaces, not implementation details, enabling safe refactors and clearer specifications.

Core Features & Use Cases

  • Encourages end-to-end, integration-focused tests that validate observable behavior
  • Promotes vertical slicing: implement one test, one feature at a time to guide design
  • Emphasizes dependency injection, mockability, and clean interfaces to improve testability

Quick Start

Write one targeted integration test that captures the desired behavior, then implement the minimal code to make it pass.

Frequently Asked Questions about tdd

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

FAQPage Schema
What is test-driven development and how does the red-green-refactor loop work?

Test-driven development uses the red-green-refactor loop to drive feature implementation safely. You write a failing integration test, implement the minimal code to make it pass, and then refactor while ensuring observable behavior through public interfaces remains unchanged.

How do I write integration tests that validate behavior without testing implementation details?

To write integration tests that validate behavior without testing implementation details, focus on exercising public interfaces and observable outputs. Discourage tests that assert private state or internal module interactions, ensuring safe refactoring and clearer specifications.

Does test-driven development work for refactoring existing code and fixing bugs?

Yes, test-driven development works for refactoring existing code and fixing bugs. Writing targeted integration tests first captures the desired behavior, enabling safe refactors and iterative design while maintaining well-tested, maintainable software projects.

Why does dependency injection matter for testability in software testing?

Dependency injection matters for testability in software testing because it promotes mockability and clean interfaces. Injecting dependencies allows you to isolate components during integration testing, ensuring tests validate behavior through public interfaces without coupling to internal implementations.

What's the best way to start test-driven development for a new feature addition?

The best way to start test-driven development for a new feature addition is to implement one targeted integration test capturing the desired behavior. Apply vertical slicing to guide design, then write the minimal code required to make that single test pass.

When should I not use test-driven development for software refactoring?

You should not use test-driven development for software refactoring when the existing code lacks clear public interfaces or cannot support dependency injection. Without mockability and observable behavior boundaries, integration tests cannot effectively guide iterative design or ensure safe refactors.