Code Profiling Utilities Manual

Interpreting the Code Coverage Report
HP Code Profiling Utilities Manual—542684-003
8-4
Understanding Color Coding in the Code Coverage
Report
Understanding Color Coding in the Code Coverage Report
Tabl e 8 - 1 summarizes the colors used in the code coverage report.
In general, the recommended way to use color coding in reports is simply to get a
general view of which code was covered (executed) and which code was not. You can
then determine whether more testing is needed to cover those portions of the code that
were not executed. For example, you might look for large pink or yellow areas,
indicating uncovered portions of code, then develop additional tests to execute that
code.
Getting more detailed information from color coding can be more difficult. To accurately
interpret the colors that appear in a code coverage report, you should understand the
basic concepts discussed under Understanding Code Coverage Concepts on
page 3-2.
In general, all code within a block is given the same color. If the block was executed at
least once, that block was ā€œcoveredā€, so it has no color (by default). If a block was
never executed, it is either yellow or pink.
Different Colors Within the Same Block
However, there are exceptions to the generalization that all code within a block is given
the same color. In some cases, the coloring changes in the middle of a line. This
occurs because there might be several different blocks on the same line, and the
compiler and codecov are not always precise in determining where the blocks begin
and end. In some cases, a line, or part of a line, will inherit a color from the preceding
block.
Thus, the colors in the report do not always convey the correct information. But you
can better understand the report by observing where the colors change. The new color
after the change might be correct for the entire line, or even for previous lines, even
though those lines have a different color in the report.
Table 8-1. Color Coding in the Code Coverage Report
Default Color Meaning
yellow Indicates uncovered basic blocks in a function for which some basic
blocks were covered and others were not.
white (no color) Indicates basic blocks that were covered.
pink Indicates functions that were uncovered.
light brown Indicates partially covered code.
white (no color) Indicates source for which no code was generated.