Testing Your Tests with Code Coverage

By Richard Wallman

Everyone is writing tests for their code, right? Having tests is a good start, but unless you’re testing every single line of code, there’s still chances for "fun" times with bugs.

Having an incomplete set of tests can provide a false sense of security, but manually checking every possible execution path is tedious and error-prone.

Thankfully, there are tools which, when used in conjuction with our test suite, can highlight code that is never executed - the gaps in our test cases. Armed with this information, we can add to our existing test suites to cover these (hopefully edge) cases.

This talk will focus on the GNU Compiler Collection, but other compilers (such as Clang) also include similar tools. This talk is about the process, not the tools.