Automatic testing method for automatically executing underwriting rule

By analyzing the underwriting requirement documents and online form data, assembling request messages and executing automated test cases, the problem of huge workload of underwriting rules testing in the middle-end underwriting system is solved, and efficient automated testing and alarm push is achieved.

CN119537216APending Publication Date: 2025-02-28CPIC ALLIANZ HEALTH INSURANCE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411525464.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-30
Publication Date
2025-02-28

AI Technical Summary

Technical Problem

It is difficult for the existing technology to efficiently and automatically execute and test tens of thousands of underwriting rules in the middle platform underwriting system, resulting in huge testing workload and inefficient efficiency.

Method used

By analyzing the underwriting requirements document, extracting the underwriting rules and combining the rules under each insurance type, creating a general template for request messages, reading data in online tables, assembling request messages, loading and executing automated test cases, asserting and judging the results of use cases, pushing execution results and alarms.

Benefits of technology

It realizes the rapid generation and execution of automated test cases, monitors test results in real time and pushes alarms, greatly improving the efficiency of regression testing and saving at least 80% of the test time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119537216A_ABST
    Figure CN119537216A_ABST
Patent Text Reader

Abstract

The invention relates to an automatic test method for automatically executing an underwriting rule, which comprises the following steps of: analyzing an underwriting requirement document, extracting an underwriting rule name and combining all rules under each insurance type; creating a request message universal template; reading data in an online table maintained by a tester, wherein the online table comprises an automatic test case amp; a data table and an insurance type related information table; assembling all to-be-executed request messages based on the request message universal template, the data in the online table and all rules under insurance types obtained by analyzing the underwriting demand document; loading and executing automated test cases of all underwriting rules under a certain insurance type, and asserting and judging whether expected results of the automated test cases are consistent with actual results or not; and pushing and alarming an automatic test execution result. Compared with the prior art, the method has the advantages that the requirement documents are analyzed to be automatically combined to generate and execute the automatic test case, and the efficiency of underwriting rule testing is greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of automated testing technology, and in particular to an automated testing method for automatically executing underwriting rules based on an underwriting requirement document. Background Art

[0002] The underwriting service of the middle office currently has multiple insurance types and sales packages, with a total of more than 100 different underwriting rules, and the rules will increase with new products. Each insurance type has an average of 15 underwriting rule combinations, and each rule has an average of 10 test cases. The insurance type + multiple channels + rules have a total of tens of thousands of test cases that need to be executed by the underwriting system. At the same time, it also involves two sets of environmental coverage tests: system integration test (SIT) and user acceptance test (UAT), and the testing workload is huge. Therefore, there is an urgent need for an automated testing method that can automatically execute underwriting rules. Summary of the invention

[0003] The purpose of the present invention is to overcome the defects of the above-mentioned prior art and provide an automated testing method for automatically executing underwriting rules based on an underwriting requirement document.

[0004] The purpose of the present invention can be achieved by the following technical solutions:

[0005] An automated testing method for automatically executing underwriting rules, comprising the following steps:

[0006] Parse the underwriting requirements document, extract the underwriting rule names and combine all the rules under each insurance type;

[0007] Create a general template for request messages;

[0008] Read data in an online table maintained by a tester, wherein the online table includes an automated test case & data table and a table of insurance type related information;

[0009] Assemble all request messages to be executed based on the general template of the request message, the data in the online form, and all the rules under the insurance type obtained by parsing the underwriting requirements document;

[0010] Load and execute the automated test cases for all underwriting rules for a certain insurance type, and assert whether the expected results of the automated test cases are consistent with the actual results;

[0011] Push automated test execution results and issue alerts.

[0012] As a preferred technical solution, the content of the underwriting requirement document includes: rule name, rule definition type, verification rule and return information.

[0013] As a preferred technical solution, when creating the request message template, some fields are parameterized, including common parameter fields and insurance type related information fields of different insurance types.

[0014] As a preferred technical solution, the insurance type related information fields of different insurance types are assigned values ​​by taking the data in the insurance type related information table under different insurance types in the online table.

[0015] As an optimal technical solution, the automated test cases & data tables in the online form isolate the SIT environment and UAT environment test data and integrate the test cases with the test data, supporting multiple people to add, delete and modify test cases and data online. The content specifically includes: rule code, request parameters, SIT test environment data, UAT test environment data and expected results.

[0016] As a preferred technical solution, the request message to be executed by assembling is to replace the request parameter values ​​in all request messages under the same rule with the test data in the automated test case in batches, and combine all the automated test cases of the same rule. The specific process is as follows:

[0017] Replace the request parameters of the same rule name in the automated test cases and data tables of the online form with the values ​​of the corresponding test environment data in batches;

[0018] Replace the insurance-related parameters in the general template of the request message with the values ​​in the insurance-related information table in the online form;

