Generating and working with code coverage reports

You can generate code coverage reports from cached launches of a Java™ or plug-in project.

About this task

The Report tab provides rich grouping, sorting, and integration with the Java editor. You can group Java elements by package or type. To generate a code coverage report for a selected coverage launch:

Procedure

  1. Open the Code Coverage Report dialog box by clicking Run > Code Coverage > Generate Report.
  2. Select one or more coverage launch configurations, the type of report, and the storage location if you want to save the code coverage report. (By default, you can view HTML-based reports using the internal browser. To view HTML-based reports using an external browser, you must specify a storage location on your file system. The report file will be called index.html.
  3. Click Run.

What to do next

To manage report data in Eclipse-based reports:
  1. To manage report data, click the Report tab. Sort columns to help you quickly identify unacceptable levels of coverage.
    Code Coverage Report
  2. The generated report has the package icon in focus Package Icon. If you need another view of the data:
    • Click the group by class icon Class Icon.
    • Collapse all of the tree Collapse Icon.
  3. To sort columns in ascending order, click the header, and click again for descending order.
  4. To open the source in the Java editor, double-click a row containing a compilation unit (such as a class or method), or right-click the compilation unit and click Open in Java Editor.
  5. To find a compilation unit in the Package Explorer, right-click the compilation unit and select Show in Package Explorer.
  6. To see a brief summary for the project, click the Summary tab of the report.
To manage report data in HTML-based reports:
  1. Sort columns to help you quickly identify unacceptable levels of coverage.
    HTML Code Coverage Report
  2. To sort the Packages, Covered Lines, Total Lines or %Coverage columns in ascending order, click the header, and click again for descending order.

Feedback