test-driven-development

Guide the red-green-refactor loop with failing tests before implementation.

Updated Mar 17, 2017
One-click install
npx skills add https://github.com/dfmonaco/dotfiles --skill test-driven-development-dfmonaco
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/dfmonaco/dotfiles/tree/main/agents/.agents/skills/test-driven-development
Command: npx skills add https://github.com/dfmonaco/dotfiles --skill test-driven-development-dfmonaco

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

TDD reduces debugging time and yields safer, better-designed software by forcing a failing test before implementation and guiding incremental development.

Core Features & Use Cases

  • Write the failing test first and implement minimal production code to pass, then repeat for each behavior.
  • Refactor only while the test suite remains green, ensuring regressions are caught early.
  • Use this skill for new features, bug fixes, and behavioral changes to maintain design integrity and documentation.

Quick Start

Write a failing test for the desired behavior, implement the simplest code to pass, then refactor while keeping all tests green.

Frequently Asked Questions about test-driven-development

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?

To start test-driven development, write a failing test for the desired behavior, implement the simplest minimal production code to pass it, then refactor while keeping all tests green. This enforces safe, incremental delivery for new features.

What is the red-green-refactor loop in TDD?

The red-green-refactor loop in TDD is the core practice of writing a failing test, implementing minimal production code to pass it, and refactoring while the test suite remains green to catch regressions early.

Can I use test-first development for bug fixes and refactoring?

Yes, test-first development applies across bug fixes and refactoring to maintain design integrity. You write a failing test for the behavioral change, implement the fix, and refactor only while the test suite remains green to ensure safety.

Why does writing tests first improve software quality?

Writing tests first improves software quality by reducing debugging time and yielding safer, better-designed software. It forces a failing test before implementation and guides incremental development to catch regressions early.

What's the best way to ensure safe incremental delivery with TDD?

The best way to ensure safe incremental delivery with TDD is to enforce the red-green-refactor loop with minimal production code and strict verification, catching regressions early and maintaining design documentation.

When do I need test-driven development for behavioral changes?

You need test-driven development for behavioral changes when you want to guide the full TDD cycle and maintain design integrity. It forces a failing test before implementation to ensure safe, incremental delivery.