Show TOC

Displaying Code Coverage in the ABAP Unit BrowserLocate this document in the navigation structure

Procedure

Requesting Code Coverage for a Favorite in the ABAP Unit Browser

Use ABAP Unit Favorites to display the code coverage of your unit tests in isolation from all other code coverage results.

  1. Start the ABAP Unit Browser, set the Selection Criteria field to Favorite, and double-click on a favorite to display it in the tool area of the screen.

  2. Choose Enter / Leave Edit Mode in the Browser tool bar to switch into edit mode.

  3. Choose Show / Edit Options from the Browser tool bar.

  4. In the Additional Options field, use the values help to choose C Coverage Measurement.

  5. Confirm the change with the Continue button and save your changes.

When you run the favorite, then the ABAP Unit Browser displays a link in the results for starting the coverage display.

Requesting Code Coverage for a Program, Package or Other Type of Object Selection

  1. Start the ABAP Unit Browser, set the Selection Criteria field to the type of object you want to test, and select and display the object.

  2. Call up the context menu (right click) of the object in the Component / Object tree display.

  3. Choose the menu item Execute and measure coverage.

    The ABAP Unit Browser displays a link in the results for starting the coverage display.

Note

The Coverage Analyzer must be activated in your system, or no code coverage statistics will be recorded. Requesting code coverage from the ABAP Unit Browser affects only the possibilities for displaying the statistics, not the recording of the statistics.

Displaying Code Coverage

To display the code coverage of your unit tests, do the following:

  1. Click on the code coverage link in the Alerts and Messages window.

    The ABAP Unit Browser opens a second link in the Information window. (If there were no errors in the ABAP Unit test, then the link in the Information window will already be shown.)

  2. Click on the link in the Information window.

  3. The ABAP Unit Browser displays the code coverage results. The results show a subset of the fields shown by the Detail Display in the Coverage Analyzer itself (transaction SCOV).

    Note

    Running your ABAP Unit tests by defining and executing Favorites is especially useful, because the code coverage display for favorites shows the results in isolation from other code coverage results. The Favorite display shows only the code coverage of the unit tests that just ran, uncontaminated by any other code coverage results already recorded by the Coverage Analyzer.

    By contrast, if you run unit tests by selecting a program or package, then the code coverage display shows all of the available current results for the programs that you tested. You won't be able to see the code coverage of your unit tests unless you first reset the results in the Coverage Analyzer (transaction SCOV).

    Here is help with understanding the code coverage results as presented by the ABAP Unit Browser.