test-driven-development

Guides outside-in test-driven development using red-green-refactor cycles and mock-driven design.

1|Updated May 21, 2026
One-click install
npx skills add https://github.com/vnovakovits/claude-skills --skill test-driven-development-vnovakovits
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: test-driven-development
Source: https://github.com/vnovakovits/claude-skills/tree/main/plugins/engineering-practices/skills/test-driven-development
Command: npx skills add https://github.com/vnovakovits/claude-skills --skill test-driven-development-vnovakovits

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing tests after code misses design feedback, and mocking every collaborator makes suites brittle against refactoring. This Skill provides a disciplined TDD methodology so tests drive the design, stay green through structural changes, and produce no speculative code. ## Core Features & Use Cases - Double-Loop Outside-In TDD: Drive features from a failing acceptance test inward, letting mocks reveal collaborator roles layer by layer (Freeman & Pryce, Mancuso). - Sociable vs Solitary Test Guidance: Choose test boundaries based on anticipated refactoring, mocking at architectural seams like I/O, time, and randomness rather than every class. - Design Feedback Heuristics: Diagnose design problems from test pain (too many mocks, train wrecks, hard-to-name tests) and apply Beck's small-step patterns like Fake It and Triangulate. - Use Case: When building a new endpoint such as POST /reservations, start with a failing acceptance test, mock the service layer from the controller test, then implement each collaborator inward until the acceptance test passes against the real stack. ## Quick Start Ask Claude to build a new feature using outside-in TDD, starting from a failing acceptance test and driving the design inward one unit test at a time.

Frequently Asked Questions about test-driven-development

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

FAQPage Schema
How do I practice outside-in TDD with mocks?▼

Start with a failing acceptance test at the system boundary, then unit-test the outermost object while mocking collaborators it needs. Implement each mocked collaborator inward with its own test loop until the acceptance test passes against real implementations.

What is the difference between sociable and solitary unit tests?▼

Solitary tests isolate one class with every collaborator mocked, while sociable tests use real internal collaborators and mock only at architectural seams like I/O. Sociable tests survive internal refactoring; solitary tests break when class boundaries change.

When should I mock a collaborator in unit tests?▼

Mock collaborators performing I/O, those whose interaction is the behavior under test, unimplemented collaborators in outside-in flow, and slow or non-deterministic dependencies. Never mock value objects, DTOs, pure functions, or third-party libraries directly.

London vs classical TDD which school should I use?▼

London (mockist) TDD tests object interactions and drives design through mocks, suiting outside-in development. Classical (Detroit) TDD tests state with real collaborators and lets design emerge from refactoring. Many practitioners blend both approaches.

Why do my unit tests break every time I refactor?▼

Tests break on refactoring when they mock internal class boundaries or verify implementation details instead of observable behavior. Switch to sociable tests that mock only at architectural seams, so internal restructuring leaves test assertions intact.

What are common TDD pitfalls to avoid?▼

Common pitfalls include writing tests after code, skipping the refactor step, mocking everything, testing implementation details, and tolerating slow suites. Also avoid tests that never fail, since an unverified test may test nothing.