tdd

Organize code changes around a strict red-green-refactor test-driven workflow.

33|1|Updated Nov 8, 2022
One-click install
npx skills add https://github.com/exosyphon/dotfiles --skill tdd-exosyphon
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd
Source: https://github.com/exosyphon/dotfiles/tree/main/ai-skills/tdd
Command: npx skills add https://github.com/exosyphon/dotfiles --skill tdd-exosyphon

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Enforces a strict red-green-refactor workflow so every production change is motivated by a failing test and minimal, verifiable steps.

Core Features & Use Cases

  • Drives implementation through a failing-test-first approach, guiding small, incremental changes.
  • Keeps production changes tightly scoped and easy to review.
  • Ideal for feature development, bug fixes, and behavioral changes within an existing codebase.

Quick Start

Begin by writing a failing test for the next observable behavior, then implement only the minimal production code to make the test pass and refactor as needed.

Frequently Asked Questions about tdd

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

FAQPage Schema
How do I implement test-driven development for new features?

Test-driven development for features requires organizing work around a strict red-green-refactor workflow, starting with a failing test for the next observable behavior before writing minimal production code to make it pass.

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

The red-green-refactor cycle is a test-driven workflow that begins by writing a failing test, implementing only the minimal production code required to pass that test, and then refactoring the codebase while keeping tests green.

How do I fix bugs using a test-first workflow?

Fixing bugs with a test-first workflow involves writing a failing test that reproduces the specific behavior change or bug, then making minimal production changes to pass the test and verify the fix.

Can I use test-driven development for refactoring an existing codebase?

Yes, test-driven development is ideal for refactoring an existing codebase because it enforces small, incremental, test-driven iterations that keep production changes tightly scoped and verifiable against the project's test harness.

Does test-driven development work for pair programming sessions?

Test-driven development fits pair programming by enforcing a disciplined cycle where one developer writes a failing test and the other drives the minimal production changes, ensuring continuous collaboration and untested code prevention.

When should I avoid a strict test-driven development workflow?

A strict test-driven development workflow may not suit exploratory coding or spikes where behavior is undefined, as it requires a clear observable behavior to test and a maintained failing-test-first cycle before any production changes.