tdd-london-chicago

Select and apply London mock-based or Chicago state-based TDD styles.

6|3|Updated Dec 3, 2025
One-click install
npx skills add https://github.com/pacphi/ampel --skill tdd-london-chicago
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: tdd-london-chicago
Source: https://github.com/pacphi/ampel/tree/main/.claude/skills/tdd-london-chicago
Command: npx skills add https://github.com/pacphi/ampel --skill tdd-london-chicago

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill eliminates testing confusion by clearly distinguishing between London school's interaction verification and Chicago school's state verification.

Core Features & Use Cases

  • London School: Mock dependencies, focus on how objects collaborate.
  • Chicago School: Test observable behavior through public API using real objects.

Quick Start

When implementing TDD: identify code type (domain logic → Chicago, external deps → London).

Quick Start

Write a failing test for "Order calculates total with tax" using Chicago style state verification.

Frequently Asked Questions about tdd-london-chicago

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

FAQPage Schema
What's the difference between London and Chicago school test-driven development?

London school uses mocks to verify how objects interact with dependencies, while Chicago school tests observable behavior through real objects and state verification. Choose London for code with external dependencies, Chicago for domain logic.

How do I start writing tests using the red-green-refactor cycle?

Write a failing test first (red), implement minimal code to pass it (green), then improve the code without breaking tests (refactor). The cycle builds confidence by validating each step before moving forward.

When should I use mocks versus real objects in my tests?

Use mocks in London-style TDD when testing interactions with external dependencies like APIs or databases. Use real objects in Chicago-style TDD to verify domain logic and state changes through your public API.

Can I apply test-driven development during refactoring?

Yes. TDD works during refactoring by keeping tests green while you restructure code. Write tests for current behavior first, then refactor incrementally while verifying tests still pass.

What's the best approach to teach teams test-driven development?

Distinguish between London's interaction verification and Chicago's state verification upfront, assign clear test roles across implementation phases, and practice the red-green-refactor discipline consistently.