We Have Constrained Memory

Constrained memory is the reality for many embedded developers. Running tests in the development system won’t reveal the same memory constraints found in the target. Here are a few things to help TDD in constrained memory situations:

  • Use dual-targeting so the bulk of your code is tested off-target.

  • Make a lab version of your target system with plenty of memory to hold all production code and test cases.

  • Find a small test harness. Unity is a good choice.

  • As described in We Have a Long Build Time , create multiple test runners, each with a subset of tests that fit into the limited memory.

  • Track memory usage for your target build.

Figure 9. Flash usage graph

Let’s talk a little about tracking memory usage. ...

Get Test Driven Development for Embedded C now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.