メインコンテンツまでスキップ

Embeded Testing Guide

Introduction Guide to Embedded Software Unit Testing using google test

Introduce unit testing

This guide is a slightly modified version of the material I used to introduce unit testing to my embedded development team. I hope it will be helpful to those who understand the importance of testing but don't know how to introduce unit testing to their embedded development.

Breaking dependencies

When attempting to apply unit testing to embedded product code, you may find that the code under test depends on code that only runs on the microcontroller. To enable testing, you need to isolate these collaborators or replace them with test doubles.

Test code example

I will show a sample test code using Google Test. However, this guide focuses more on the methodology of introducing unit tests into embedded software development rather than on how to use specific testing frameworks. The principles shared in this guide are consistent regardless of which testing framework you use.