Linux Journal: Coverage Measurement and Profiling

“Maybe you’ve always wondered what the gcov utility that comes
with GCC is used for, or maybe your new project at work has a
regulatory or customer requirement that your delivered software be
tested to a certain percentage of coverage, and you are looking for
how to accomplish that task. In this article, I introduce the
general ideas of coverage measurement and of performance profiling,
along with the standard GNU tools (gcov and gprof) used in these
two techniques.

“Coverage measurement is the recording of what paths were
executed in code. Coverage can be measured with different degrees
of granularity. The coarsest level is function coverage, measuring
which functions were called; then comes statement coverage,
measuring which lines of code were executed; and finally, branch
coverage, measuring which logic conditions in branch statements
were satisfied. When someone refers to coverage measurement usually
statement or branch coverage is being discussed. gcov is the
standard GNU coverage measurement tool, and it requires GCC.


Related Story:
User-mode Linux
port 0.2-2.3.31 released
(Dec 20, 1999)

Get the Free Newsletter!

Subscribe to Developer Insider for top news, trends, & analysis