Just sharing a nice idea I had today:
I wanted to make my json parsing library as bug-free as possible, for that reason I wrote a comprehensive set of unit tests for it. However I wasn't sure if I covered all use cases, so I made a small code coverage tool using openmsx.
The idea is to set watchpoints and log all addresses being executed, then a python script combines the log with the .lst file generated by sjasmplus to provide a visualization of the code. Here's the output:
http://www.ilafox.com.br/ricbit/coverage_error.html
As you can see, this uncovered a bug! When I optimized the code by size, I wrongly put an INC on D00C, but it was supposed to be a DEC. On the turboR this didn't triggered a bug, because by coincidence the register A was non-zero when USR was called. But it could break in other machines. The coverage tool pointed correctly that D02E was never executed, and I was able to fix the bug :)
The tool is available as coverage.tcl and coverage.py on the msxjson repository, very simple:
