test-driven-development

Guide feature development and bug fixes through a RED-GREEN-REFACTOR workflow.

41|4|Updated Jan 28, 2026
One-click install
npx skills add https://github.com/etr/groundwork --skill test-driven-development-etr
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/etr/groundwork/tree/main/skills/test-driven-development
Command: npx skills add https://github.com/etr/groundwork --skill test-driven-development-etr

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Test-driven development (TDD) makes code more reliable by requiring tests before writing implementation, guiding design and reducing regressions across changes.

Core Features & Use Cases

  • Enforces a RED-GREEN-REFACTOR cycle to ensure incremental delivery and maintainable design.
  • Guides feature development and bug fixes by starting from a failing test and iterating until all tests pass.
  • Improves confidence and documentation of intended behavior for future refactors and collaboration.

Quick Start

Write a failing test first, implement the minimal code to pass, then refactor.

Frequently Asked Questions about test-driven-development

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

FAQPage Schema
What is test-driven development and how does the red-green-refactor cycle work?

Test-driven development (TDD) is a software engineering process where you write a failing test, implement minimal code to pass it, and then refactor. This red-green-refactor cycle ensures tests drive implementation and reduces regressions across changes.

How do I fix bugs using test-driven development?

To fix bugs using test-driven development, start by writing a failing test that reproduces the specific bug. Then, implement the minimal code required to make the test pass, ensuring the bug is resolved and preventing future regressions.

Can I use test-driven development for feature development across different programming languages?

Yes, test-driven development applies to feature development and bug fixes across languages. It guides developers through writing failing tests and iterating until all tests pass, promoting maintainable, well-tested software regardless of language.

What's the best way to start writing unit tests for reliable code?

The best way to start writing unit tests for reliable code is to write a failing test first. Implement the minimal code to make it pass, then refactor the implementation while ensuring the test continues to pass.

Why should I use test-driven development instead of writing tests after implementation?

Test-driven development makes code more reliable by requiring tests before writing implementation. This approach guides software design, improves confidence in future refactors, and provides clear documentation of intended behavior compared to writing tests afterward.

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

Test-driven development requires strict adherence to the red-green-refactor workflow, which may not suit exploratory prototyping where design is highly volatile. If immediate delivery of untested code is prioritized over long-term maintainability and regression reduction, TDD may not fit.