Collecting coverage data for lines and methods

Begin coverage analysis by collecting data for a profiling run.

Prerequisites:

Collect data using the following steps:

  1. In the Profiling tab (Overview subtab) of the Profile dialog box, select the Method and Line Coverage Information profiling set. (A Method Coverage Information profiling set is also provided, but it collects only method-level coverage data for display in the Coverage Statistics view.)

  2. Click the Profile button to start your application.

  3. Exercise the parts of your application for which you want to monitor coverage. You can now terminate your application

    Note: If you want to collect coverage data for other parts of your application, profile the application again in the same way. The coverage data is collected in a separate dataset, and is also automatically merged at the Host level and above with data collected in earlier runs. To display the Host profiling resource, open the Profiling Monitor drop-down menu and, if the Hide Host command is preceded by a checkmark, click the command to remove the checkmark. You can now open the coverage views for the host-level profiling resource.

Note: It is sometimes useful to limit data collection and to flush coverage data. For information, read:

Limiting coverage data collection
Limit coverage data collection in order to focus on specific parts of your code and save profiling resources.

Flushing coverage data for display in the Coverage Details views
When you flush coverage data, you transfer the data that is being collected to a profiling resource so that it can be displayed in the coverage views. Flushing is performed automatically, but under certain circumstances an additional flush configuration is required. If the Annotated Source and Coverage Monitor views report No data available for display after you have collected line and method coverage data, configure a flush of the coverage data to transfer it to the profiling resource during subsequent runs.

 

Parent topic

Monitoring code coverage to detect untested lines and methods

 

Related tasks

Viewing and analyzing coverage data for lines and methods