[0019] After replacing all values ​​in a loop, combine the request messages of all rules.

[0020] As a preferred technical solution, when testing a rule under a certain insurance type, the method first closes all rules under the insurance type, then opens the rule status to be executed, executes the test, and triggers the underwriting conclusion of the rule.

[0021] As a preferred technical solution, the assertion is specifically: comparing the expected results in the automated test cases & data tables of the online form with the actual results in the response message to determine whether they are consistent.

[0022] As a preferred technical solution, the method sets a scheduled execution task based on a script and automatically executes the automation use case at a set time node.

[0023] As a preferred technical solution, the automated test execution result push and alarm are specifically as follows:

[0024] During the automated test execution phase, the execution results are monitored in real time, and alarm information is pushed when service anomalies or high-frequency errors occur;

[0025] After the automated test is executed, a test report is generated, which includes the request message, response message, expected result, actual result and test conclusion of each case, and the automated test report is pushed.

[0026] Compared with the prior art, the present invention has the following beneficial effects:

[0027] 1) The present invention generates and executes automated test cases based on the underwriting requirement document template, the request message general template, and the online test case & test data table combination. During the automated test execution phase, the execution results are monitored in real time, and the execution results are pushed and alarmed, which greatly improves the efficiency of regression testing.

[0028] 2) The present invention uses online forms to maintain automated test cases and data, isolates test data in the SIT environment and the UAT environment, integrates test cases with test data, supports multiple people to add, delete and modify test cases & data online, and automated test cases take effect in real time.

[0029] 3) The present invention updates the rule status. When automatically testing a rule under a certain insurance type, all rules under the insurance type are first closed, and then the rule status to be executed is opened to ensure that the execution environment is clean and not interfered by other rules, and what is triggered is the underwriting conclusion of the rule. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 The present invention is a flowchart of an automated testing method for automatically executing underwriting rules. DETAILED DESCRIPTION

[0031] The present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. This embodiment is implemented based on the technical solution of the present invention, and provides a detailed implementation method and specific operation process, but the protection scope of the present invention is not limited to the following embodiments.

[0032] Example 1

[0033] The present invention proposes a method for automatically executing automated testing of underwriting rules based on underwriting requirement documents, building a python+pytest automated testing framework, parsing product requirement documents (PRD), generating automated test cases based on insurance type+rule name+channel, and executing and pushing automated test results. Figure 1 As shown, the method steps proposed by the present invention are as follows:

[0034] Step 1: Combine all rules of the same insurance type

[0035] According to the product definition requirement document template, parse the prd and extract the verification content, that is, the rule name. One insurance type has multiple rules. These rules are combined together, that is, all the rules to be executed automatically.

[0036] Requirements document prd example:

[0037]

[0038]

[0039] Step 2: Generate automated test cases and execute them

[0040] 2.2.data.yaml, general template for request messages

[0041] Parameterize some fields in the request message template, that is, all insurance types are applicable to this message template. If the interface fields are added, deleted, or modified later, just modify this template directly, and it will take effect on all request messages of this template.

[0042] Request message example:

[0043]

[0044] 1) Parameterize the common parameters such as requestTime in the message, and customize the time assignment method, either taking the current system time or a fixed date

[0045] 2) Parameterization of productCode, salesPackageCode and other fields for different insurance types (taking data from different insurance types in the online table and assigning values)

[0046] 3) For example, if the concept of phase is introduced, just add the phase parameter to the template.

[0047] 2.2, test_data, test cases & test data

[0048] Use online forms to isolate the test data of the SIT environment and the UAT environment, and integrate test cases with test data. Support multiple people to add, delete and modify test cases and data online, and automated test cases take effect in real time.

[0049] Table example:

[0050] Table 1 - Automated test cases & data

[0051]

[0052] Table 2-Insurance related information

[0053] productCode salesPackageCode 101***00 SX-**-01

[0054] 2.3. Online form call

[0055] Read the online table and save the data in the online table to the memory.

[0056] 2.4, init initialization method

[0057] According to the general template data.yaml of the request message, the test_data of the online form and the parsed prd, all the rules under the insurance type are obtained, and all the request messages to be executed are assembled, that is, the request parameter values ​​in all request messages under the same rule are batch replaced with the test data in the automated test case, and all the automated test cases of the same rule are combined.

[0058] 1) Define the method to batch replace the request parameter parameter_name of the rule with the same rule name rule_code in Table 1 with the corresponding test environment data parameter_value;

[0059] 2) Define the method to replace the parameters related to the insurance type in the general template message with the values ​​in Table 2;

[0060] 3) Define a method for loop to replace all values ​​and combine the request messages of all rules;

[0061] 2.5. Database Operation

[0062] Update the rule status of the underwriting_rule table. For example, when automatically testing a rule under a certain insurance type, first close all rules under the insurance type (status=2), and then open the rule status to be executed (status=1) to ensure that the execution environment is clean and not interfered by other rules, and the underwriting conclusion of the rule is triggered.

