domains / families / software-engineering / tdd-guide

tdd-guide

combined

Test-driven development skill for writing unit tests, generating test fixtures and mocks, analyzing coverage gaps, and guiding red-green-refactor workflows across Jest, Pytest, JUnit, Vitest, and Mocha. Use when the user asks to write tests, improve test coverage, practice TDD, generate mocks or stubs, or mentions testing frameworks like Jest, pytest, or JUnit. Handles test generation from source code, coverage report parsing (LCOV/JSON/XML), quality scoring, and framework conversion for TypeScript, JavaScript, Python, and Java projects. Test-first development route for TDD, writing failing tests first, RED -> GREEN -> REFACTOR, and behavior-changing feature/bug/refactor work. Do not use for already-failing test root-cause debugging, test-report packaging, or final completion evidence.

When not to use

Skill page

Conflict

The two copies overlap on the RED -> GREEN -> REFACTOR cycle and an 80% coverage target, but each contains material steps the other lacks. The first copy is a routing and discipline guide (no production code before a failing test, minimum test set, required edge cases, and explicit routing boundaries to other skills). The second copy is a tooling and generation guide (specific Python scripts for test generation, coverage analysis, and TDD phase validation, framework-specific examples, and input/limitation constraints). Crowning one would hide the other's real alternative approach.