~/talk

Pragmatic Unit Testing in C++

Talkat CppCon 2014 · on Wednesday, 2014-09-10· at 16:45· Newton· [testing]
slides:none on file

Argues unit testing only pays when paired with static and run‑time analysis as an “iron triangle,” and shows concrete steps to get ROI in legacy C++: move bodies out of headers, extract pure‑virtual interfaces, add link‑time or runtime seams, and use link‑time substitution or mock include for third‑party headers. Demonstrates tools that actually work: CGreen (process‑isolated tests, clear failures), MakitoPP (runtime mocks for pure‑virtual interfaces), callgrind/Valgrind, LTO/PGO. Notes ROI that erodes as teams grow (10 → 50 → 100+ devs) and gives examples that succeeded in reducing coupling and speeding debugging.

AI-written summary · about

  1. 0:00Introduction
  2. 1:47Summary
  3. 15:37What unit testing is not
  4. 27:52Optimize for readability
  5. 34:45Readability Example: cgreen
  6. 45:56Mocking: Runtime
  7. 47:45Mocking: Side-by-side
  8. 50:13Breaking Dependencies: Compile Time
  9. 52:30Move Body: Template functions
  10. 55:26Breaking Dependencies: Preprocessor
  11. 55:37Breaking Dependencies: Redefine symbols
  12. 56:23Breaking Dependencies: Link time
  13. 59:31Runtime Performance (cont'd)
~/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.