Test Coverage in Pega
Objective
The objective of this Test Coverage mechanism is to provide a reliable, design‑time approach for determining how effectively test suites validate the underlying Pega application rules. By leveraging the rule reference mechanism, this process identifies all rules exercised (directly or indirectly) by the test cases, enabling accurate measurement of coverage without requiring test execution.
Key Concept
Test suites consist of multiple test cases, and each test case references one or more rules. By using Pega’s rule reference mechanism, the system can recursively expand these references to identify all underlying Pega rules that are touched by the test suite. This forms the basis of the design‑time Test Coverage calculation.
Test Coverage Mechanism
-
Retrieve Test Suites
Identify all relevant test suites within the application. -
Enumerate Test Cases
For each test suite, list all associated test cases. -
Resolve Referenced Rules
For every test case, trace the rule it references and recursively invoke the rule reference mechanism until all underlying Pega rules are discovered. -
Identify Unique Covered Rules
Consolidate the resolved rules and remove duplicates to obtain the unique set of covered rules.
Calculation Logic
-
Covered Rules
Count of all unique rules identified through recursive rule reference resolution from all test cases. -
Executable Rules
Determined by running a rule‑type report for the application using rule resolution. -
Exclusions
The report excludes non-executable artifacts such as:
• Any Rules in Testing Ruleset such as Test cases, Test Suites, Pre and post Test case execution Rules
This ensures that the denominator reflects only true executable rule types.