In the Profiling tab (Overview subtab) of the Profile dialog box,
select the Code Coverage - Method and Line Level profiling
set. (A Code Coverage - Method Level profiling
set is also provided, but it collects only method-level coverage data for
display in the Coverage Statistics view.)
Click Profile to start your application.
Exercise the parts of your application for which you want to monitor
coverage. You can now stop 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 data set and is also automatically merged at the host level
and above with data collected in earlier runs. To display the host-level profiling
resource, open the Profiling Monitor drop-down menu; clear 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.
It is sometimes useful to limit data collection, to flush coverage
data, and to collect hit count data. For information, read:
Limiting the collection of coverage data
You can limit the collection of coverage data by using filters to select packages, classes, or methods to include or exclude. By limiting which data is collected, you can 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 coverage
data for lines and methods, configure a flush of the coverage data to transfer
it to the profiling resource during subsequent runs.
Collecting hit-count data in coverage reports
You can create or edit profiling configurations that collect data not only on whether a method or class is covered, but on the number of times it has been exercised. This topic describes how to set this up for an existing profiling configuration, but you can also set this up when you first create the profiling configuration.