Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

You can monitor and collect coverage data from .NET managed code during manual or automated functional tests performed on a running web application that is deployed on IIS server. You can also send coverage data and test results to DTP. The application coverage information can be displayed in the DTP Coverage Explorer (see the "Coverage Explorer" chapter in the DTP user manual), which provides insights about how well the application is tested, as well as the quality of your tests.

Info
iconfalse
title.NET Core Web Applications

dotTEST does not support collecting coverage for .NET Core web applications that are deployed on IIS server. See Application Coverage for Standalone Applications for instructions about how to collect coverage for .NET Core web applications with the coverage.exe tool shipped with dotTEST.

Prerequisites

The following components are required for collecting coverage:

...

OptionValueDescription
-scope [path]A path to the scope configuration file. Required if the scope is other than the default; see Customizing Scope of Coverage.
-agentTimeout[miliseconds]

Specifies the timeout for connection with the Coverage Agent. Adjust the timeout to your machine capabilities. The default value is 1500 ms.

Info

If you provide 0 or a negative value, the connection attempt will not timeout, which may lead to a considerable slowdown or hang the tool.

-port[port number]Specifies the port number when you start dottest_iismanager if the default port is unavailable.
-multiuser
Enables collecting coverage information for multiple users; see Collecting Coverage from Multiple Users.
Info
iconfalse
titleTest Configuration and Execution with SOAtest

You can use SOAtest to run functional tests (refer the Application Coverage chapter of the SOAtest documentation to set up the test configuration), as well as execute manual tests. At the end of the test session, coverage will be saved in runtime_coverage_[timestamp].data files in the directory specified in SOAtest. This information will eventually be merged with the static coverage data to create a coverage.xml file and uploaded to DTP.

...

Uploading Test Results to DTP

...

  1. Ensure that dotTEST is properly configured, including DTP, scope and authorship settings. See Connecting to DTP 1Sending Results and Publishing Source Code to DTPConfiguration.
  2. Configure the following settings in the dottestcli.properties file in order to properly merge coverage data:
    report.coverage.images -  Specifies 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. DTP supports up to three coverage images per report.
    session.tag - Specifies a unique identifier for the test run and is used to distinguish different runs on the same build.
    build.id - Specifies a build identifier used to label results. It may be unique for each build, but it may also label several test sessions executed during a specified build.
  3. Copy the runtime coverage and static coverage files to the same machine and run dottestcli with the following switches:

    • -runtimeCoverage: Specifies the path to runtime coverage that you download with CAM (see Coverage Agent Manager (CAM) section of the DTP documentation for details). You can provide a path to an individual .data file with coverage information from one testing session, or a path to a folder that contains many .data files from multiple testing sessions.
    • -staticCoverage: Specifies the path to the static coverage file (see Generating the Static Coverage File).
    Code Block
    dottestcli.exe -runtimeCoverage [path] -report [path] -publish -settings [path] -out [path] -staticCoverage [path]

...

  • You can download coverage information that was collected in a test session. Coverage data collected when no test session was active cannot be downloaded.
  • If multiple users are simultaneously accessing the same web application, the coverage data they collect may be mixed. To ensure that coverage is properly associated with individual users, the multiuse multiuser mode must be enabled (see Collecting Coverage from Multiple Users).
  • The HTTP or HTTPS protocols are required to enable the multiuser mode, as the user-specific information must be provided within the HTTP header.
  • In the multiuser mode, collecting coverage for WCF-based applications requires that they have the ASP.NET compatibility mode enabled.
  • In the multiuser mode, the "default" user (the user who has not specified their ID) may collect extra coverage information from other users who are accessing the same web application.
  • In the multiuser mode, assigning coverage collected for multithreaded application to individual users is limited. Coverage data for child threads is not assigned to the user who is actually accessing the application, but to the "default" user.
  • Coverage data collected web initialization is not assigned to a specific user, but to the "default" user.
  • The application coverage scope file cannot be used for WebSite projects as they may get recompiled by IIS Server and change the name of the target assembly. Scope files can be safely used for Web Applications.
  • dotTEST does not support collecting coverage for .NET Core web-based applications. As a workaround, use the the coverage.exe tool, as described in Application Coverage for Standalone Applications.