TDD for Embedded C
2021-09-06 07:39:43 UTC
Most useful learnings:
A lot of (obvious) things I knew up front, like the need for abstractions, that global variables are bad and that dependencies needs to be kept under control and at a minimum. The TDD course shows why this is not just academic best practices but needed practices to get clean and testable code.
Concepts v exercises:
Presentation v discussion:
Maybe a bit more of a debrief after the workshop. We end up with a lot of faked stuff and a couple of very basic tests. It's early days for us yet, but no clear path yet how this should evolve into better interfaces and cleaner code (eventually). I guess it's a lot of hard work before we get there, but as I see it getting these tests is not a goal in it self, just a means to enable refactoring. Showing and clarifying that path could be good.
Yes, but I think maybe we should re-evaluate the choice of toolchain. I think Google test could be a good choice even in an embedded system in C if you start from scratch, but the workshop showed a few difficult parts in the C vs C++ category that we could avoid with a pure C framework. And I would think we could get quicker compilation, which would be a big deal with TDD... The problem is that there is really no obvious choice for pure C framework...
Challenges to applying:
Getting people to take the time. Getting project managers to approve of people taking the time. Getting some ground rules and the framework settled (always takes more time than expected).
Very nice, even with an Indian summer in Norway and the best weather since the middle of July it was a pleasure to attend the evening sessions.
Legacy code workshop:
Recommend to others: