~/talk

Testable by Design - How to Create Testable C++ Code Using C++ Language Features

Talkat C++ on Sea 2024 · 2024-07-02..07-05· [testing, c-and-cpp]
links:none on file
slides:none on file

Builds a small heating controller (timer + thermostat + override activator) that composes an abstract heating activator API, uses fake implementations and Google Test to verify behaviors, and keeps time as std::chrono durations wrapped in a time window helper. Uses C++20 concepts (invocable) and CTAD, prefers shared_ptr for simple lifetime management, provides a factory for template activators, measures std::function vs templated callables and reports ~50% speed gain for templates, and shows examples compile with GCC/Clang/MSVC.

AI-written summary · about

  1. 0:00Testable C++ design intro
  2. 5:27Heating controller system design
  3. 10:10Uncertainty in third-party APIs
  4. 15:09Controller with dependency injection
  5. 21:12Refactoring for testability
  6. 25:05Thermostat temperature separation
  7. 32:12Timer and override activators
  8. 38:52Manual override functionality
  9. 43:35Design principles summary
  10. 45:22Q&A
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.