About Automated Unit Testing |
With Automated Unit Testing, you can simplify and increase the speed of unit testing certain aspects of your PRPC applications. As a result, you can be more agile about determining when corrective action is necessary within your development process.
For example, a typical situation has an application with a number of work item types and the flows that process those work items, and subsequent development work makes changes to one of those flows. Those intended changes made to one flow might have unintended impacts on the other work item types and flows of the application. In this type of situation, the ability to efficiently unit test for unexpected results and assess the extent of the impacts is important, so that corrective action can be taken if the new behavior is not desired. Automated Unit Testing provides the ability to quickly discover and address such unanticipated effects.
For examples and additional information, see PDN article 25092 About Automated Unit Testing, which links to additional articles.
If your operator ID has the AutomatedTesting privilege through an access role, you can use Automated Unit Testing to perform and automate unit testing of the following rule types:
You can:
An operator ID has the AutomatedTesting privilege when the privilege is assigned in at least one of the access roles that are listed in the operator's associated access group. Use one of the following methods:
If you are unable to modify your operator ID's access group or to modify your access role or create a new one, you might not have the system authorities to perform those operations; contact your system administrator.
To add the PegaRULES:AutoTest access role to your access group, open the access group form, add a new line to the Roles array, select PegaRULES:AutoTest in the new line, and save the form. See Access Group form — Completing the Layout tab.
To obtain the AutomatedTesting privilege by adding it to your existing role or to a new role:
Creating a new access role in this step provides the way to assign the AutomatedTesting privilege to your operator ID (see About the Access Role Editor).
At the end of this step, the elements of the access role are displayed in a new window.
@baseclass
in the Add a class field and clicking Add.AutomatedTesting
in the Add a privilege field and click Add.2
.If you created a new access role in the preceding steps, add it to your access group:
After logging back in, verify that you have the AutomatedTesting privilege by selecting > Application; see if the Automated Unit Testing landing page appears in the list. If not, check with your system administrator.
To work with the individual test cases for a specific rule, use the Test Cases tab of the rule form for that rule.
Test cases save both the test data and the results of that test data. When you run a test case, PRPC uses the saved test data to run the rule and then compares the results to those saved in the test case. If the results do not match, you investigate the tested rule to see what changed and determine whether there is a problem to be resolved.
A unit test suite is a group of test cases that you want to have running together. Whether you want to run a unit test suite only once or schedule it to run periodically, you use the Schedule landing page tab on the Automated Unit Testing landing page to run a unit test suite. The unit test suite runs as a background process. An agent activity in the Pega-AutoTest agents rule checks for unit test suite requests every five minutes and runs those that are due. When the agent activity finishes running a unit test suite, it sends an email message with the results to the person who scheduled the request.
Pegasystems offers an optional application to support testing, known as the Test Management Framework. Contact your Pegasystems representative to learn more.
Test Management Framework | |
About Test Cases
About Unit Test Suites Understanding the Pega-AutoTest agents |