test-driven-development

Guide test-first software changes through a Red-Green-Refactor loop.

Updated Apr 29, 2026
One-click install
npx skills add https://github.com/pgm1980/stryker-netx --skill test-driven-development-pgm1980
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/pgm1980/stryker-netx/tree/main/.claude/skills/test-driven-development
Command: npx skills add https://github.com/pgm1980/stryker-netx --skill test-driven-development-pgm1980

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

It prevents shipping unverified behavior by enforcing a strict test-first workflow so every change starts from a failing test that proves what must work.

Core Features & Use Cases

  • Red-Green-Refactor loop: reliably drive development by watching a test fail, implementing the smallest fix, then cleaning up without changing behavior.
  • Verification discipline: explicitly confirm the test fails for the right reason (missing feature) and passes with a clean signal (no extra errors or warnings).
  • Anti-pattern guardrails: avoid testing mock existence, adding test-only methods to production code, and mocking without understanding required side effects.

Quick Start

Use this skill when you are implementing a feature or fixing a bug by first writing a single focused failing test, then writing the minimal production code to make it pass, and finally refactoring while keeping the test green.

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 loop work?

Test-driven development is a workflow where you write a failing test, implement the minimal code to make it pass, then refactor without changing behavior. The Red-Green-Refactor loop enforces this cycle to build features with verified passing behavior and regression safety.

How do I start writing unit tests before implementing a new feature?

Start writing unit tests by creating a single focused failing test that proves what must work, then write the minimal production code to pass it. Verify the test fails for the right reason, passes with a clean signal, and refactor while keeping the test green.

Why do my test-driven development tests pass but still produce incorrect behavior?

Test-driven development requires verification discipline: explicitly confirm tests fail for missing features and pass without extra errors or warnings. Without verifying failure reasons and clean signals, tests may pass while masking unverified behavior or incorrect side effects.

When should I avoid mocking in unit testing and test-driven development?

Avoid mocking in unit testing when you do not understand required side effects, or when testing mock existence rather than behavior. Test-driven development guardrails prevent mock-focused development and adding test-only methods to production code to ensure meaningful test coverage.

Does test-driven development work for bug fixes and refactoring existing code?

Test-driven development applies to bug fixes and refactoring where correctness and regression safety matter. You start from a failing test proving the required fix, implement the smallest change, then refactor while keeping the test green to maintain verified passing behavior.