
The Coverage API - new with SAP NetWeaver 7.0 EHP2 (SAP_BASIS Release 7.02, delivered with SAP ERP EHP5) - gives you programmatic access to ABAP's technology for measuring code coverage.
The Coverage API lets you precisely control the measurement of code coverage. You can start and stop measurements, specify which users are to be measured, calculate and display coverage results, and work with series of repeated measurements.
The API offers you an alternative to the Coverage Analyzer, transaction SCOV, for collecting and displaying code coverage statistics. See also Differences Between the Coverage Analyzer and the Coverage API.
Intended Uses
The API is intended for these uses:
Instrumentation of test infrastructures for measuring code coverage: Owners of test infrastructures can add code coverage instrumentation to their infrastructures. The test infrastructure can then switch code coverage on and off by itself.
In this way, the infrastructure can collect code coverage statistics that are limited precisely to tests run by the infrastructure. The measurement excludes other activity from the statistics, even if it generated by the test users.
Example: An infrastructure for running integration tests could use the API to switch on code coverage when a user starts a test and then stop it when the test is completed. The measurement excludes other activity in the system by the test user.
Ad hoc measurement of code coverage by developers or quality managers who wish to collect their own code coverage statistics. The API is quite easy to use, so that collecting your own statistics is possible with relatively little effort.
Example: A developer can already use the ABAP Unit Browser to measure the code coverage of ABAP Unit tests. With the Coverage API, a developer can instrument other test programs and can check the code coverage of these programs.