gcov is free, ships with GCC, and for many projects it is enough. It reaches its limits with other compilers, on constrained embedded targets, and when a safety standard requires you to justify the confidence placed in the tool. Here is how to choose.
What each one does, according to the GCC documentation and Verifysoft's documentation.
| Criterion | gcov | Testwell CTC++ |
|---|---|---|
| Nature | Free tool, shipped with GCC. | Commercial tool from Verifysoft, distributed in France by Precilog. |
| Cost | Free. | Paid license. Free evaluation on your code. |
| Compilers | GCC only: “gcov works only on code compiled with GCC”. Clang has its own tool, llvm-cov. | Native and cross compilers, C and C++: GCC, Visual Studio, IAR, Keil… The ctc command is placed in front of the compiler call, and the compiler keeps its options. |
| Languages | C, C++ and the other GCC languages. | C and C++; Java with an add-on. |
| Instrumentation | By the compiler, on the control flow graph. The GCC documentation advises compiling without optimization. | In the source code, on a temporary copy, before compilation by your compiler. |
| Measures | Lines, functions, branches of the generated code. Since GCC 14: conditions and MC/DC (“masking” form). | Functions, statements, decisions, conditions, MC/DC and multicondition. |
| Reports | Annotated text files (.gcov). HTML reports with third-party tools: lcov, gcovr. | Built-in HTML report, from the project down to the condition, on your source code. |
| Embedded target | With a file system, as on a workstation. Without a file system: dump routine, linker script and transfer channel to write yourself. | Run-time library supplied in C, adaptable to the target, even highly constrained and without a file system. Data sent back through the channel of your choice. |
| Safety standards | No certificate: tool qualification is entirely up to the project. | TÜV SÜD certificate for IEC 61508, ISO 26262, EN 50716, ISO 25119 and IEC 62304. DO-178C: project-specific qualification, with support from Verifysoft. |
| Support | Community. | Verifysoft and Precilog. |
For a long time, gcov stopped at lines and branches. Since GCC 14, released in 2024, it can measure condition coverage and MC/DC: you compile with -fcondition-coverage, then run gcov --conditions. Clang has also offered MC/DC since version 18, with -fcoverage-mcdc.
This is real progress for projects compiled with GCC. Yet MC/DC alone does not settle the question for a project subject to a standard.
You need GCC 14 or later. A cross-compilation toolchain frozen on an earlier version, common in embedded development, does not benefit.
GCC measures the so-called “masking” form of MC/DC. Clang limits MC/DC to six conditions per expression: beyond that, the expression is not measured.
For ISO 26262 or IEC 61508, you must justify the confidence placed in the tool. Without a certificate, it is up to the project to qualify gcov, and to do it again at every version change.
Your tests don't change. Only the way you compile changes, for the time of the measurement.
Unit, integration or system tests: those that run today with gcov are used as they are.
The ctc command is placed in front of the compiler call, in your build or your IDE. You keep your compiler and its options.
The instrumented program records coverage. On a target, the data is sent back through the channel of your choice.
An HTML report, from the project down to the condition, with MC/DC and multicondition. It can go into your safety case.
Nothing forces you to choose for the whole team: gcov can stay on developers' workstations, and Testwell CTC++ can be used for on-target measurements and for the evidence required by the standard.
A free evaluation of Testwell CTC++, with your compiler and your target: you see what gcov doesn't show you.
Sources: gcov documentation ↗, gcov without an operating system ↗, Clang code coverage ↗, MC/DC in GCC ↗, Verifysoft comparison ↗.