test-driven-development

Implement code with a red-green-refactor cycle and unit, integration, and end-to-end tests.

1|Updated May 12, 2026
One-click install
npx skills add https://github.com/MoxyWolfLLC/moxywolf-plugins --skill test-driven-development-moxywolfllc
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/MoxyWolfLLC/moxywolf-plugins/tree/main/plugins/dev-infrastructure-skills/skills/test-driven-development
Command: npx skills add https://github.com/MoxyWolfLLC/moxywolf-plugins --skill test-driven-development-moxywolfllc

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill helps you design and implement code using test-driven development so you write the smallest failing test first, make it pass with the minimum production change, and then refactor safely.

Core Features & Use Cases

  • Red-Green-Refactor Guidance: Plan your workflow around writing a failing test, implementing the simplest passing code, then refactoring without breaking behavior.
  • Test Quality Principles: Focus on testing observable behavior, using descriptive test names, and applying Arrange-Act-Assert to keep tests clear and reliable.
  • Testing Scale Selection: Choose appropriate test types (unit, integration, or end-to-end) and use mocking judiciously to avoid meaningless tests.

Quick Start

Ask for TDD help to add test coverage for a new behavior by outlining the red-green-refactor steps, proposing an initial failing test, and then describing the simplest implementation to make it pass before refactoring.

Frequently Asked Questions about test-driven-development

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

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

Test-driven development forces a failing test to define behavior before implementation, ensuring reliable code changes through repeatable checks for unit, integration, and end-to-end coverage.

How do I start writing a failing test for a new feature?

To start writing a failing test, outline the red-green-refactor steps, propose an initial failing test for the desired behavior, and then describe the simplest implementation needed to make it pass before refactoring.

When should I use mocking strategies in unit testing?

Use mocking strategies judiciously in unit testing to avoid meaningless tests, ensuring you mock only what is necessary to test observable behavior while maintaining clear Arrange-Act-Assert structure.

How do I choose between unit, integration, and end-to-end testing?

Choose the appropriate testing scale by selecting unit tests for isolated behavior, integration tests for component interaction, and end-to-end tests for full coverage, applying mocking judiciously to maintain test reliability.

What makes a test reliable when practicing test-driven development?

A reliable test-driven development test focuses on observable behavior, uses descriptive test names, and applies a clear Arrange-Act-Assert structure to keep tests clear, reliable, and repeatable.

Can I refactor code while keeping all my tests green?

Yes, you can and should refactor code while keeping all tests green, as the red-green-refactor cycle ensures refactoring happens safely only after the minimum implementation makes the failing test pass.