Test Driven Development is how all embedded C applications should be developed. This page contains useful links.
So far, Ceedling with Unity and CMock is my favourite choice for testing C code. I used it to build a driver for a microSD card in PaparazziUAV. I have not experienced any bugs so far!
GoogleTest is a test framework for C++. I’ve used it before to make great Arduino code.