[0063] Database table example:

[0064]

[0065] 2.6. Assertion

[0066] Assert the expected result resultDetail in the online form 1 automated test case & data with the actual result in the response message

[0067] Response message example:

[0068]

[0069] 2.7, test_case, test case assembly and execution

[0070] Load and execute the automated test cases for all underwriting rules for a certain insurance type, and assert whether the expected results of the automated test cases are consistent with the actual results.

[0071] 2.8, Jenkins scheduled execution

[0072] Jenkins integrates py scripts to set up scheduled tasks, such as automatically executing automation cases at time nodes in the regression testing phase.

[0073] Step 3: Push execution results and send alerts

[0074] 3.1. During the automated test execution phase, the execution results are monitored in real time. If service anomalies or high-frequency errors occur, the alarm information is pushed to the work group, and timely attention can be paid to solving the problem.

[0075] 3.2. After the automated test is completed, a test report is generated. The report contains the request message, response message, expected result, actual result, test conclusion and other information for each case.

[0076] 3.3. Push the automated test report to the work group, and group members can view and analyze the test report

[0077] By implementing automated testing, the original underwriting testing time was shortened from 4-5 days to 1-2 days, saving at least 80% of the testing time and greatly improving the efficiency of SIT, UAT and regression testing.

[0078] The preferred specific embodiments of the present invention are described in detail above. It should be understood that a person skilled in the art can make many modifications and changes based on the concept of the present invention without creative work. Therefore, any technical solution that can be obtained by a person skilled in the art through logical analysis, reasoning or limited experiments based on the concept of the present invention on the basis of the prior art should be within the scope of protection determined by the claims.

Claims

1. An automated testing method for automatically executing underwriting rules, characterized in that the steps include: Parse the underwriting requirements document, extract the underwriting rule names and combine all the rules under each insurance type; Create a general template for request messages; Read data in an online table maintained by a tester, wherein the online table includes an automated test case & data table and a table of insurance type related information; Assemble all request messages to be executed based on the general template of the request message, the data in the online form, and all the rules under the insurance type obtained by parsing the underwriting requirements document; Load and execute the automated test cases for all underwriting rules for a certain insurance type, and assert whether the expected results of the automated test cases are consistent with the actual results; Push automated test execution results and issue alerts.

2. The automated testing method for automatically executing underwriting rules according to claim 1, characterized in that: The content of the underwriting requirement document includes: rule name, rule definition type, verification rule and return information.

3. The automated testing method for automatically executing underwriting rules according to claim 1, characterized in that: When creating the request message template, some fields are parameterized, including common parameter fields and insurance type related information fields of different insurance types.

4. The automated testing method for automatically executing underwriting rules according to claim 3, characterized in that: The insurance type related information fields of different insurance types are assigned values ​​by taking the data in the insurance type related information table under different insurance types in the online table.

5. The automated testing method for automatically executing underwriting rules according to claim 1, characterized in that: The automated test cases & data tables in the online form isolate the SIT environment and UAT environment test data and integrate the test cases with the test data, supporting multiple people to add, delete and modify test cases and data online. The content specifically includes: rule code, request parameters, SIT test environment data, UAT test environment data and expected results.

6. The automated testing method for automatically executing underwriting rules according to claim 1, characterized in that: The request message to be executed by assembling is to replace the request parameter values ​​in all request messages under the same rule with the test data in the automated test case in batches, and combine all the automated test cases of the same rule. The specific process is as follows: Replace the request parameters of the same rule name in the automated test cases and data tables of the online form with the values ​​of the corresponding test environment data in batches; Replace the insurance-related parameters in the general template of the request message with the values ​​in the insurance-related information table in the online form; After replacing all values ​​in a loop, combine the request messages of all rules.

7. The automated testing method for automatically executing underwriting rules according to claim 1, characterized in that: When testing a certain rule under a certain insurance type, the method first closes all the rules under the insurance type, then opens the rule status to be executed, executes the test, and triggers the underwriting conclusion of the rule.

8. The automated testing method for automatically executing underwriting rules according to claim 1, characterized in that: The assertion is specifically: comparing the expected results in the automated test case & data table of the online form with the actual results in the response message to determine whether they are consistent.

9. The automated testing method for automatically executing underwriting rules according to claim 1, characterized in that: The method sets a scheduled execution task based on a script and automatically executes the automation use case at a set time node.

10. The automated testing method for automatically executing underwriting rules according to claim 1, characterized in that: The specific steps of pushing the automated test execution results and issuing an alert are as follows: During the automated test execution phase, the execution results are monitored in real time, and alarm information is pushed when service anomalies or high-frequency errors occur; After the automated test is executed, a test report is generated, which includes the request message, response message, expected result, actual result and test conclusion of each case, and the automated test report is pushed.