Dev.to
5/12/2026

Why I Prefer Chicago-Style TDD
Short summary
Chicago-style TDD relies on real objects and state assertions, reserving mocks for external boundaries like databases and APIs. Combined with hexagonal architecture, it produces refactor-safe tests that catch real breaks. The core principle: assert on values and observable state, not on internal call patterns.
- •Use real objects for internal domain logic; mock only at system boundaries
- •Tests that assert on state survive refactoring and catch real failures
- •Mocks testing assumptions rather than actual behavior; fakes are a better middle ground
Generated with AI, which can make mistakes.
Is this a good recommendation for you?



