A curated list of code coverage resources. Only free tools are included.
Code coverage is the process of measuring the percentage of the source code lines that are executed during testing.
Commonly, code coverage tools are implemented by these ways.
- Instrumentation at compile time, insert addtional codes to collect code coverage.
- Act as a debugger, insert break points at runtime, collect code coverage.
- Use existing instrumetation/debug interface provided by the language, collect code coverage (e.g., Lua, Python).
Tools | Supported OS | Implementation | Branch Coverage |
---|---|---|---|
gcov | All OS supported by gcc | Instrumentation | YES |
kcov | FreeBSD/Linux/MacOS | Debugger | NO |
OpenCppCoverage | Windows | Debugger | NO |
Tools | Supported OS | Implementation | Branch Coverage |
---|---|---|---|
go cover | All OS supported by Go | Instrumentation | NO |
goc | All OS supported by Go | Instrumentation | NO |
gobco | All OS supported by Go | Instrumentation | YES |
kcov | FreeBSD/Linux/MacOS | Debugger | NO |
Tools | Supported OS | Implementation | Branch Coverage |
---|---|---|---|
JaCoCo | All OS supported by JVM | Instrumentation (at runtime by java agent) | YES |
cobertura | All OS supported by JVM | Instrumentation | YES |
Tools | Supported OS | Implementation | Branch Coverage |
---|---|---|---|
acvtool | Android | Instrumentation | NO |
Tools | Supported OS | Implementation | Branch Coverage |
---|---|---|---|
luacov | All OS supported by Lua | Debug Interface (debug module) | Partial |