test-driven-development

Enforce red-green-refactor workflows with failing tests before production code.

Updated Mar 31, 2026
One-click install
npx skills add https://github.com/DFly7/iOS-FastAPI-Supabase-AI --skill test-driven-development-dfly7
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/DFly7/iOS-FastAPI-Supabase-AI/tree/main/.agents/skills/test-driven-development
Command: npx skills add https://github.com/DFly7/iOS-FastAPI-Supabase-AI --skill test-driven-development-dfly7

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Test-driven development prevents untested production code, reduces regressions, and forces clear, behavior-focused design by ensuring every change is covered by a failing test before implementation.

Core Features & Use Cases

  • Red-Green-Refactor workflow: Write a minimal failing test, implement the simplest code to pass, then refactor while keeping tests green.
  • Verification gates: Mandates watching tests fail for the expected reason, confirming tests validate behavior not implementation.
  • Anti-pattern avoidance & quality checks: Guidance for avoiding mock-heavy tests, test-only production APIs, and incomplete mocks, plus a verification checklist for completion.
  • Common uses: New feature development, bug fixes, refactors, and behavior changes where deterministic, repeatable validation is required.

Quick Start

Write one minimal failing test that demonstrates desired behavior, run the test suite to confirm the failure, then implement the smallest change needed to make the test pass and keep all tests 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 workflow operate?

Test-driven development enforces writing a minimal failing test before production code. The red-green-refactor workflow involves writing a failing test, implementing the smallest code change to pass it, then refactoring while keeping tests green.

How do I write unit tests for bug fixes and feature development using TDD?

To write unit tests for bug fixes and features using TDD, write one minimal failing test demonstrating desired behavior, run the suite to confirm the expected failure, implement minimal code to pass, and maintain green tests during refactoring.

Why do my unit tests fail to validate behavior instead of just testing implementation details?

Unit tests fail to validate behavior when they are mock-heavy or use test-only production APIs. TDD mandates watching tests fail for the expected reason to ensure they validate deterministic behavior rather than implementation details.

What are common test-driven development anti-patterns I should avoid during refactoring?

Common test-driven development anti-patterns to avoid during refactoring include mock-heavy tests, test-only production APIs, and incomplete mocks. Avoiding these ensures repeatable validation and maintains green tests through behavior changes.

When should I not use test-driven development for behavior changes?

You should not use test-driven development for behavior changes requiring non-deterministic validation. TDD applies strictly to features, bug fixes, and refactors where deterministic, repeatable unit and integration tests validate APIs and edge cases.

Does test-driven development work without external testing dependencies or frameworks?

Test-driven development works without external dependencies by enforcing behavior-driven development through a verification checklist. It requires only writing failing tests, verifying failures, and implementing minimal code to pass.