Unit testing your code is peace of mind. It has two main direct benefits that impact on your confidence about the code you are writing:
- Testing expected behaviors
- Avoiding regressions (i.e. breaking something that was working fine before)
Unit testing embedded systems is a bit more involved since there is the additional constraint of the hardware itself, sometimes more than one device or even different platforms. Quitting (or not even thinking about it) is the easy answer to the problem. All of us have debugged expected behaviors with inline prints. But automating some of these tasks have a huge benefit on the code quality and development speed.