How we implemented TDD in Embedded C/C++
summary
Company has run TDD on embedded C/C++ since 2009 across ~30 projects and documents concrete practices: they run tests on the dev PC with sanitizers (AddressSanitizer) for fast feedback, then dual-targeting with 15-minute target deploys to catch compiler/ABI issues, use Google Mock and C++ interfaces for mocks plus link-time mock substitution (swap object files to avoid virtual calls), run integration tests on build servers that deploy to limited target hardware, and replace hardware with a fake BSP to shrink long system tests from days to minutes.
AI-written summary · about
chapters (19)
- 0:00Introduction
- 1:37The TDD cycle and criteria
- 4:04Testing on target hardware
- 6:33Testing on development PC
- 8:22Dual targeting strategy
- 11:13Using sanitizers
- 12:26Layered architecture
- 14:04Test doubles
- 16:03Classical vs mockist TDD
- 18:05State vs behavior verification
- 21:22Choosing a TDD style
- 23:14Inserting test doubles
- 24:22C++ interfaces for mocks
- 27:56Link-time substitution
- 29:07C link-time techniques
- 32:25Continuous integration
- 33:16Integration testing
- 34:11Speeding up system tests
- 35:58Conclusion
related talks
01h 22mTest-Driven Development of C++ Embedded and System-Level Software
01h 00mMetal-In Test-Driven Development: A Dual-Target TDD approach
01h 01mMicrocontrollers in Micro-increments...
54mTDD for Microcontrollers
01h 01mAdvanced Unit Testing in C & C++
01h 01mBack to Basics: Test-driven Development
01h 00mC++ Test-driven Development
32mThinking in tests
