Testability and API Design
summary
Covers concrete recipes: use pointer to implementation to test multiple implementations (software and hardware CRC32 examples), prefer dependency injection to replace real services with mocks, add a friend test guard or a event scheduler test time source to advance time deterministically, and use an abstract factory to swap test/production components in one place. Also recommends providing bundled mock interfaces and proposes a code-generator that emits interfaces, mocks, pimpls and test scaffolding.
AI-written summary Β· about
chapters (6)
- 0:00Introduction
- 1:47Testing background and basics
- 8:49SOLID principles and motivation
- 15:04Practical testing techniques
- 36:21Mocking, challenges, and tools
- 59:34Conclusion
related talks
46mTestability and C++ API Design
44mTesting the untestable - patterns and use cases analysis
57mAdvanced Testing Techniques: Tips from the trenches
22mLetβs dive into the topic of testability
30mRefactoring and Test Fakes: Crafting Resilient Code with Confidence
28mAdvanced Testing Techniques
20mThe Art of Testing
54mAutomated Tests: What Courses Won't Teach You
