Running an Application with Code Coverage

Note: This facility is supported in native COBOL only.

Having enabled code coverage for one or more projects in your solution (see Enabling Code Coverage), you need to execute the application in code coverage mode in order to generate the coverage data. There is a different approach to this depending on whether or now the application requires an enterprise server to run.

To run an application does not require an enterprise server in code coverage mode:

  1. In the IDE, ensure code coverage is enabled in your project's properties.
  2. Click Debug > Start With Micro Focus Code Coverage.

    If you have not compiled your application with the latest changes, the IDE first rebuilds the project. The IDE then starts the application in debug mode.

    Note: If none of the projects in your solution have Enable code coverage checked in its properties, the IDE displays a warning that you need to enable this setting. If you continue running the application without Enable code coverage checked for a project in the solution, no code coverage reports are produced.
  3. Step through your application in the usual manner.
  4. When you have finished running the application or have finished debugging, stop the debugger.

    After the execution stops, the IDE automatically opens the Micro Focus Code Coverage window that shows the statistics about what percentage of the code has executed. The code in the editor is colorized to indicate covered and missed blocks.

To run an application that requires an enterprise server in code coverage mode:

  1. In the IDE, ensure code coverage is enabled in your project's properties.
  2. Build your solution.
  3. Right-click the server in Server Explorer and click Start with Code Coverage.
  4. Execute your application in the usual manner.
  5. Right-click the server in Server Explorer and click Stop and generate code coverage results.

    After the execution stops, the IDE automatically opens the Micro Focus Code Coverage window that shows the statistics about what percentage of the code has executed. The code in the editor is colorized to indicate covered and missed blocks.

See Viewing the Code Coverage information.