tdd

Apply test-driven development with red-green-refactor cycles for features and bug fixes.

32|5|Updated Oct 6, 2024
One-click install
npx skills add https://github.com/gilesknap/tpi-k3s-ansible --skill tdd-gilesknap
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd
Source: https://github.com/gilesknap/tpi-k3s-ansible/tree/main/.claude/skills/tdd
Command: npx skills add https://github.com/gilesknap/tpi-k3s-ansible --skill tdd-gilesknap

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Adopt a disciplined development approach that reduces regressions by validating behavior through tests before implementing code.

Core Features & Use Cases

  • Red-Green-Refactor loop to guide feature work and bug fixes
  • Emphasizes testing through public interfaces and integration paths
  • Supports vertical-slice planning with incremental design for safer refactors

Quick Start

Begin a red-green-refactor cycle by writing a failing test, implementing the minimal code to pass, then refactoring for quality.

Frequently Asked Questions about tdd

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

FAQPage Schema
How do I apply test-driven development to build new features?

Test-driven development for new features uses the red-green-refactor loop: write a failing test, implement minimal code to pass, then refactor for quality. This validates behavior through tests before implementing code, reducing regressions across your codebase.

Why does refactoring cause regressions in my codebase?

Refactoring causes regressions when behavior is not validated by tests. Adopt test-driven development to establish a red-green-refactor loop, ensuring integration tests verify public interfaces before you safely modify existing code.

What is the best way to write integration tests for vertical slices?

The best way to write integration tests for vertical slices is focusing on public interfaces and integration paths. Test-driven development supports vertical-slice planning with incremental design, enabling safer refactors and faster feature delivery.

Can I use test-driven development for bug fixes as well as feature work?

Yes, you can use test-driven development for bug fixes as well as feature work. The red-green-refactor loop guides both processes by validating expected behavior through failing tests before implementing the minimal code required to fix the issue.

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

Test-driven development may not suit projects lacking clear public interfaces or integration paths. It requires a codebase that supports incremental vertical-slice delivery and safe refactoring, relying on disciplined testing to validate behavior before implementation.