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·
summary
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
chapters (33)
- 0:00Welcome
- 1:30Why software is hard
- 2:58From waterfall to TDD
- 4:00Testing's central role
- 5:42Test code > production code
- 6:44Debugging dominates time
- 7:06Good test traits
- 8:54Zero flaky tests
- 10:00Fast unit test feedback
- 12:26Documenting tests
- 14:16Unit testing frameworks
- 17:03Mocking dependencies
- 18:50Unit vs integration tests
- 19:52Assertions and errors
- 22:03Unix panic on errors
- 23:50Avoid sleep in tests
- 25:52Making code testable
- 26:34Debugging harder than coding
- 28:23Debuggability limits quality
- 30:10Debugging process
- 31:11Hard-to-diagnose bugs
- 33:19Common C++ bugs
- 38:33Debugging impossible bugs
- 39:40Rubber ducking
- 41:07Ignoring weirdness
- 43:16Debugging tools overview
- 44:40GDB debugging
- 46:47Valgrind memory checks
- 49:23Sanitizers for catching undefined behavior
- 51:48strace and ltrace
- 52:30Time-travel debugging
- 54:17Live time-travel demo
- 59:38Q&A
related talks
01h 01mBack to Basics: Debugging in Cpp
01h 02mBack to Basics: C++ Testing
01h 05mBack To Basics: Debugging Techniques
01h 01mBack to Basics: Test-driven Development
52mNobody Can Program Correctly - Lessons From 20 Years of Debugging C++ Code
01h 03mBack to Basics: Testing in C++
01h 07mPragmatic Unit Testing in C++
59mC++ Unit testing - the good, the bad & the ugly
