test-driven-development

Turn desired features and bug reports into failing tests before implementation.

2|Updated Feb 16, 2026
One-click install
npx skills add https://github.com/d0whc3r/statsig-browser-extension --skill test-driven-development-d0whc3r
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/d0whc3r/statsig-browser-extension/tree/main/.agents/skills/test-driven-development
Command: npx skills add https://github.com/d0whc3r/statsig-browser-extension --skill test-driven-development-d0whc3r

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It prevents unreliable changes by requiring you to prove behavior with tests before you implement logic, fix bugs, or refactor code.

Core Features & Use Cases

  • Fail-first development (RED/Green/REFACTOR): Write a test that fails, implement the minimal code to pass, then refactor without changing behavior.
  • Prove-It pattern for bug fixes: Reproduce the bug with a dedicated test first, confirm it fails, then implement the fix until the test passes.
  • Test design guidance: Use the test pyramid, state-based assertions, DAMP naming, and isolation to keep tests fast, reliable, and meaningful.
  • Pragmatic testing strategy: Choose unit vs integration vs E2E based on boundaries and user-critical flows, and add browser runtime verification for front-end behavior.

Quick Start

Use the test-driven-development skill to write a failing reproduction test for the behavior you want to change, then implement the smallest code change needed to make that test pass before refactoring.

Frequently Asked Questions about test-driven-development

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

FAQPage Schema
How do I fix a bug using test-driven development?

Test-driven development fixes bugs by reproducing the issue with a failing test first, then implementing the minimal code change needed to make that test pass. This proves the bug exists before you fix it and prevents future regressions.

What is the RED GREEN REFACTOR workflow?

The RED GREEN REFACTOR workflow is a test-driven development cycle where you write a failing test, implement the smallest code change to make it pass, then refactor without altering behavior. This ensures logic remains correct throughout development.

When should I use unit testing versus integration testing?

Unit testing versus integration testing depends on boundaries and user-critical flows. Use unit tests for isolated logic and integration tests for interactions across boundaries, following the test pyramid to keep tests fast, reliable, and meaningful.

How do I prevent regressions when refactoring code?

Prevent regressions during refactoring by relying on existing tests to prove behavior remains unchanged. Test-driven development ensures you refactor only after tests pass, maintaining correctness while improving code structure without introducing new bugs.

Does test-driven development support browser testing for front-end behavior?

Yes, test-driven development supports browser testing for front-end behavior. It includes browser runtime verification to ensure user interfaces function correctly, adding E2E tests for critical flows alongside unit and integration tests.

What are the limitations of test-driven development?

Test-driven development requires writing tests before logic, which can slow initial development. It demands deterministic isolation and state-based assertions to avoid flaky tests, and may not suit exploratory prototyping where requirements are highly unstable.