tdd

Define a test-driven development workflow validating behavior through public interfaces.

Updated Dec 11, 2024
One-click install
npx skills add https://github.com/huaxel/dotfiles --skill tdd-huaxel
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd
Source: https://github.com/huaxel/dotfiles/tree/main/skills/tdd
Command: npx skills add https://github.com/huaxel/dotfiles --skill tdd-huaxel

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Test-driven development reduces risk by ensuring behavior is verified through public interfaces, not implementation details.

Core Features & Use Cases

  • Emphasizes end-to-end, integration-style validation over internal mocks.
  • Promotes vertical slices and tracer bullets to guide incremental implementation.
  • Encourages disciplined refactoring with robust feedback loops to preserve behavior.

Quick Start

Start by writing a single end-to-end test that exercises a public interface, then implement just enough code to pass it.

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 workflow in test-driven development?

Test-driven development validates software behavior through public interfaces rather than internal implementation details. It emphasizes writing failing tests first, implementing minimal code to pass, and then refactoring safely to preserve behavior.

How do I start applying test-driven development to a new feature?

Start applying test-driven development by writing a single end-to-end test that exercises a public interface, then implement just enough code to pass it using vertical slices for incremental learning.

Why does test-driven development prefer end-to-end validation over internal mocks?

End-to-end integration-style validation verifies behavior through public interfaces rather than internal implementation details. This approach reduces risk by ensuring the software functions correctly without relying on internal mocks that may hide integration failures.

Does test-driven development work for both feature development and bug fixes?

Yes, test-driven development applies to both feature development and bug fixes across software projects, providing explicit test-first planning and safe refactoring guardrails for reliable delivery.

What are vertical slices in test-driven development?

Vertical slices in test-driven development are incremental implementation guides, often called tracer bullets, that ensure end-to-end validation is applied progressively across the software project.

When should I refactor code during the test-driven development cycle?

You should refactor code during the test-driven development cycle after your tests pass, using the robust feedback loop to preserve behavior while improving code structure safely.