Introduction
Connecting to DTP allows you to obtain the network license and send local analysis data to a centralized database. You can send the following information:
- Static Analysis and Metrics results (including suppression details)
- Unit Testing results (including traceability information)
- Coverage statistics (for all coverage types)
- Coverage details (for line coverage)
DTP aggregates, analyzes, and prioritizes the data to help you optimize development processes, focus on the impact of changed code, and demonstrate full compliance traceability. See About the Parasoft Development Testing Workflow for details.
Connecting to DTP in the GUI
To connect Parasoft C/C++test to a Parasoft DTP server:
- In your IDE, click Parasoft in the menu bar and choose Options (Visual Studio) or Preferences (Eclipse).
- Choose DTP.
Enable the Enable option to activate the server settings.
Base URL Specify the DTP server Base URL. If DTP is deployed to a location other than the root of the host server, the URL should include a context path (a relative path from the host name; for example: https://mydtp.mycompany.com:8443/contextPath). This may be the case if your organization uses a reverse proxy. Refer to the DTP documentation for additional information about reverse proxy server configuration and context path configuration.
User name Specify your DTP user name. Contact your DTP administrator if you do not have access. Enable the Default option to use your machine name login. Password Specify your DTP password. Contact your DTP administrator if you do not have access. Click Test Connection to verify your configuration.
If you use OpenID Connect for authentication on DTP, provide the Base URL of your DTP server, then configure the connection with the OpenID Connect server; see Configuring OpenID Connect in the UI. When you successfully connect to your OpenID Connect server, the DTP page will automatically display the information.In the Project area, click the Configure button to open a dialog with all projects that are available in DTP and select the project you are currently working on.
The active license is displayed in the License area. Depending on the license type, the license may be automatically configured when the connection to DTP is established. Click the Configure link to manually configure your license options if applicable.
In the Reports area, check Enable reporting results to DTP to enable sending static analysis findings, unit test results and coverage information to DTP.
To publish reports to DTP, a valid license with one of the following options is required: DTP Publish or Automaton.
You can click the Edit link to configure advanced report settings(key=value)
:- Click OK to save the settings.
Configuring OpenID Connect in the GUI
DTP ships with support for OpenID Connect user authentication (see the DTP User Guide for details). If OpenID Connect is enabled for your DTP server, you must configure C/C++test to authenticate users via OpenID Connect.
- In your IDE, click Parasoft in the menu bar and choose Options (Visual Studio) or Preferences (Eclipse).
- Choose OpenID Connect.
- Check Enable.
- Configure the following options:
Issuer URI: The URI of your OpenID Connect server.
Client ID: The ID registered on your OpenID Connect server.
Client Secret: The application's password to the OpenID Connect server.
Scopes: A space-separated list of scopes used during authentication to authorize access to a user's details.
Callback host: The local callback host required to communicate with the OpenID Connect server. The following options are available:
- localhost: The localhost address will be used for communication.
- 127.0.0.1: The loopback IP address 127.0.0.1 will be used for communication.
Callback port: The callback port number for communication with the OpenID Connect server. The following options are available:
- Automatically select an open port: Automatically selects an open port (recommended).
- Use port: Allows you to manually specify the port number.
Callback timeout: Specifies, in seconds, the maximum time the browser will wait for user credentials (see step 6). - Click Test Authentication or Apply to open the OpenID Connect authentication page in your browser.
- Provide your credentials in the browser window that opens. The authentication page may resemble the following:
- Close the browser window when the authentication confirmation is displayed and continue in your IDE.
- Click Apply to apply the changes.
The Status panel displays the current OpenID Connect authentication status.
Connecting to DTP in the Command Line
To configure the connection to DTP when you perform testing with C/C++test in the command line mode:
- Specify the connection settings in a custom
.properties
file. Provide the path to the
.properties
file with the-settings
command line option:cpptestcli -settings [PATH_TO_.PROPERTIES_FILE]
Required Settings
The following settings are required to configure the connection:
dtp.enabled=true
- Enables the connection to DTP server.dtp.url=[URL]
- Specifies the URL to the DTP server.dtp.user=[USERNAME]
- Specifies the username for DTP server authentication.dtp.password=[PASSWORD]
- Specifies the password for DTP server authentication.report.dtp.publish=true
- Enables reporting results to DTP server.
Optional Settings
dtp.project=[NAME]
- Specifies the name of the DTP project.build.id=[IDENTIFIER]
- Specifies a build identifier used to label results.session.tag=[TAG]
- Specifies a tag for signing result from the test session.dtp.additional.settings=[KEY1\=VALUE1\nKEY2\=VALUE2...]
- Specifies advanced settings for reporting results to DTP.
Configuring OpenID Connect in the Command Line
DTP ships with support for OpenID Connect user authentication (see the DTP User Guide for details). If OpenID Connect is enabled for your DTP server, you must configure C/C++test to authenticate users via OpenID Connect.
Configure the following settings in the .properties
file where the connection to your DTP server is configured.
If device code authentication will be used (default):
oidc.enabled=true
- Enables user authentication via OpenID Connect.oidc.cli.mode=devicecode
- Specifies the method that will be used to authenticate the user on the OpenID Connect server. See Using Device Code Authentication.oidc.issuer.uri=[URI]
- Specifies the URI of the OpenID Connect server where your DTP is registered.oidc.client.id=[ID]
- Specifies the ID provided by your OpenID Connect server.oidc.client.secret=[PASSWORD]
- Specifies the password provided by your OpenID Connect server.oidc.scopes=[list of scopes]
- Defines a space-separated list of scopes, which are used during authentication to authorize access to a user's details. The default is:openid profile offline_access
.oidc.keystore=[PATH]
- Specifies the path to the keystore file that stores the certificate to authenticate the user on the OpenID Connect server.oidc.keystore.password=[PASSWORD]
- Specifies the password to the the keystore file that stores the self-signed client certificate.oidc.devicecode.token.file=[PATH]
- Specifies the path to the custom token file containing user authentication information
If certificate authentication will be used:
oidc.enabled=true
- Enables user authentication via OpenID Connect.oidc.cli.mode=certificate
- Specifies the method that will be used to authenticate the user on the OpenID Connect server.oidc.issuer.uri=[URI]
- Specifies the URI of the OpenID Connect server where your DTP is registered.oidc.client.id=[ID]
- Specifies the ID provided by your OpenID Connect server.oidc.client.secret=[PASSWORD]
- Specifies the password provided by your OpenID Connect server.oidc.keystore=[PATH]
- Specifies the path to the keystore file that stores the certificate to authenticate the user on the OpenID Connect server.oidc.keystore.password=[PASSWORD]
- Specifies the password to the the keystore file that stores the self-signed client certificate.
We highly recommend that you use an encoded password to ensure successful authentication and increase the level of security; see Creating an Encoded Password.
See OpenID Connect Settings for details.
Creating an Encoded Password
C/C++test can encrypt your password, which adds a layer of security to your interactions with DTP. Run the following command to print an encoded password:
-encodepass [your password]
Copy the encoded password that is returned and use it to configure the connection in the .properties
file. Examples:
dtp.password=[your encoded password
]oidc.keystore.password=[your encoded password]
Using Device Code Authentication
If "devicecode" mode is enabled, the verification URI with user code is printed on the C/C++test console. The user must use this URI and code to authenticate. If the authentication is successful, the information is saved to a token file (the path to the file is stored in the oidc.devicecode.token.file setting) and reused each time C/C++test is run. If the information saved in the file becomes invalid, the user will need to authenticate again.
About the Parasoft Development Testing Workflow
In addition to providing licensing and shared assets for testing and analyzing your software under development, Parasoft DTP collects and merges data points from Parasoft tools, third-party analysis tools, and external systems, such as bug tracking and requirements tracking systems. It aggregates and prioritizes data, as well as performs additional analysis to help you optimize development processes. Using your code analysis and test execution tool with DTP enables you to consistently apply quality practices across teams and throughout the SDLC.
The following illustration shows the general workflow.
Integrating Parasoft Tools with the Build
Parasoft tools ship with plugins for integration with your build tools (i.e., Maven, Ant, Gradle, MS Build, make, etc.). These integrations allow you to analyze code and send data to DTP automatically as part of the automated build processes and continuous integration (CI).
Capturing Observations
When the analysis tool is running, it captures massive amounts of detailed data associated with the code referred to as “observations.” Observations are code quality data, such as static analysis violations, unit test failures, metrics, etc., as well as logistical information about the code, such as authorship, scope, and source control location.
Converting Data into Findings
When observations are sent to DTP, they are converted into “findings” and stored in the database. Findings are observations that have been analyzed, normalized, and aggregated into actionable data.
Importing DTP Findings to the Desktop
You can import priorities and filtered findings from DTP directly into your IDE so that issues can be addressed.
Continuing the Cycle
When you check code back into source control, the continuous integration process picks up the change, and the workflow is repeated. This ensures that defects are detected and prevented from becoming software bugs later in the development process when the costs of remediation are much higher.