Properties of Unit Tests
summary
Clear, practical checklist of what makes unit tests useful: concrete properties (correctness, isolation, readability), design consequences (dependency injection, stronger domain types), and tool/CI realities (gtest/catch2 behaviors, shuffling tests, fast local feedback versus 40m–15h CI runs). Includes numbers and targets—20 second cycles, 1:1 test-to-production ratio, typical test-case length ~10 lines—and shows when to prefer unit, integration, or infra tests and how to structure tests so failures point to the real bug.
AI-written summary · about
chapters (24)
- 0:00Introduction
- 1:07Defining unit tests
- 3:52The testing pyramid
- 6:24Use cases for unit tests
- 11:05Tests as documentation
- 14:06General test guidelines
- 15:06Ensuring test correctness
- 18:09Black box vs gray box
- 20:25Code coverage goals
- 22:19Strong typing for testing
- 24:07Readability and design
- 26:18Single responsibility tests
- 29:02Test usability check
- 30:41Organizing test order
- 31:23Discoverability and structure
- 33:01Speed and feedback loops
- 35:59Decoupling slow code
- 39:37Simplicity and yagni
- 40:42Independence and selection
- 43:54Determinism and threads
- 46:49Dependency injection
- 49:46Conclusion
- 50:29Q&A
- 1:02:43Wrap up








