Skip to content
SPECIFICTION
Get listed

Coverage.py vs gcov

Coverage.py

coverage.readthedocs.io

gcov

gcc.gnu.org

Side by side

FigureCoverage.pygcov
Price fromFreeFree
Free planYesYes
Free trial——
Open sourceYes—
WindowsYesYes
macOSYesYes
LinuxYesYes
APIYes—
Self-hostedYes—
Plans published21
Spec score · Test Coverage Tools8.9 (#2)8.5 (#5)
Branch coverageThe tool can measure whether alternative branch paths were executed.The --branch-probabilities option reports branch frequencies in the output file and branch summary information on standard output.
Intended usersThe documentation presents Coverage.py as a tool for people measuring Python test effectiveness by seeing which code tests exercise and which they miss.The documentation describes software developers using coverage results with test suites to find where additional tests are needed.
PurposeCoverage.py measures which parts of Python programs ran and identifies executable code that did not run, commonly to gauge test effectiveness.gcov is a test coverage program used with GCC to find untested parts of programs and guide code optimization.
SupportUsers can seek help on the Python discussion forums or Python Discord, report bugs on GitHub, and obtain professional support through Tidelift Subscription.The GCC project directs users to its manuals and the gcc-help mailing list for usage questions.

Plans

Coverage.py

  • Coverage.pyFree
  • FreeFree

Coverage.py pricing →

gcov

  • gcovFree

gcov pricing →

In their own words

Coverage.py

Coverage.py measures which parts of Python programs run and highlights executable code that remains untouched, helping developers assess what their tests exercise. It measures statement coverage by default and can also track branch coverage. Reports are available as text, HTML, XML, LCOV, and JSON. Dynamic contexts can associate lines of execution with the test function that ran them. Coverage.py can run test suites through their usual command; pytest-cov is available but the documentation says most users do not need it. Third-party plugins can extend measurement to non-Python files, such as connecting executed Python to Django templates. Data is stored in a SQLite database, and advanced use can rely on its API. The current documentation lists Python 3.10 through 3.15 rc2 and PyPy3 versions 3.10 and 3.11. The tool provides ctrace, pytrace, and sysmon measurement cores; sysmon is faster for simple line and branch coverage but lacks support for dynamic contexts and plugins. Coverage.py is licensed under Apache 2.0 and runs on Linux, macOS, and Windows, with self-hosting available. It is free.

Visit coverage.readthedocs.io

gcov

gcov is a free test coverage tool used with GCC to show how program code runs during testing. It reports which source lines execute and how often, producing per-line counts in `.gcov` files. Reports can include line, function, branch, condition, prime-path, and basic-block coverage. Options can report branch frequencies, show whether conditions independently affect a Boolean expression’s result, or filter reports to functions matching regular expressions. Output is available as `.gcov` text or gzip-compressed JSON; JSON generation does not require source code. The GCC documentation also describes using gcov with gprof to assess computing time, while warning that optimization can combine source lines and reduce hotspot detail. Before coverage reporting, programs must be compiled with GCC’s `--coverage` option. gcov works only with GCC-compiled code and is not compatible with other profiling or test coverage mechanisms. It runs on Linux, macOS, and Windows, supports the listed languages from C and C++ to Ada, D, and Go, and is self-hosted.

Visit gcc.gnu.org