tdd

Automate red-green-refactor cycles for test-first feature development.

7|Updated Nov 30, 2019
One-click install
npx skills add https://github.com/dstanberry/dotfiles --skill tdd-dstanberry
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd
Source: https://github.com/dstanberry/dotfiles/tree/main/ai/claude/skills/tdd
Command: npx skills add https://github.com/dstanberry/dotfiles --skill tdd-dstanberry

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Tests verify behavior by specification, enabling safer refactors and earlier bug detection, reducing cost of changes over time.

Core Features & Use Cases

  • Vertical Slices: Encourage focusing on user-facing behavior with minimal implementation coupling.
  • Red-Green-Refactor: Promote fast feedback loops from failing tests to passing code.
  • Plan-Execute-Validate: Guides planning, execution, and validation of features or bug fixes through tests.

Quick Start

Write a failing test for a simple feature, then implement the minimal code to pass.

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 feature?

Test-driven development begins by writing a failing test for a simple feature, then implementing the minimal code required to pass it. This enforces a disciplined red-green-refactor workflow.

Why does test-driven development help with safer refactoring?

Test-driven development verifies behavior by specification, enabling safer refactors and earlier bug detection. Satisfying a test-first workflow reduces the cost of changes over time.

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

The red-green-refactor cycle promotes fast feedback loops by starting with failing tests, writing minimal code to pass them, and then incrementally improving the design.

Can I use test-driven development for bug fixes across diverse projects?

Yes, test-driven development applies to both feature development and bug fixes across diverse projects. It guides planning, execution, and validation through testable public interfaces.

What's the best way to structure tests for vertical slices in software engineering?

Structuring tests for vertical slices encourages focusing on user-facing behavior with minimal implementation coupling. This approach validates functionality through testable public interfaces.

When should I not use test-driven development?

Test-driven development is less suitable for exploratory prototyping where public interfaces are undefined. It requires testable interfaces and a disciplined workflow to validate behavior by specification.