tdd-mastery

Enforce Red-Green-Refactor TDD cycles with test double taxonomy and mutation testing.

5|1|Updated Jun 17, 2026
One-click install
npx skills add https://github.com/roanbrasil/engineer-grade-agent-skills --skill tdd-mastery-roanbrasil
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd-mastery
Source: https://github.com/roanbrasil/engineer-grade-agent-skills/tree/main/skills/tdd-mastery
Command: npx skills add https://github.com/roanbrasil/engineer-grade-agent-skills --skill tdd-mastery-roanbrasil

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Inconsistent or poorly implemented Test-Driven Development leads to brittle tests, false positives, and wasted development time, reducing the value of testing as a design and safety tool. This Skill provides standardized, language-agnostic TDD practices to help developers write effective tests that drive better design and catch real bugs.

Core Features & Use Cases

  • Strict Red-Green-Refactor Guidance: Clear rules for each phase of the TDD cycle to avoid common pitfalls like premature generalization or testing implementation details.
  • Precise Test Double Taxonomy: Clear definitions and usage rules for dummies, stubs, spies, mocks, and fakes to prevent over-mocking and keep tests resilient to refactoring.
  • Testing Pyramid & Quality Checks: Best practices for unit, integration, and E2E test distribution, plus mutation testing guidance and test smell detection to ensure test suites are fast, reliable, and meaningful.
  • TDD School Selection: Practical guidance for choosing between Outside-In (London) and Inside-Out (Detroit) TDD based on project context, plus proven patterns for bug fix regression testing.
  • Use Case: A developer building a new payment processing feature can use this Skill to write a failing test first, select the correct test double for the payment gateway collaborator, and validate their test suite catches boundary errors via mutation testing.

Quick Start

Use the tdd-mastery skill to write a failing test for your new user authentication feature before writing any production code.

Frequently Asked Questions about tdd-mastery

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

FAQPage Schema
How do I prevent brittle tests and false positives when practicing test-driven development?

To prevent brittle tests during test-driven development, apply strict Red-Green-Refactor cycle discipline and avoid testing implementation details. This standardized practice keeps your test suite resilient to refactoring and eliminates false positives.

What is the correct way to use test doubles like mocks, stubs, and fakes in unit testing?

Correct test double usage in unit testing requires applying a precise taxonomy for dummies, stubs, spies, mocks, and fakes. Using the correct double type prevents over-mocking and keeps your tests focused on behavior rather than implementation details.

How do I choose between Outside-In and Inside-Out TDD for my software project?

Choosing between Outside-In (London) and Inside-Out (Detroit) TDD depends on your project context. Pragmatic TDD school selection evaluates whether you are building greenfield features or modifying legacy systems to determine the most effective approach.

How do I validate that my unit testing suite catches boundary errors in domain logic?

To validate your unit testing suite catches boundary errors in domain logic, apply mutation testing with an 80% or higher threshold for critical business logic. This process detects test smells and verifies your tests meaningfully catch real bugs.

Can I use test-driven development for bug fix regression testing in a polyglot codebase?

Yes, you can use test-driven development for bug fix regression testing across a polyglot codebase. The practice provides language-agnostic patterns to write failing tests first, ensuring domain logic validation and quality assurance across different technologies.

What is the recommended testing pyramid distribution for integration and end-to-end tests?

The recommended testing pyramid distribution prioritizes a large base of fast unit tests, supported by fewer integration tests and a minimal set of end-to-end tests. This alignment ensures your testing workflow remains fast, reliable, and meaningful across all layers.