In the Annotated Source window, the display
of coverage data for source code consists of pie charts that show line coverage
statistics for classes and methods, and tables that provide coverage data
for each line.
To display the Annotated Source view, right-click a profiling
resource entry in the Profiling Monitor, then click . Data
for the resource must have been collected with a profiling set that included
the Method and Line Code Coverage profiling type.
Note: If you have collected
coverage data for multiple profiling runs, the results are merged automatically
at the host level and above with data collected. To display the Host profiling
resource, open the Profiling Monitor drop-down menu and, if the Hide
Host command is preceded by a check mark, click the command to
remove the check mark. You can now open the coverage views for the host-level
profiling resource.
Navigation
Clicking a class or method in the Coverage
Navigator view displays the data for the class or method.
Note: Clicking
an entry in the Coverage Navigator at the package level or above displays
a coverage summary. The coverage summary graph shows the distribution of coverage
levels among the files that the entry contains, and a data table listing all
the files by coverage rate. Each bar in the graph links to the table; for
example, clicking the bar labeled 25% - 50% displays the
first line in the table with a coverage rate between 25% and 50%.
Pie charts and tables
There is one pie chart for
each class. There is one pie chart and one table for each method.
- The pie chart shows how many lines were tested, untested, and partially
tested.
- The table lists each line, with a line number, and indicates whether it
was tested, untested, or partially tested. A line is partially tested if it
contains multiple units (executable byte-code commands) and not all units
were exercised.
The tables display the following information:
Column |
Description |
(No header) |
A symbol indicating whether a line was tested ( ), untested (
),
or partially tested ( ).
By default, lines are colored green, red, or orange to indicate whether they
were tested, untested, or partially tested.
|
Line Number |
The number of the line in the code. Lines are listed
in the order in which they were first executed.
|
Units Hit |
The number of units included in the line that were exercised.
|
Number of Units |
The total number of units in the line.
|
% Units Hit |
The percentage of units in the line that were exercised.
|
Controls
The following toolbar buttons and menu
commands are available in the Annotated Source view:
Toolbar button |
Command |
Description |
 |
Toggles between Show Source Code with Annotations and
Show Source Data
|
Toggles the Annotated Source view to show either the
source code with annotations or the source data.
|
 |
Open Source for Editing
|
Displays the source code, if available, for the selected
item. Source code is available only if you are profiling a Java™ project
that is currently open in the Java perspective.
|
Note: If this view reports No
data available for display after you have collected line and
method coverage data, flush the data manually for subsequent runs.