Editing code coverage configurations

When you right-click a program and select one of the code coverage options, a code coverage configuration is created and may be opened directly. You can edit these configurations to further control the code coverage process.

Procedure

  1. Open the code coverage configuration, if necessary. Code coverage configurations are created and opened directly if you right-click a program and select the Code Coverage (Prompt) option. However, if you choose Code Coverage As the configuration will simply be created without opening. If you create a service entry point, a configuration is created if you right-click the service entry point and select Open Launch Configuration. If the configuration is not open, select Run > Compiled Code Coverage Configurations and select your configuration from under the appropriate section:
    Batch configurations
    IBM i: Code Coverage Batch Application
    Interactive
    IBM i: Code Coverage Interactive Application
    Service entry point (batch or interactive)
    IBM i: Incoming Remote Code Coverage Session
    Configuration categories
  2. Edit the configuration. If you created a configuration by right-clicking a program and selecting one of the code coverage options, the basic details for the configuration have already been added. If necessary, you can further modify the configuration:
    1. What to Analyze page.
      Connection
      Set or change the RSE connection.
      Programs or service programs to be analyzed for code coverage
      Ensure that your main program is selected. Add any additional programs that are called by your main program.
      Debug view used for code coverage analysis

      Select the debug view (either *SOURCE or *LIST) to use for code coverage analysis. The *SOURCE view will only provide coverage for the statements that appear in the main source member. If some executable statements are included by /COPY or /INCLUDE directives, coverage for those statements can only be detected with the *LIST view. If your program does not contain a *LIST view, compile the program again with DBGVIEW(*ALL) or DBGVIEW(*LIST).

      If your program was compiled with only a *SOURCE debug view, you should only select *SOURCE. If your program was compiled with only a listing view, you should only select *LIST. If your program was compiled with all the debug views, you may select either *SOURCE or *LIST. If your program contains embedded SQL and you compiled the program with DBGVIEW(*SOURCE), your program will contain all the debug views. Otherwise, consult the help for the DBGVIEW parameter of your compile command to find out which debug views your program has.

      Update production files
      If selected, the application under analysis will be allowed to update database records in production libraries.
      Analyze page
    2. How to Start page. Use this page to specify the IBM i command for submitting your application.

      The Prompt button provides a convenient way of supplying job parameters. The analyzer will use the HOLD(*YES) parameter for the SBMJOB command. The parameter INQMSGRPY(*DFT) is used for code coverage of batch programs, by default.

      If you checked a program in the list of programs and service programs you want to analyze for code coverage in What to Analyze, or if you chose the application to analyze for code coverage from the Remote Systems or Object Table views, a command to call the specified program will be created for you. You can edit this command, if necessary.

      How to start page
    3. Source page. Define the source lookup path.
    4. Common page. Set if the launch configuration is shared, which favorites menu it will be displayed in, output and encoding options and whether to launch the configuration in the background.
    5. Code Coverage page.
      • Specify the Code Coverage Level. By default, code coverage is run at the line level. However for performance reasons, you may want to run code coverage at the procedure level.
      Code coverage page
  3. Click Apply to save the configuration. Click Coverage if you want to start the session. Note that for code coverage sessions that use service entry points, the Coverage button is grayed out. If a service entry point is set, the session will start automatically when the program is called.

Feedback