Go Down

Topic: Automatic Testing Arduino Software (Read 724 times) previous topic - next topic


Sep 10, 2013, 07:53 am Last Edit: Sep 10, 2013, 07:58 am by nicoverduin Reason: 1
In my work I regularly write Software that has quite a few complex logic steps in specific sequence order that change due to certain conditions. Testing this software is always a pain in the ..s. So I wrote a library that can simulate button presses/pin changes and capture pin output settings. The buttons are simulated by creating testcases in Excel and generating 3 files that are integrated into the Arduino sketch at compile time. Output (of the pins both INPUT and OUTPUT) are sent to Serial.
The testcases are stored in FLASH memory thus reducing RAM usage as that is usually the limiting factor. The testcases can alsow be delayed before becoming activated.

In some cases it is handy to add addtional output (like counters etc) in the serial output. So I added the ability to create  a user function that is called every time the Serial outputs pin data. The output is in CSV format allowing it to be copy & pasted into Excel again for formatting.

As the software is usually scanning the pins for input there is an option to block showing pin reads with a non relevant value. Thus reducing output making it more readable.
If your sketch is a timing critical one, this library will not help but if yours is more of a sequence logic type this  library allows for reproducing the same test cases again every time.

The current version is a preliminary one but is fully functional for digitalRead & digital Write. analogRead and analogWrite will be added in future.

Any suggestions are welcome.

You can find the library with a "blink" example at GITHUB: https://github.com/nicoverduin/AutoTest

For more info check www.verelec.nl

Let me know what you think.

Met vriendelijke groet / kindest regards
Nico Verduin
Do not PM me for personal consultancy unless you are willing to pay for it.

Go Up