The social lives of unit tests
summary
Asserts that a unit test targets a unit of behavior (the module’s public exports) not a class, and that heavy mocking produces brittle suites and an approximate 3:1 tests-to-code ratio that makes refactoring costly; recommends sociable tests that exercise real dependencies where safe, using fakes not mocks to keep tests fast, and only breaking encapsulation for legacy seams. Claims this approach keeps tests quick, isolated from each other, and trustworthy so refactors succeed without endless mock rewrites.
AI-written summary · about
chapters (9)
- 0:00Introduction to unit test social lives
- 1:03Promise and purpose of unit tests
- 2:48Solitary unit testing explained
- 6:49Problems with heavily mocked tests
- 9:38Unit as unit of behavior
- 12:51Transition to sociable unit tests
- 15:50Redefining unit test definition
- 17:13Solitary vs sociable tests comparison
- 18:39Summary and further resources
