Prime path coverage merged into GCC

Prime path coverage merged into GCC

March 27, 2025

I am happy to announce that the prime path coverage support has been merged into GCC mainline. This was a continuation of my MC/DC project with NASA. I did most of the programming in the spring through autumn of 2024, followed by a long period of mostly testing and paper writing. NASA have been using GCC builds with this feature for about six months now, and they are quite happy with what they can learn from it. Process wise, it is an opportunity for simplification too – because prime path coverage subsumes most other coverage metrics we can now focus on a single metric.

Prime path coverage has grown on me, really. The common stance is that any sort of path coverage is way too expensive, i.e. requiring too many test cases, to even bother measuring. The more I have worked on this feature the less convinced I am that this is true. While path explosion is real it can be managed with refactoring and simplification, parametrized tests, property testing, and carefully considering input classes. Just as importantly, because we know what the prime paths are we can quite easily detect and understand non-local (that is, beyond a single line/statement/condition) interactions, which increases our sensitivity to potential problems.

So what’s next? I will probably follow up on the immediate issues from users (and buildbots). I also plan to write a few posts showcasing prime path coverage, what problems it can detect, and how to use it to guide refactoring and design.