Using Annotated Source Colors to Analyze Coverage (Purify Coverage Data)

Related Topics

 

Purify uses debug line data to display line-by-line coverage data in the Annotated Source window. By default, Purify annotates the source file with the following colors:

§          Blue, indicating hit lines of code

§          Red, indicating missed lines of code

§          Black, indicating dead lines of code

§          Green, indicating summaries for functions

§          Pink, indicating partially hit multi-block lines of code

With these color-coded annotations, you can quickly browse the annotated source and locate individual untested lines and sections of missed code. To help you easily see missed sections of code, Purify colors the dead code that falls between lines of hit code or lines of missed code the same color as the hit or missed code. You can then use the Next Missed Section and Previous Missed Section shortcut commands to stop where it really matters as you step through your code. For example:

images\deadcode.gif

Notes:

§      Annotated source code is available only if you collected coverage data for a run, only if debug line data is available for the module that includes the code, and only if the module was instrumented at line level.

§      If a function is declared as:

 

int function foobar(...)
{

with the open bracket ( { ) on the line following the function, Purify marks the line int function foobar(...)as dead code.

§      When multiple basic blocks are on one line, Purify collects separate counts for each basic block. However, the Annotated Source window displays only the highest count on the multiple basic block line. For example:

images\multiblk1.gif

By default, Purify does not display multi-block lines. To display these lines and see the coverage data, right-click in the Annotated Source window and select Show Multi-block Lines. For example:

images\multiblk2.gif

§      By default, if a line was only partially tested, Purify distinguishes it from hit lines.

(C) Copyright IBM Corporation 1992, 2010.