A key part of systems with complex business rules is testing to ensure the rules continue to work as changes are made to logic, the platform or the introduction of new data. We want to ensure that our logic for the automated insurance adjudication rules consistently meets expected outcomes.
In this article, we show how we can test a specific scenario using North52's TestShield. There are over 100 tests that would need to be built to provide full coverage of the business rules outlined in this series of articles.
The test shown below will validate rules for a claim item where the treatment has coverage (percentage coverage) and there is also an allowable quantity within a specified time period.
On the Assemble sheet, we describe the specific scenario of a feature that will be tested and provide links to the requirement details defined in Azure DevOps.
The Arrange sheets create records in the system which simulate a real-world scenario. All TestShield tests run independently of each other and create all the records necessary to simulate the test. For this test we need to create:
- 1 Contact
- 1 Policy for the Contact
- Records defining the Coverage for the Policy
- Records defining the Restrictions for the Policy
- 3 Claim records
- 3 Claim Items - one for each of the Claims
1 Contact record is Created
1 Policy record is created and associated to the Contact created in the previous sheet.
The Policy Coverage records define what Treatments are covered by the Policy.
The Policy Restriction records define what Restrictions are on the Policy.
3 Claim Records are created to simulate the customer submitting 3 separate Claims.
Each Claim Record has a Claim Detail record created to simulate the item the Customer is claiming for.
All the business rules for this Test execute automatically, so there are no manual Act steps to initiate for this test.
We define the expected results for the Claim Detail records following the application of the business rules. The 3 Claim Detail records created on the Arrange-Claim Detail sheet are evaluated against the data in this Assert sheet to determine a Pass or Fail result.
When we manually execute the test, we can see that all our Asserts Passed. If we review the 3rd Claim Detail record on Row 6 we can see that the claim was rejected (as expected) and the Claimable Amount is set to 0.