This topic provides information about how to use SOAtest as part of the Parasoft Application Coverage workflow. For complete information about using the Application Coverage solution, refer to the Collecting Coverage for Web Applications guide. In this section:
The Parasoft Application Coverage solution enables you to measure application code coverage while executing tests against your running applications. This enables you to gauge the effectiveness of your existing test suite, determine where additional tests need to be added, and more efficiently execute tests as the application evolves. You can collect application coverage by utilizing the coverage agent shipped with Parasoft Jtest and Parasoft dotTEST, which allows you to monitor the application as tests are being performed.
Application coverage is obtained by merging static and dynamic (runtime) coverage data into one coverage file and uploading the file to DTP for viewing.
- Static coverage data is collected by Parasoft Jtest or Parasoft dotTEST.
- Runtime coverage data is collected by SOAtest.
- Both coverage types are merged and uploaded to DTP by SOAtest.
The following steps describe the Application Coverage workflow with SOAtest:
- Generating the static coverage file. The static coverage file is generated by Jtest or dotTEST in the .xml or .data format and contains metadata about user classes, methods, and lines.
- Attaching the coverage agent to the application under test (AUT). The coverage agent ships with Jtest and dotTEST, and allows you to monitor the code being executed when the AUT is running.
- Configuring SOAtest to connect to the coverage agent and collect runtime coverage, merge it with static coverage, and upload the data to DTP.
- Executing tests with SOAtest as part of an automated process.
- Reviewing the application coverage on DTP in the Coverage Explorer.
Configuring the Application Under Test for Coverage
Before you start collecting coverage with SOAtest, you need to configure the application under test (AUT) using Parasoft dotTEST or Parasoft Jtest. For details how to perform the following steps, see the Jtest or dotTEST user guide at docs.parasoft.com.
- Generate a static coverage file on a build machine. The file contains metadata about user classes, methods, and lines.
- (Optional) Customize the coverage agent by configuring the coverage agent options. This step is required if you are collecting coverage information for multiple users that are simultaneously interacting with the AUT.
- Attach the coverage agent to the AUT.
Configuring SOAtest to Collect and Upload Coverage
With the proper configuration, SOAtest will collect application coverage during test execution. To configure and execute SOAtest for application coverage data collection:
- Specify the installation directory of dotTEST or Jtest by doing one of the following:
- UI: go to Parasoft> Preferences> Reports> Coverage.
- Command line: set via the localsettings properties "jtest.install.dir" or "dottest.install.dir" as appropriate (see Configuring Localsettings).
- Configure a SOAtest Test Configuration to collect, merge, and upload application coverage data. You can configure an existing test configuration or create and configure a new one (see Creating a Custom Test Configuration).
- Open the Test Configuration that you want to configure to collect application coverage data.
- Open the Execution> Application Coverage tab.
- Enable the Collect application coverage option.
- Under Coverage agent host, specify the hostname or IP address where the application under test and coverage agent are hosted.
- Under Coverage agent port, specify the port number of the agent. The port number should match the value of the
jtest.agent.portsetting in the agent.properties file (default is
- Under Coverage agent protocol, specify whether to connect to the coverage agent using http or https protocol. The default is http.
- (Optional) Under Coverage agent user ID, you can specify a user ID so that coverage results can be associated with a specific user. A user ID should only be specified when the coverage agent is configured to run in multi-user mode. See the DTP Engine documentation for details.
- You can click Test Connection to verify that SOAtest can communicate with the coverage agent.
- Enable the Upload coverage report to DTP option.
- Configure the Static coverage file location option to specify the path to the static coverage file generated with dotTEST or Jtest in the .xml or .data format (see Creating a Custom Test Configuration).
- Configure the Coverage image tags option to specify a set of tags that are used to create coverage images in DTP. A coverage image is a unique identifier for aggregating coverage data from runs with the same build ID. For details, see the Parasoft DTP user guide at https://docs.parasoft.com.
- Enable the Report coverage agent connection failures as test failures option for test failures to be reported when the coverage agent connection fails, or when the static coverage file location is misconfigured. Otherwise, the problems will be reported to the console, but will not cause the test to fail.
- Click Apply to save your changes.
- Configure a SOAtest localsettings file that sets:
- The build ID (build.id) based on how you want to correlate coverage results. If you want to merge SOAtest coverage results with results from other types of testing—such as unit testing and manual testing of the same application—they must all use the same build ID. The build ID set here must match the build ID set for dotTEST or Jtest when collecting the static and dynamic coverage files and uploading the coverage data.
- The project (dtp.project). This value must match the dtp.project value that will be set for dotTEST or Jtest when collecting the static and dynamic coverage files.
Executing Tests to Collect and Upload Coverage
Run your tests in command line mode using the Test Configuration and localsettings file you have configured (see Configuring SOAtest to Collect and Upload Coverage). This step should be part of an automated process.
Reviewing Coverage in DTP
Go to DTP and open the Coverage Explorer to review the application coverage achieved by your SOAtest tests. For details on using the Coverage Explorer, see the Parasoft DTP user guide at https://docs.parasoft.com.