Properties of Unit Tests
summary
Argues that unit tests must be fast, isolated, and precise: use dependency injection and mocks instead of touching files or databases, separate infrastructure tests, and prefer small deterministic cases over complex test logic. Recommends frameworks like gtest and Catch, using string streams instead of file I/O, and aiming for quick feedback (example: ~10,000 tests running in ~20–30s). Shows migration pain when rewriting iterators that compiled after weeks and broke tests, so keep tests readable and focused.
AI-written summary · about
chapters (9)
- 0:00Unit test properties intro
- 1:10Defining unit tests
- 6:05Unit tests in development
- 16:45Effective unit test properties
- 28:30Readability and maintainability
- 39:05Test speed and performance
- 47:14Test isolation principles
- 55:28Edge cases and failures
- 1:03:28Code coverage and test-driven development
related talks
38mProperties Of Unit Tests in C++
01h 03mProperties of Unit Tests
43mUnselfish Testing
21mTest Kitchen: A Recipe for Good Tests
44mTesting the untestable - patterns and use cases analysis
46mTesting the untestable - patterns and use cases analysis
56mIf You Won't Test Your Code, Who Will?
55mThe Science of Unit Tests
