tdd

Guides test-driven development through red-green cycles with seam-based test design.

7|1|Updated Jul 17, 2026
One-click install
npx skills add https://github.com/J0Jng/MathModelingAgents --skill tdd-j0jng
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: tdd
Source: https://github.com/J0Jng/MathModelingAgents/tree/main/.claude/skills/engineering/tdd
Command: npx skills add https://github.com/J0Jng/MathModelingAgents --skill tdd-j0jng

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing tests after implementation often produces brittle, implementation-coupled tests that break on every refactor and fail to verify real behavior. This Skill enforces a disciplined red-green TDD loop so tests verify behavior through public interfaces and survive refactors. ## Core Features & Use Cases - Red-Green Loop Discipline: Enforces writing a failing test first, then only enough code to pass it, one vertical slice at a time. - Seam-Based Test Design: Requires agreeing on public interface seams with the user before any test is written, focusing effort on critical paths. - Anti-Pattern Detection: Identifies implementation-coupled, tautological, and horizontally-sliced tests with concrete good/bad examples in tests.md and mocking guidance in mocking.md. - Use Case: When building a checkout feature, ask the assistant to work test-first: it will confirm the seams (cart, payment interface), write one failing behavior test, implement the minimal code to pass, and repeat per slice. ## Quick Start Ask the assistant to build the next feature or fix the bug using test-driven development with the red-green loop.

Frequently Asked Questions about tdd

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

FAQPage Schema
How do I practice test-driven development with the red-green loop?▼

Write one failing test that describes desired behavior through a public interface, then write only enough code to make it pass. Repeat one slice at a time, letting each cycle inform the next test rather than writing all tests upfront.

What is a seam in test-driven development?▼

A seam is the public boundary where you observe behavior without reaching inside the code, such as an interface or public API. Tests live at seams agreed with the user before writing, never against private methods or internal collaborators.

When should I use mocks in unit tests?▼

Mock only at system boundaries such as external APIs, databases, time, randomness, and the file system. Never mock your own classes or internal collaborators, and prefer dependency injection plus SDK-style interfaces to make boundaries easy to mock.

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

Tests break on refactoring when they are coupled to implementation details, such as mocking internal collaborators, testing private methods, or asserting on call counts. Rewrite them to verify observable behavior through public interfaces so they survive internal changes.

What is a tautological test and why is it bad?▼

A tautological test computes its expected value the same way the implementation does, so it passes by construction and can never catch a bug. Expected values must come from an independent source such as a known literal, worked example, or specification.