Skip to main content

Running application-level test coverage

2 Tasks

10 mins

Pega Platform 8.7
Visible to: All users
Beginner Pega Platform 8.7 DevOps English

Scenario

As an application developer, capture the test coverage of your Pega Platform™ application. Test coverage metric can be used to understand if there are enough tests in the application to ensure that all the rules of the application run when a developer or their team performs the test. During the testing session of an application, the test coverage feature provides information about the rules that are covered (hit) and not covered (not hit) in that testing session.

As a simple exercise, run a unit test case of one of the rules of your Pega Platform application to capture the Test coverage metrics of the application.

  1. Capture the test coverage by running a test case in a test coverage session.
  2. Generate and then analyze the coverage report to see the details of the covered and uncovered rules.

The following table provides the credentials you need to complete the challenge:

Role User name Password
Application Developer pgpTester rules123!
Note: Your practice environment may support the completion of multiple challenges. As a result, the configuration shown in the challenge walkthrough may not match your environment exactly.

You must initiate your own Pega instance to complete this Challenge.

Initialization may take up to 5 minutes so please be patient.

Detailed Tasks

1 Capture test coverage by running a unit test case

  1. Log in to Dev Studio as the Application Developer:
    1. In the User name field, enter pgpTester.
    2. In the Password field, enter rules123!.
  2. In the header of Dev Studio, click Configure > Application > Quality > Test Coverage to create a new unit test case.
    Test coverage navigation image
  3. Click the Application level tab.
  4. Click Start new session to display the Start coverage dialog box.
  5. In the Title field, enter ChallengeExercise, and then click OK to close the dialog box.
    Start new session under Application level tab
  6. The Application level coverage is in progress message is displayed that indicates the new application-level coverage session started successfully.

    image depicts the coverage started banner.
  7. In the header of Dev Studio, click Configure > Application > Quality > Automated testing > Unit testing > Test cases to run a unit test case to capture the test coverage.
    Pega unit test cases navigation
  8. On the Application: Unit testing landing page, filter the Rule name column to display two rules: Update Experience and Associate business
  9. Select the ActivityStatus checkbox, and then click Run selected to run the test case.
    The Application: Unit testing landing page with the ActivityStatus unit test selected.
  10. After the test case run is completed, on the Application: Unit testing landing page, click Stop coverage to generate the report.
    image depicts the stop coverage banner.

2 Generate and analyze the coverage report

  1. In the results of the coverage session, in the Coverage history section, click Show report to access the coverage report data.
    image depcits the show report link.
  2. On the Covered tab, confirm that the UpdateExperience rule is displayed.
    The coverage report that shows which executable rules in the currently included applications are covered by tests.
  3. On the Uncovered tab, confirm that the rule for which you did not run a unit test case, AssociateBusiness, is displayed.
    The coverage report that shows which executable rules in the currently included applications are notcovered by tests.
Tip: You can use the coverage feature for the entire application. You can run all the test cases for various rules during a test coverage session. As a result, the autogenerated report displays details of all rules that are covered and the rules that are yet to be covered.


Available in the following mission:

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