Testable by Design
summary
A concrete heating controller is built and tested: a timer activator, a thermostat activator and a fake heater verify behavior, not implementation. Examples use modern C++ features — concepts, CTAD, smart pointers and std::chrono — and compare std::function versus templates, showing compile‑time vs runtime tradeoffs. Dependency injection, type aliases for domain concepts, and a chain of responsibility style composition make unit tests pass under Google Test while revealing lifetime choices (raw vs shared_ptr) and practical refactoring paths.
AI-written summary · about
chapters (7)
- 0:00Introduction
- 7:48Designing with uncertainty
- 13:10Heating system base class
- 26:00Time and temperature separation
- 32:35Emerging design patterns
- 45:57Uncertainty-driven design
- 49:10Q&A
related talks
51mTestable by Design - How to Create Testable C++ Code Using C++ Language Features
46mTestability and C++ API Design
01h 01mBack to Basics: Test-driven Development
01h 02mRefactoring C++ Code for Unit testing with Dependency Injection
01h 00mTestability and API Design
01h 22mTest-Driven Development of C++ Embedded and System-Level Software
01h 18mTesting C++ Templates: Investigating Tests for C++ Templates using Adversarial Methods
59mC++ Unit testing - the good, the bad & the ugly
