Viewing and analyzing coverage data for lines and methods

View and analyze line and method coverage data in the Coverage Statistics, Coverage Navigator, and Annotated Source views.

Prerequisite: Collecting coverage data for lines and methods

  1. Display the three coverage views for your profiling resource. If you have performed multiple profiling runs, select a profiling resource at the level of Host or higher to see the automatically merged data. If necessary, use the Profiling Monitor toolbar drop-down menu to display resources at the correct level.
    1. Right-click the profiling resource, then in the pop-up menu select Open With > Coverage Details. This opens both the Annotated Source and Coverage Navigator views. If these views report No data available for display, read Flushing coverage data for display in the Coverage Details views.
    2. Right-click the profiling resource, then in the pop-up menu select Open With > Coverage Statistics.
  2. Check coverage at the method level by using the Methods columns in the Coverage Statistics view.
  3. Check coverage at the line level by using the Units columns in the Coverage Statistics view and the two-colored bar graphs ( ) to the left of each entry in the Coverage Navigator view. Units are executable byte-code commands; a line of code can contain one or more units.
  4. Identify the specific lines or units that you have not exercised in the Annotated Source view by clicking an item in the Coverage Statistics or Coverage Navigator view to display it in the Annotated Source view. If the Link with Viewer button Link with Viewer button in the Profiling Monitor is selected, clicking any item in the Coverage Navigator or the Coverage Statistics view synchronizes all three views.
  5. In the Annotated Source view, click the Show Source Code with Annotations button Annotated Source toggle button to toggle between the Source Data and Source Code with Annotations displays.
    1. Use the line tables in the Source Data display to identify uncovered lines.
    2. Use the Source Code with Annotations display to see coverage annotations displayed directly on a copy of your code.

The following tasks provide additional information about viewing and analyzing coverage data:

Parent topic: Monitoring code coverage to detect untested lines and methods

Related tasks
Collecting coverage data for lines and methods

Related reference
The Coverage Statistics view for line and method coverage data
The Coverage Navigator view
The Annotated Source view, source code with annotations display
The Annotated Source view, source data display

Terms of use | Feedback
(C) Copyright IBM Corporation 2000, 2005. All Rights Reserved.