Use the Annotated Source window to view coverage information for each line of code. By default, the window displays the following data for each line:
By default, Purify displays the following data for each line of code:
§ Line number
§ The number of times the line of code was hit; 0 indicates the line was missed
§ Color-coded highlights to indicate hit lines of code (blue), missed lines of code (red), partially hit multi-block lines of code (pink), dead code (black), and summaries (green)
You can do the following operations in the annotated source:
To |
Do this |
Locate a function in the source file |
Select a function from the Functions list. |
Show or hide columns |
Right-click in any column heading and select Show/Hide Columns from the shortcut menu. You can also drag the right border of a column heading completely to the left to hide the column; use the Show/Hide Columns dialog box to redisplay the column or, for the first column, drag the border to the right again. |
Resize columns |
Drag the right border of a column heading to any width or double-click the right border to automatically resize the column. You can also right-click in any column heading and select Size All to Fit from the shortcut menu to resize all columns, or Size to Fit to resize the current column. |
Rearrange columns |
Drag a column by its heading to a new position. |
Change colors |
Select the appropriate command from the Colors list. You can change the color of items such as hit and missed lines, multi-block lines, and summaries. |
Find missed sections |
Right-click in the window and select Next Missed Section from the shortcut menu to find the next section of missed lines, or Previous Missed Section to find the previous section of missed lines. |
Display summaries |
Right-click in the window and select Show Function Summaries from the shortcut menu. Purify inserts a function summary preceding each function. |
Display multi-block lines |
Right-click in the window and select Show Multi-block Lines from the shortcut menu. Purify shows the individual coverage for each basic block contained on a line, as they are ordered in a module. |
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 contains the code, and only if the module was instrumented at line level.
§ If a numeric value is too long to be completely displayed in a column, Purify displays ###. You can resize the columns to fully display the data.
§ If you chose to display multi-block lines, Purify displays a line for each block, identified by a plus sign (+) in the Line Number column.
§ If you chose to display function summaries, and if the source file uses template functions, Purify inserts a function summary for each instantiation. The function summary identifies the function and the number of times it was called.
§ If dead code falls between lines of hit code or lines of missed code, Purify colors the dead code the same color as the hit or missed code, so you can easily see missed sections of 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.
§ You can copy data from the Annotated Source window to the Clipboard to analyze your code along with the coverage information, to send code-coverage information to other team members, and to save the coverage information for testing metrics.
§ Right-click in the Annotated Source window to display a shortcut menu for working with the annotated source code.
§ The status bar displays the current line number, the total number of lines in the file, and the current function.
(C) Copyright IBM Corporation 1992, 2010.