Skip to main content

Test coverage metric

Test coverage is a metric that provides details about the code that you cover when you test it. You can use this metric to understand if you have enough tests to ensure that the entire application code runs when you or your team perform the test.

In Pega Platform™, during the testing session of a code, the test coverage feature provides information about the rules that are covered (hit) and not covered (hit) in a testing session. The testing activity can be a combination of running automated tests, such as Pega unit tests, Pega scenario tests, Selenium tests, and manual tests.

Check your knowledge with the following interaction:

The test coverage feature in Pega Platform supports 26 rule types, as shown in the following figure:
 

The executable rules in Pega Platform test coverage

The rules that belong to these 26 rule types are executable rules. Test coverage metrics are generated by the users only for the executable rules and not every rule of your Pega Platform application.

Check your knowledge with the following interaction:

Note: A rule is covered if you invoke it at least once during the testing.

Using the test coverage tool, you can generate the following types of test coverage reports for your Pega Platform application:

User-level test coverage report

The user-level test coverage report identifies which executable rules that are covered and not covered by tests that you perform in a single user session. Use this report to test your Pega Platform application against a set of test cases, but when you do not want this report to display the report results on the application quality dashboard. You typically generate this type of report during a single test session.

Application-level test coverage report

The application-level test coverage report identifies which executable rules are covered and not covered by tests that you perform among multiple user sessions. Use this report to do regression testing of your Pega Platform application against a set of test cases, but you also want to display the report results on the application quality dashboard. One or more users in a single test session or multiple test sessions typically generate this type of report.

Check your knowledge with the following interaction:

Test coverage session configuration

To begin a test coverage session, configure applications against which you want to measure test coverage.

You can configure the applications in the Application quality settings page in Dev Studio by clicking Configure > Application > Quality > Settings.  

By default, the system selects your logged-in application as Current application only. You can change this choice to Include built-on applications, and then select the required applications for which you want to measure test coverage, as shown in the following figure:

Application quality settings with the Current application only radio button selection

Along with configuring the applications for coverage, to generate an application-level test coverage report, you need the pzStartOrStopMasterAppRuleCoverage privilege. 


This Topic is available in the following Module:

If you are having problems with your training, please review the Pega Academy Support FAQs.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Academy has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice