Code coverage for Graphviz?

I’ve used code coverage for my JavaScript projects (and also for VHDL when I was en FPGA developer). I find it very useful if it’s used correctly, i.e. to spot weaknesses in your functional test coverage in order to add tests that actually check the functionality and not just make sure each line is executed.

Would you be in favor of adding code coverage to Graphviz? If so, which tool should we use? I can’t recall having ever used it for C code.

1 Like

Absolutely. I expect our current score would be abysmally low, but the first step is to measure. Unfortunately I don’t have any recommendations of a tool to use.

Maybe a bit OT, but when we’ve sufficiently paid down our debt of known bugs, I’d like to also establish regular fuzz testing (#1370) and even venture into mutation testing which I’ve found effective on other projects.

Code coverage would be great. I’m not sure what infrastructure is good for coverage instrumentation. At work we use bazel coverage, which seems to have open sourced their thing: https://stackoverflow.com/a/53900106/171898. We don’t use bazel to build Graphviz, but perhaps that’s a useful pointer to see what underlying tool bazel uses (probably some compiler flags?), and perhaps we could leverage that.