Show TOC

Coverage Analyzer: Overview of FunctionsLocate this document in the navigation structure

Use

The Coverage Analyzer is a tool for tracking the execution of procedures, branches, and statements in ABAP programs.

The code coverage statistics collected by the Coverage Analyzer reveal which procedures, branches, and statements in ABAP programs have been executed. And they reveal how many run time errors occurred while the Coverage Analyzer was active.

With the code coverage tracking performed by the Coverage Analyzer, you can view statistics on the execution of code in ABAP production, test, and development systems. You can analyze how your code is run at the level of procedures, branches, and statements.

With these capabilities, you can do tasks such as the following:

  • Generate code coverage profiles in production systems in order to analyze how code is used by production users.

In programming environments other than ABAP, it is often necessary to link in special libraries or even to set up a special system for measuring code coverage. Often, you cannot collect code coverage statistics in normal development systems, not to speak of production systems.

A major advantage of the ABAP Coverage Analyzer is that it is available in every ABAP system as of Release 6.40. Further, it has so little impact on performance that you can activate it routinely in development and test systems and even in production systems.

Features

The Coverage Analyzer provides not only instrumentation for recording code coverage. It also provides a transaction ( SCOV) for managing and configuring code coverage measurement and for displaying aggregated results and results in detail.

The administration functions let you do the following:

  • Activate the recording of aggregated histories of code coverage for use in the Global Display. You can specify how frequently snapshots of code coverage are stored in a history. You can also create new history versions for analyzing trends in code coverage.

  • Create test groups. The Coverage Analyzer stores statistics separately for the users in a test group. This means that you can display the code coverage of the users in a group in isolation from the code coverage measurements for other test groups or the system as a whole. And you can reset code coverage for the test group without affecting other sets of statistics.

    The Coverage Analyzer has the default test groups ALL and COND:

    • ALL always records the code coverage of all users in a system, even if those users are also registered to test groups.

    • COND shows the combined code coverage from the local system and remote ABAP systems.

  • Reset code coverage for a particular test group or for the entire system. With this feature, you can re-start code coverage measurement, for example, at the start of a new test cycle. Aggregated statistics in history versions are not affected.

    You can coordinate a reset with the start of a new history version in order to have comparable histories for analyzing code coverage trends.

  • Set standards for deciding whether code coverage is adequate - that is, whether a program is rated as green, yellow, or red with respect to the extent of code coverage. This feature lets Quality Assurance and Development agree on the standards for code coverage.

  • Combine the code coverage from the local system with that of other systems.

    If, for example, you run automated tests in one Quality Assurance system and manual tests in another, then you can use this feature to create a combined view of code coverage. The statistics, which are held in test group COND, let you see the total code coverage that you have achieved, across systems.

  • Monitor the activity of the Coverage Analyzer. If problems occur, the Coverage Analyzer writes alerts to its monitor.

  • Run consistency checks to verify that the Coverage Analyzer can correctly record code coverage statistics.

The Coverage Analyzer offers two displays in transaction SCOV. Both displays map code coverage from the processing blocks, with which the Coverage Analyzer instrumentation works, to human-readable classes, programs, and function groups.

The Global Display shows the aggregated statistics recorded in histories and offers these features:

  • Both graphical and numeric displays of code coverage, aggregated to the level of the packages in the system.

  • Three different views of the history data. You can organize the data by author, by package, or according to the SAP Component Hierarchy (not available in customer systems). The Global Display can use CRM personnel data (from table CRMAHR) to structure the author and package displays according to your organizational hierarchy.

  • The ability to switch the display from one history to another. You can also download selected records from a history to a spreadsheet for purposes of reporting or trend analysis.

The Detail Display shows the raw code coverage results. You can drill down from classes or programs to methods, form routines, and other processing blocks. You can drill down further to see the actual code coverage of statements and control structures in your code.

The ABAP Unit Browser offers a special version of the Detail Display. When you use Favorites in the Browser to run unit tests, you can display the code coverage of the unit tests directly from the Browser. The statistics reflect ONLY the code coverage generated by the unit tests that were just run.