Arduino blog

Arduino blog

Arduino thinkering

This blog is about things I come by related to Arduino which I feel are inspiring/important/funny enough to write about.

Debugging and unit testing Arduino (Part 1)

eclipse pluginPosted by Jan Mon, April 27, 2015 00:25:54
Debugging and unit testing with Arduino

I used many discussions about debugging Arduino code, and frankly they almost always end with “print statements and the serial monitor”.

Honestly I think that whatever happens the serial monitor will be the king of the debugging tools. That is so because debugging an Arduino program may seem simple at first hand but it is actually a complex tasks.

If you look at the picture below you'll see all the involved components of an Arduino “end product'”. I say end product because there are no “build tools” or “debug tools”.

This series of posts is only about the green part. Your code.

But if your code is only such a small part of the whole project ..... why would you bother?

Look at the image below ….

As the image above shows: “your code”, “your electronics” and “your mechanics” may be the smallest part of the project but it is also the only non debugged part. So errors are most likely in “your ***”.

The better each of “your ***” parts is debugged and understood the better chance your project has to be a success.

This series ofpots wants to show you a way to improve “your code” in ways you may not have considered possible before. Namely debugging and unit testing.

If you want me to show you how ... please post


  • Comments(4)

Fill in only if you are not real

The following XHTML tags are allowed: <b>, <br/>, <em>, <i>, <strong>, <u>. CSS styles and Javascript are not permitted.
Posted by Jantje Tue, May 05, 2015 12:18:31

Txs for the comments.
The next part has been posted.

Posted by Henttinen Fri, May 01, 2015 19:39:25

Yes please. Unit testing capability would be awesome!

Posted by aceperry Tue, April 28, 2015 22:51:53

Yes, please share! Love your plugin btw. Also want to see it work on 1.6.3, thanks.

Posted by Miguel Sesma Mon, April 27, 2015 12:15:34

Cannot wait to see how do you unit test in Arduino...
Or at least add breakpoint and variable inspection to the IDE :)