Testing Pega applications Accelerating delivery using DevOps practices for Pega applications

Feb 6 2018 | Linoy Alexander Agenda

• Testing methodology • PegaUnit • Scenario testing • Measuring and enforcing quality • through open tools

00 Month 0000 Footer (Edit footer for all slides with View > Header & Footer) 2 Testing strategy The testing cycle – big picture

Testing Develop Made Easy

Measure Test Continuous Inspection of Application Quality

Continuous Testing CI/CD pipeline

Run application tests and other quality gates

Pegasystems, Inc. 4 Your Application Test Strategy

APPLICATION TESTING INDUSTRY Industry Best Practices SOLUTIONS

CI/CD Building Up Your Automation Test Suite

Industry

Scenario Testing UI-Based & Test ID Scenario Testing

Industry

API-Based Pega API Functional Testing REST APIs SOAP APIs

Unit Testing PegaUnit Measuring Quality Application Quality Dashboard

Displays trends over time Measure key quality metrics

Displays key metrics per case

Application Quality & Automated Testing 8 Trends in Test Coverage & Test Coverage and Unit Testing landing pages now show test coverage & unit testing trends for helping customers understand their progress over time.

Application Quality & Automated Testing 9 Application Quality: Case type drill down metrics

Detailed metrics are shown for each case type and for the rules that doesn’t belong to any case type. Users can find issues with them quickly.

Application Quality & Automated Testing 10 Quality & Test Gates in Deployment Manager Ensure that each deployment is fully tested and meets the quality criteria before allowed to be delivered to higher environments.

Available in Deployment Manager 04.01.01

Application Quality & Automated Testing 11 PegaUnit PegaUnit Key Features

§ Unit testing of individual Pega rules

§ Follows key tenets of xUnit test patterns § Setup, Run, Execute, Cleanup

§ Application-level view of testing

§ Quick drill down into failing tests

§ Sophisticated but easy-to-use assertions ` Rapid Development & Testing in the model

Develop & Test Update Rule Rule Anatomy of a PegaUnit Test Test Setup

Unit Under Test Expected Results Expected Test Rule output/metri inputs c OR Actual output/metric Assertion Pass/ Rule “execution path” Fail

Test Cleanup Expected Result

Assertion Type = Property

Object of Expected Comparator Assertion Value

.pxValue “is greater than” 100 PegaUnit: Convenient assertion types Assertion Type Description

Expected run time (7.1.8) Verify the expected rule execution time

Result count (7.2.1) Compare the number of items returned in a page list, page group, value list, or value group with the expected result on the clipboard

Property (7.1.8) Compare the expected value of one or more properties with the actual values returned by a rule.

List (7.2.1) Determine if the expected result is in the list of results returned by a rule.

Page (7.2.2) Determine if a page exists on the clipboard or if a page has errors.

Decision result (7.2.2) Compare decision output based on a set of inputs

Assigned to (7.3) Verify that an assignment is routed to the expected operator ID or work queue.

Case status (7.3) Verify the status of a case

Attachment exists (7.3) Verify that an attachment exists PegaUnit: Testing a Data Page PegaUnit: Testing a Decision Rule PegaUnit Test Suites

T T T T T T T T T T T T T T T T T T T T Smoke Test Suite T T Feature A Test Suite Feature C Test Suite Create logical business value oriented groupings of test for targeted testing Scenario testing Model-Based Scenario Testing Click, record, and play UI-based scenario tests that can be integrated in the CI/CD pipeline.

§ Create scenario tests by using the application UI

§ Broad UI support § OOTB controls, layouts, and lists § Custom Controls § Page-to-page navigation and local actions § Support for dynamic data

§ REST service to remotely invoke the running of test cases

Application Quality & Automated Testing 22 Model-Based Scenario Testing

Capture scenarios as tests. Run scenario tests. Integrate scenario tests into your CI/CD pipeline.

Simple Steps:

1. Select a specific case type or the entire portal to test 2. Go through the scenario you want to test 3. Provide name, description, and context for the test. 4. Save test in a test automation ruleset. 5. Run saved scenario tests from the Scenario Test panel. Debug any failures.

Application Quality & Automated Testing 23 Model-Based Scenario Testing: Scenario

Portal / Case Type under test Scenario steps Expected results per step

Application Quality & Automated Testing 24 Model-Based Scenario Testing: Running a scenario test

1. Open an end-user portal

2. Click the Gear icon, then click the Flask icon to show the Scenario Tests panel

3. Click a scenario test to open it

4. Click Run

Application Quality & Automated Testing 25 Model-Based Scenario Testing: Creating a scenario test case

Click through the UI to record scenario test steps Save test case & create assertions when done

Click “Create test case”

Application Quality & Automated Testing 26 Regression testing through open tools UI Testing using Selenium Available for

§ Button

§ Link § Icon

§ Label § Formatted text

§ Text input § Text area

§ Other controls

Test IDs provide separation of test code and PRPC specific DOM generation Selenium Starter Kit 7.4 & 8.1

00 Month 0000 Footer (Edit footer for all slides with View > Header & Footer) 29 Roadmap of test automation features Test Automation feature roadmap

Release Rules Supported New Capabilities and Enhancements (PegaUnit) features 7.1.8 - Data Page 7.2.1 - REST API for executing - Setup & Cleanup PegaUnit tests 7.2.2 - Decision Tree - Decision Table - Activity - Data Transform - Strategy

7.3 - Process - Test Suites - Case Type 7.3.1 - When - Application Quality Dashboard - Reports landing page 7.4 - Test coverage for single - Quality metrics per casetype sessions - REST API to get quality metrics - Deployment Manager support - Test ID support expanded to for PegaUnit Navigation rules and Layout - Selenium Start Kit for SA groups - Quarantine PegaUnit tests Test Automation feature roadmap (cont…)

Release Rules Supported New Capabilities and Enhancements (PegaUnit) features 8.1 - Scenario testing (UI) in the - Quality metrics with trend model history - Test Coverage for multi-user - Casetype level quality metrics testing - Nested test suites - REST API for managing test - Selenium starter kit expanded to coverage all CRM apps - Deployment Manager support for rule coverage and scenario testing - PegaUnits and Scenario tests shipped with CRM apps 8.2 - Create data/work in setup - Capture clipboard data in setup - Automatic cleanup of data/work - Extensible Quality Dashboard 8.3 (planned) - Map Value - Test suites for Scenario Testing - Expanded rule coverage (ex. - Report Definition Declare Trigger, Report - Declare expression Definition) - Collection - Generate quality metrics from different testing sessions - Improved editability of Pega Scenario testing Test Automation feature roadmap (cont…)

Release Rules Supported New Capabilities and Enhancements (PegaUnit) features Future - Additional ruletypes added - Functional - Step level coverage of rules : based on customer feedback - Mocking, Stubs and Test partial rule execution coverage doubles - Business outcome view of quality metrics - Data driven testing Industry Test Solutions for Testing a Pega Application

Performance & Scale Email Security

API Testing UX

Resilience

UI Testing How to get started

• Start with education – Learn about Testing practices – PDN : Testing Automation Landing page

• Standardize – Deployments – Testing practices

• Automate – Deployments managed through an orchestrator – Automate tests & run frequently – Reduce the reliance on manual regression testing – New features should have maximum possible test automation – Invest in PegaUnit tests for early feedback – Use manual strategically

• Practice Continuous Integration

00 Month 0000 Footer (Edit footer for all slides with View > Header & Footer) 35