~/talk

Testability and C++ API Design

Talkat C++Now 2024 · 2024-04-29..05-03· [testing, c-and-cpp]
links:none on file
links:none on file
links:none on file
slides:none on file

Shows concrete patterns: use the pimpl idiom to swap CPU and hardware CRC32 implementations (BlazingMQ) so one test environment covers both, prefer dependency injection via interfaces or templates with Google Mock for precise call and argument checks, and add RAII-style test-time source guards to advance schedulers instantly so unit tests run orders of magnitude faster. Offers abstract factory and channel-factory examples that expose test hooks, and proposes a boilerplate generator to auto-create interfaces, mocks, and tests.

AI-written summary · about

  1. 0:00Introduction
  2. 1:06Testing basics
  3. 2:36The testing pyramid
  4. 5:09Motivation for testability
  5. 6:11SOLID design principles
  6. 9:28Additional considerations
  7. 10:00Techniques for testability
  8. 12:16Pimpl idiom
  9. 14:00BlazingMQ example
  10. 14:49Interface dependencies
  11. 19:27Adding test APIs
  12. 22:32Abstract factory pattern
  13. 24:28MWCIO channel factory
  14. 25:04Generalized mocking
  15. 29:53Dependency injection
  16. 32:33Challenges and solutions
  17. 34:03Proposed testing tool
  18. 35:25Q&A session
~/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.