~/talk

Back to Basics: Debugging and Testing in C++ Software Development

Talkat CppCon 2024 · on Tuesday, 2024-09-17· at 14:00· Cottonwood 8/9, 6700 North Gaylord Rockies Boulevard· [testing]
name:Greg Law
linkedin:gregthelaw
slides:none on file

Advocates writing tests first and always write a regression test for any reported bug, aiming for fast suites (interactive tests a few minutes, pre-merge under ~30 minutes) and zero tolerance for flaky tests. Recommends tooling: GDB/LLDB, valgrind, sanitizers, estrace/ltrace, and modern time-travel debugger recordings for root cause. Counts matter: real projects often carry twice as much test code as code. Push assertions to fail loudly, avoid sleeps, and mock dependencies for tight, repeatable unit tests.

AI-written summary · about

  1. 0:00Welcome
  2. 1:30Why software is hard
  3. 2:58From waterfall to TDD
  4. 4:00Testing's central role
  5. 5:42Test code > production code
  6. 6:44Debugging dominates time
  7. 7:06Good test traits
  8. 8:54Zero flaky tests
  9. 10:00Fast unit test feedback
  10. 12:26Documenting tests
  11. 14:16Unit testing frameworks
  12. 17:03Mocking dependencies
  13. 18:50Unit vs integration tests
  14. 19:52Assertions and errors
  15. 22:03Unix panic on errors
  16. 23:50Avoid sleep in tests
  17. 25:52Making code testable
  18. 26:34Debugging harder than coding
  19. 28:23Debuggability limits quality
  20. 30:10Debugging process
  21. 31:11Hard-to-diagnose bugs
  22. 33:19Common C++ bugs
  23. 38:33Debugging impossible bugs
  24. 39:40Rubber ducking
  25. 41:07Ignoring weirdness
  26. 43:16Debugging tools overview
  27. 44:40GDB debugging
  28. 46:47Valgrind memory checks
  29. 49:23Sanitizers for catching undefined behavior
  30. 51:48strace and ltrace
  31. 52:30Time-travel debugging
  32. 54:17Live time-travel demo
  33. 59:38Q&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.