Practical Advice for Maintaining and Migrating Working Code
summary
Concrete recipes for getting tests into untested C++ code without huge rewrites: hijack main in the simulator and add Google Test to run desktop builds; write small stub headers and type-only headers to avoid cascading deps; link a dummy timer C implementation to exercise timing-sensitive threads so a backlight test runs instantly instead of waiting an hour; move units into a testable top section and do bottom-up compile/link/run cycles; replace globals with getters and funnel accesses through public APIs so future changes and regressions show up in automated tests.
AI-written summary · about
chapters (18)
- 0:00Intro
- 0:34Legacy Code
- 3:53Testing
- 10:31Getting Started
- 13:28Discovery Testing
- 18:44BottomUp Testing
- 21:35Dealing with Dependencies
- 28:42Scout Rule
- 29:05Refactoring
- 31:20Getters and Setters
- 34:43Callsite Diagnostics
- 37:02Use Public Functions
- 39:13Ease Cognitive Burden
- 42:37Prevent Maintenance Bugs
- 43:33File in Files to Keep
- 44:12Use Enums
- 45:44Martin Fowler Quote
- 46:29Conclusion
related talks
40mLessons from two decades of writing bad code
01h 17mDevelopment strategies: You've written a library - now what?
01h 01mBack to Basics: Debugging in Cpp
47mHow to Stop Testing & Break Your Code Base
06mLightning Talk: Best Practices Every C++ Programmer Needs to Follow
47mAdventures with C++ Legacy Codebases: Tales of Incremental Improvement
58m10 Techniques to Understand Existing Code
35mQuickly and Safely Refactoring Legacy Code
