Limits of testing
summary
Unit testing becomes pointless when design hides logic or forces unrealistic setup: a God controller that calculates totals forces JSON construction and custom deserializers; inline discount strategies create high cyclomatic complexity and a hidden dependency on system time; tests break without a controllable Clock. Fixes shown: move calculation into the domain model and use a DiscountPolicy with injectable Clock.fixed for deterministic tests, and treat glue code with integration tests (embedded DB or Docker) instead of brittle mocked unit tests.
AI-written summary · about
chapters (8)
- 0:00Introduction
- 1:12What are test limits
- 4:11Design and testability
- 5:16God controller example
- 17:53Strategy pattern refactor
- 28:44Layered architecture issues
- 35:57Glue code testing
- 41:15Design limits and tools








