tdd

Guide test-driven development with red-green-refactor loops and integration tests.

Updated May 26, 2026
One-click install
npx skills add https://github.com/anukkrit149/anukkrit-skills --skill tdd-anukkrit149
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd
Source: https://github.com/anukkrit149/anukkrit-skills/tree/main/cloud/skills/tdd
Command: npx skills add https://github.com/anukkrit149/anukkrit-skills --skill tdd-anukkrit149

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

It helps you develop software more reliably by using test-driven development, so behavior is validated through integration-style tests rather than fragile implementation details.

Core Features & Use Cases

  • Red-Green-Refactor loop: Guides you to write a failing test, implement the minimal code to pass, then refine design without breaking tests.
  • Behavior-first testing: Emphasizes tests that verify public interfaces and observable outcomes, making them resilient to refactors.
  • Tracer-bullet workflow: Encourages vertical slicing (one test at a time) to reduce “horizontal slicing” anti-patterns and avoid speculative test coverage.
  • Mocking boundaries: Teaches when to mock (system boundaries like external APIs, databases, time/randomness, filesystem) and when not to.

Quick Start

Use this skill when you’re fixing a bug or building a feature and want to ensure the change is verified by an end-to-end integration-style test that would still pass after refactoring.

Frequently Asked Questions about tdd

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

FAQPage Schema
How do I start test-driven development for a new software feature?

Test-driven development uses the red-green-refactor loop: write a failing test for desired behavior, implement minimal code to pass it, then refactor safely. This replaces speculative horizontal planning with vertical tracer bullets for reliable software changes.

How do I write integration tests that survive refactoring?

Write integration tests that survive refactoring by focusing assertions on public interfaces and observable outcomes rather than internal implementation details. Behavior-first testing validates what the system does, maintaining refactor-safety.

When should I use mocking in integration testing?

Use mocking in integration testing strictly at system boundaries like external APIs, databases, time, randomness, and the filesystem. Avoid mocking internal components to ensure tests verify actual behavior and remain resilient to design changes.

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

The red-green-refactor loop in test-driven development is an iterative cycle: write a failing test (red), implement minimal code to pass (green), then refine design without breaking tests (refactor). It builds features incrementally via vertical slicing.

Does test-driven development work for fixing bugs?

Test-driven development works for fixing bugs by first writing a behavior-verifying integration test that reproduces the issue. Once the test passes after your fix, it serves as a regression safeguard while maintaining refactor-safety.