Designer 10.7 | webMethods Unit Test Framework Help | Code Coverage Analysis | Running a Coverage Analysis
 
Running a Coverage Analysis
Unit Test Framework allows you to record and analyze which flow steps and map actions of your flow service(s) are executed during a particular test launch. It helps to identify untested steps and improve the corresponding tests.
Pre-requisites:
Before running the test coverage analysis, activate the wM Code Coverage Agent. You can activate the wM Code Coverage Agent either through Designer or Integration Server startup script or Microservices Runtime startup script.
*Through Designer
Perform one of the following steps to activate the wM Code Coverage Agent:
*On the Package Navigator, right-click the default Integration Server instance, and select wM Code Coverage Agent > Activate.
OR
1. In Designer, navigate to Window > Preferences > Software AG > Integration Server, and select the default server.
2. Click wM Code Coverage Agent.
3. On the wM Code Coverage Agent Settings dialog, select Activate.
*Through the Integration Server startup script or Microservices Runtime startup script.
Perform one of the following steps to activate the wM Code Coverage Agent:
*Integration Server
*If Integration Server launches using the Tanuki Java service wrapper in the startup script, configure the Java agent in custom_ wrapper.cnf as follows: wrapper.java.additional.400=-javaagent:$IntegrationServer_packages_location/WmServiceMock/​resources/​int/utf-agent.jar=log=level=INFO.
Replace $IntegrationServer_packages_location with the absolute path of Integration Server packages.
Note:
Software AG recommends that any new custom properties added to custom_wrapper.conf be assigned a number of 400 or higher to prevent conflicts with properties added by Software AG.
*If Integration Server launches without using a wrapper, configure the Java agent settings in the Integration Server_directory/bin/setenv.bat(sh) file as follows: JAVA_OPTS="-javaagent: $IntegrationServer_packages_location /​WmServiceMock​/resources/int/utf-agent.jar=log=level=INFO".
Replace $IntegrationServer_packages_location with the absolute path of Integration Server packages.
*Microservices Runtime
If Microservices Runtime launches using the startup script, configure the Java agent settings in the Integration Server_directory/bin/setenv.bat(sh) file as follows:
*PROFILER_ENABLED=false
*JAVA_PROFILER_OPTS="-javaagent: $IntegrationServer_packages_location /WmServiceMock/resources/int/utf-agent.jar=log=level=INFO".
Replace $IntegrationServer_packages_location with the absolute path of Integration Server packages.
*To run a test coverage analysis
1. In the webMethods Tests section, right click and select wM Code Coverage Tools.
2. Select one of the following:
*Run Suite: executes the selected test suite.
*Run Suite with Mocks disabled: executes the selected test suite with Mocks disabled.
*Run Tests: executes the selected test case.
*Run Tests with Mocks disabled: executes the selected test case with Mocks disabled.
The test or suite coverage analysis appear as a graphical data under the wM Code Coverage view.
You can generate code coverage reports using the default maximum memory size specified in Integration Server. This report effectively handles the Test Suite containing more number of lines of code and test cases for a service. If a service comprises an exceptionally high number of lines of code or tests executed in a single test execution session, Integration Server must upgrade the default maximum memory size.