Generating code coverage in headless mode using Remote Debug Service

To run code coverage in headless mode using Remote Debug Service, ensure that Remote Debug Service is started and configured with code coverage collection options, and the settings of the application are specified to connect to Remote Debug Service.

Before you begin

Note: Remote Debug Service is only available with IBM® Developer z/OS® Enterprise Edition and IBM Z and Cloud Modernization Stack (Wazi Code).
  • Ensure that Remote Debug Service is running with code coverage collection enabled. If not, ask your system programmer to configure as instructed in Customizing with the sample job EQARMTSU and start Remote Debug Service.
  • Obtain the port for local connections for Remote Debug Service from your system programmer.
  • Obtain the port configured for Code Coverage Service and find whether CCS is secured. If Remote Debug Service is running on a secured port, then CCS also needs to run on a secured port.
  • Obtain the root directory where Remote Debug Service writes code coverage results from your system programmer. By default, results are stored in $HOME/CC/user_ID, where $HOME is the home directory of the user running Remote Debug Service. A different directory root_location/user_ID might be used if otherwise specified by the system programmer.

Procedure

  1. Configure for Remote Debug Service with either a debug profile or the TEST runtime option:
  2. Start the application. Remote Debug Service then runs the code coverage session and the result will appear in the home directory. You can find the results in a subdirectory with the same user ID that ran the application.

What to do next

To review the code coverage result, you can use the -e=CCPDF option in your startup key to generate a PDF or use the Code Coverage Results view in the Eclipse IDE.

Viewing the report in the Code Coverage Results view

Procedure

To view the code coverage report in the Eclipse IDE, complete the following steps:

  1. Open the Code Coverage Results view.
  2. Add a result location.
    • If Code Coverage Service is configured, specify the URL in the following format.
      • Secured connection: https://<ip_address_or_name_of_zos_system>:<port>
      • Unsecured connection: http://<ip_address_or_name_of_zos_system>:<port>

      If Remote Debug Service and Code Coverage Service are secured with an untrusted certificate, you are prompted to accept the certificate before accessing any results. You will also be prompted for your z/OS credentials to access Code Coverage Service. For more information, see Working with result locations.

    • Alternatively, or when Code Coverage Service is not configured, specify the z/OS UNIX directory that the system programmer used to configure Remote Debug Service concatenated with your user ID in the path, i.e., <path_provided>/user_ID.

    If Remote Debug Service is configured to output code coverage data to /shared/ccResults and user PAULB is used to run a code coverage session, the results are stored in directory /shared/ccResults/PAULB. For more information, see Working with result locations.

    If the results do not appear, check the following:
    • Ensure that the application ran to completion.
    • In Code Coverage Results view, refresh your location. Remote and CCS locations are not automatically refreshed.
    • If you are not using Code Coverage Service, check with the system programmer that you have permission to the code coverage output directories and files.
  3. Double-click the result to view the report. For more information about viewing reports, see Generating and working with web-based reports.