Data model automatic testing method, device and electronic equipment

By dividing the test dimensions of the data model into preset conditions and attributes, generating all combinations of conditions and automatically obtaining the target results, the problem of testing efficiency and accuracy under massive test dimensions and complex rules is solved, and efficient and accurate data model testing is achieved.

CN114003494BActive Publication Date: 2026-04-14JINGDONG ALLIANZ GENERAL INSURANCE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
JINGDONG ALLIANZ GENERAL INSURANCE CO LTD
Filing Date
2021-10-28
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

Existing technologies face challenges in data model testing due to the massive number of test dimensions and complex data selection rules, resulting in time-consuming and labor-intensive testing, reduced accuracy, and potential reliability issues.

Method used

By dividing massive test dimensions into preset conditions and preset attributes, generating all combinations of conditions, and automatically obtaining the first target result, comprehensive testing of the data model under test is achieved.

Benefits of technology

It improves testing efficiency and accuracy, enabling efficient and accurate testing even with frequent data model updates, and greatly enhances the efficiency and reliability of data model deployment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114003494B_ABST
    Figure CN114003494B_ABST
Patent Text Reader

Abstract

The present disclosure provides a data model automatic testing method and device and electronic equipment, and relates to the field of software testing. The method comprises the following steps: obtaining all attribute combinations of a plurality of preset attributes corresponding to a to-be-tested data model and a plurality of preset conditions, and determining all condition combinations corresponding to the to-be-tested data model according to the all attribute combinations and the plurality of preset conditions; obtaining preset attribute values of each preset attribute under each condition combination, and determining a first target result corresponding to each condition combination according to the preset attribute values of the preset attribute; generating a plurality of data requests corresponding to each condition combination respectively, and inputting the plurality of data requests into the to-be-tested data model to obtain a second target result corresponding to each condition combination output by the to-be-tested data model; and outputting an output test pass message of the to-be-tested data model when each second target result is equal to the first target result of the corresponding condition combination. The present disclosure can improve the comprehensive testing efficiency of the data model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of software testing technology, and more specifically, to an automatic testing method, apparatus, and electronic device for data models. Background Technology

[0002] In data model testing, various testing conditions are typically involved. Testers usually need to manually select dimensions and determine the test results themselves. After inputting the same dimensions into the data model under test, they compare the output of the data model under test with their own test results to verify the output functionality of the model under test. This process is often time-consuming and labor-intensive. When the data model under test has a tight deployment time, a large number of test dimensions, and complex data selection rules, this testing method can lead to reduced test accuracy and limited test attempts, thus creating potential problems for test reliability.

[0003] Therefore, there is a need in this field for a testing method that can quickly, comprehensively, and accurately test data models with massive testing dimensions and complex data selection rules.

[0004] It should be noted that the information disclosed in the background section above is only used to enhance the understanding of the background of this disclosure, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention

[0005] The purpose of this disclosure is to provide an automatic testing method, apparatus, and electronic device for data models, which can at least partially overcome the problem of low testing efficiency of data models due to limitations and defects in related technologies.

[0006] According to a first aspect of the present disclosure, an automatic testing method for a data model is provided, comprising: acquiring all attribute combinations of multiple preset attributes corresponding to a data model under test and multiple preset conditions; determining all condition combinations corresponding to the data model under test based on the all attribute combinations and the multiple preset conditions; acquiring preset attribute values ​​of each preset attribute under each condition combination; determining a first target result corresponding to each condition combination based on the preset attribute values ​​of the preset attributes; generating multiple data requests corresponding to each condition combination; inputting the multiple data requests into the data model under test to obtain a second target result output by the data model under test corresponding to each condition combination; and outputting a test pass message for the data model under test when each second target result is equal to the first target result of its corresponding condition combination.

[0007] In one exemplary embodiment of this disclosure, at least one of the preset conditions is a range-limited condition, and the complete combination of conditions includes the combination of conditions corresponding to all allowed values ​​in the range-limited condition.

[0008] In one exemplary embodiment of this disclosure, the plurality of preset attributes include mandatory attributes and optional attributes, and each of the attribute combinations in the total attribute combinations includes at least one of the mandatory attributes.

[0009] In one exemplary embodiment of this disclosure, the data model to be tested is a premium calculation model, the plurality of preset conditions include at least age and participation in social security and non-participation in social security, the plurality of preset attributes include at least a plurality of target insurance types, and the preset attribute values ​​of the plurality of preset attributes include at least the pricing of each target insurance type.

[0010] In one exemplary embodiment of this disclosure, obtaining the preset attribute value of each preset attribute under each condition combination, and determining the first target result corresponding to each condition combination based on the preset attribute value of the preset attribute includes:

[0011] The preset attribute value of each preset attribute under the target condition combination is determined based on at least one preset condition and / or at least one preset attribute in the target condition combination;

[0012] A method for obtaining the first target result is determined based on at least one preset condition and / or at least one preset attribute in the combination of target conditions;

[0013] The first target result is obtained according to the method for obtaining the first target result corresponding to the combination of target conditions and the preset attribute value of each preset attribute.

[0014] In one exemplary embodiment of this disclosure, obtaining the preset attribute value of each preset attribute under each condition combination, and determining the first target result corresponding to each condition combination based on the preset attribute value of the preset attribute includes:

[0015] The attribute value reading address of each preset attribute is determined based on at least one preset condition and / or at least one preset attribute of the target condition combination, and the preset attribute value of each preset attribute is obtained based on the attribute value reading address;

[0016] The first calculation formula corresponding to the target condition combination is determined based on at least one preset condition and / or at least one preset attribute of the target condition combination;

[0017] Substitute the preset attribute value of each preset attribute into the first calculation formula to obtain the first target result corresponding to the combination of target conditions.

[0018] In one exemplary embodiment of this disclosure, the premium calculation model uploads the second target result to a preset database, and the data model testing method further includes:

[0019] Obtain the third target result from the preset database;

[0020] When the third target result equals the first target result, a storage test pass message for the data model under test is output.

[0021] According to a second aspect of the present disclosure, an automatic testing apparatus for a data model is provided, comprising: a condition combination acquisition module, configured to acquire all attribute combinations of multiple preset attributes corresponding to a data model under test and multiple preset conditions, and determine all condition combinations corresponding to the data model under test based on the all attribute combinations and the multiple preset conditions; a target result acquisition module, configured to acquire a preset attribute value of each preset attribute under each condition combination, and determine a first target result corresponding to each condition combination based on the preset attribute value of the preset attribute; an input test module, configured to generate multiple data requests corresponding to each condition combination, and input the multiple data requests into the data model under test to obtain a second target result output by the data model under test corresponding to each condition combination; and a test judgment module, configured to output a test pass message for the data model under test when each second target result is equal to the first target result of its corresponding condition combination.

[0022] According to a third aspect of this disclosure, an electronic device is provided, comprising: a memory; and a processor coupled to the memory, the processor being configured to perform the method as described in any of the preceding methods based on instructions stored in the memory.

[0023] According to a fourth aspect of this disclosure, a computer-readable storage medium is provided having a program stored thereon that, when executed by a processor, implements the automatic testing method for data models as described in any of the preceding claims.

[0024] This embodiment of the disclosure divides massive test dimensions into preset conditions and preset attributes, and then sets all attribute combinations as conditions to obtain all condition combinations. Based on the condition combinations, it automatically obtains the first target result for verifying the output function of the data model under test. This can automatically test all possible test conditions when the data model under test has massive data dimensions and complex data selection rules, thereby improving test efficiency and accuracy and overcoming the problem in related technologies that it is difficult to automatically test all massive dimensions. In addition, since the entire test process is executed automatically, the test process is not affected when the data dimensions or attribute value setting logic changes. It can be migrated to the testing of multiple data models with very few modifications. Even if the data model is frequently updated, the test can be carried out efficiently and accurately, which greatly improves the online efficiency and reliability of the data model.

[0025] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0026] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure. It is obvious that the drawings described below are merely some embodiments of this disclosure, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort.

[0027] Figure 1 This is a flowchart of an automated testing method for a data model in an exemplary embodiment of this disclosure.

[0028] Figure 2 This is a flowchart of step S2 in one embodiment of the present disclosure.

[0029] Figure 3 yes Figure 2 A flowchart of one embodiment of the method shown.

[0030] Figure 4 This is a flowchart illustrating the automatic testing of a premium calculation model in one embodiment of this disclosure.

[0031] Figure 5 This is a block diagram of an automated testing apparatus for a data model according to an exemplary embodiment of this disclosure.

[0032] Figure 6 This is a block diagram of an electronic device according to an exemplary embodiment of the present disclosure. Detailed Implementation

[0033] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided to make this disclosure more comprehensive and complete, and to fully convey the concept of the example embodiments to those skilled in the art. The described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a full understanding of embodiments of this disclosure. However, those skilled in the art will recognize that the technical solutions of this disclosure can be practiced with one or more of the specific details omitted, or other methods, components, apparatus, steps, etc., can be employed. In other instances, well-known technical solutions are not shown or described in detail to avoid obscuring various aspects of this disclosure.

[0034] Furthermore, the accompanying drawings are merely illustrative of this disclosure, and the same reference numerals in the drawings denote the same or similar parts, thus repeated descriptions of them will be omitted. Some block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.

[0035] The exemplary embodiments of this disclosure will now be described in detail with reference to the accompanying drawings.

[0036] Figure 1 This is a flowchart of an automated testing method for a data model in an exemplary embodiment of this disclosure.

[0037] refer to Figure 1 The data model automatic testing method 100 may include:

[0038] Step S1: Obtain all attribute combinations and multiple preset conditions corresponding to the data model under test; determine all condition combinations corresponding to the data model under test based on the all attribute combinations and the multiple preset conditions.

[0039] Step S2: Obtain the preset attribute value of each preset attribute under each condition combination, and determine the first target result corresponding to each condition combination based on the preset attribute value;

[0040] Step S3: Generate multiple data requests corresponding to each of the condition combinations, and input the multiple data requests into the data model under test to obtain the second target result output by the data model under test corresponding to each of the condition combinations;

[0041] Step S4: When each of the second target results is equal to the first target result of its corresponding condition combination, output the output test pass message of the data model under test.

[0042] This embodiment of the present disclosure divides massive test dimensions into preset conditions and preset attributes, and then sets all attribute combinations as conditions to obtain all condition combinations. Based on the condition combinations, the first target result for verifying the output function of the data model under test is automatically obtained. This can automatically test all possible test conditions when the data model under test has massive data dimensions and complex data selection rules, thereby improving test efficiency and test accuracy and overcoming the problem in related technologies that it is difficult to automatically test all massive dimensions.

[0043] The following is a detailed explanation of each step in the automatic testing method 100 for data models.

[0044] In step S1, all attribute combinations and multiple preset conditions corresponding to the data model under test are obtained, and all condition combinations corresponding to the data model under test are determined based on the all attribute combinations and the multiple preset conditions.

[0045] In related fields, testers typically select a massive number of test dimensions manually because automated testing can suffer from logical inconsistencies. In this embodiment, all dimensions corresponding to the data model under test are divided into preset attributes and preset conditions. Preset conditions refer to dimensions that can affect the output of the data model under test. For example, when the data model under test is a premium calculation model, preset conditions could be age, gender, having social security, or not having social security. Preset attributes refer to dimensions with attribute values, which are directly used by the data model under test and participate in the calculation to output the final target result. For example, in the aforementioned premium calculation model, each type of insurance purchased by the user has a premium or rate, and the model directly outputs the comprehensive premium based on the aforementioned premium or rate.

[0046] In some embodiments, the number and types of preset input attributes often affect the output of the data model under test. For example, in a premium calculation model, it can be set that the more types of insurance purchased, the greater the premium discount; that a full reduction or discount can be applied after the total premium exceeds a certain value; or that selecting one or more types of insurance can result in a discount on the total premium, etc. Therefore, embodiments of this disclosure also set the combination of preset attributes as conditions to comprehensively cover the test conditions.

[0047] In one embodiment of this disclosure, all dimensions corresponding to the data model to be tested can first be divided into preset attributes and preset conditions, and then all attribute combinations corresponding to all preset attributes can be obtained. Since the preset attributes directly participate in the calculation, each attribute combination includes at least one preset attribute. The number of all attribute combinations is determined according to the specific circumstances of the preset attributes.

[0048] In one embodiment, preset attributes are divided into mandatory attributes and optional attributes, and each attribute combination includes at least one mandatory attribute. For example, when preset attributes 1 and 2 are mandatory attributes, and preset attributes 3 and 4 are optional attributes, all attribute combinations include: (preset attribute 1, preset attribute 2), (preset attribute 1, preset attribute 3), (preset attribute 1, preset attribute 4), (preset attribute 1, preset attribute 2, preset attribute 3), (preset attribute 1, preset attribute 2, preset attribute 4), (preset attribute 1, preset attribute 3, preset attribute 4), (preset attribute 1, preset attribute 2, preset attribute 3, preset attribute 4), and (preset attribute 2, preset attribute 3), (preset attribute 2, preset attribute 4), (preset attribute 2, preset attribute 3, preset attribute 4), etc., totaling 10 attribute combinations.

[0049] In one embodiment, if preset attributes 1, 2, 3, and 4 are of equal status, then all attribute combinations include 15 attribute combinations such as (preset attribute 1), (preset attribute 2), (preset attribute 3), (preset attribute 4), (preset attribute 1, preset attribute 2), (preset attribute 1, preset attribute 3), (preset attribute 1, preset attribute 4), (preset attribute 2, preset attribute 3), (preset attribute 2, preset attribute 4), (preset attribute 3, preset attribute 4), (preset attribute 1, preset attribute 2, preset attribute 3), (preset attribute 1, preset attribute 2, preset attribute 4), (preset attribute 1, preset attribute 3, preset attribute 4), (preset attribute 2, preset attribute 3, preset attribute 4), (preset attribute 1, preset attribute 2, preset attribute 3, preset attribute 4).

[0050] Next, each attribute combination is treated as a condition, and together with multiple preset conditions, all condition combinations are generated. It's important to understand that attribute combinations are mutually exclusive and mandatory; each condition combination must contain exactly one attribute combination.

[0051] For example, when the selected attribute combination is (preset attribute 1, preset attribute 3), and the preset conditions include preset condition 1, preset condition 2, and preset condition 3, the total number of condition combinations can include 7 combinations such as (attribute combination, preset condition 1), (attribute combination, preset condition 2), (attribute combination, preset condition 3), (attribute combination, preset condition 1, preset condition 2), (attribute combination, preset condition 1, preset condition 3), (attribute combination, preset condition 2, preset condition 3), and (attribute combination, preset condition 1, preset condition 2, preset condition 3).

[0052] Among these, multiple preset conditions can include different cases of the same dimension. For example, in a premium calculation model, the dimension value of the social security status dimension is divided into having social security and not having social security. Then, the social security status dimension can be split into two mutually exclusive preset conditions of having social security and not having social security (at most one of these conditions exists in a combination of conditions), rather than being a preset attribute (the attribute value of a preset attribute directly participates in the calculation, rather than affecting the calculation).

[0053] In some embodiments, at least one preset condition is a range-limited condition, and all condition combinations include condition combinations corresponding to all allowed values ​​within the range. For example, when the preset condition is age, it can be set to a numerical range such as 0 to 5 years old. In this case, all allowed values ​​within the numerical range include 0, 1, 2, 3, 4, and 5 years old. The preset condition is broken down into 6 mutually exclusive sub-conditions to generate condition combinations (each condition combination contains at most one such sub-condition). For example, when the selected attribute combination is (preset attribute 1, preset attribute 3), and the preset conditions include preset condition 1 and preset condition 2, preset condition 1 is a range-limited condition with three allowed values ​​within the range. It is then split into three sub-conditions: preset condition 11, preset condition 12, and preset condition 13. The corresponding total condition combinations include seven conditions: (attribute combination, preset condition 11), (attribute combination, preset condition 12), (attribute combination, preset condition 13), (attribute combination, preset condition 2), (attribute combination, preset condition 11, preset condition 2), (attribute combination, preset condition 12, preset condition 2), and (attribute combination, preset condition 13, preset condition 2).

[0054] Therefore, it can be seen that each condition combination in the total condition combination has one and only one attribute combination, and multiple preset conditions usually have one or several sets of mutually exclusive conditions. These mutually exclusive conditions limit the number of total condition combinations. The selection of total condition combinations needs to take into account the setting of mutually exclusive conditions, and cannot be achieved by simply calculating the number of combinations using statistics.

[0055] By dividing all dimensions into preset conditions and preset attributes, and using the combination of preset attributes as one of the conditions to generate condition combinations, all possible test conditions can be quickly obtained when facing a massive number of test dimensions, thereby improving testing efficiency and accuracy.

[0056] In step S2, the preset attribute value of each preset attribute under each condition combination is obtained, and the first target result corresponding to each condition combination is determined according to the preset attribute value of the preset attribute.

[0057] In one embodiment of this disclosure, the preset attribute values ​​for each preset attribute under various conditions can be provided by the developers of the data model under test through a data table. The method for obtaining the first target result corresponds to the data model under test and may include one or more acquisition methods. In one embodiment, the method for obtaining the first target result is, for example, to calculate multiple preset attribute values ​​using a preset formula to obtain a calculation result.

[0058] In some embodiments, all preset attribute values ​​are provided by a single data table and have only one calculation formula, such as summing the attribute values ​​of each preset attribute in the attribute combination within the target condition combination. In this case, the preset attribute values ​​can be directly read from the data table and substituted into the calculation formula to obtain the first target result. However, most test scenarios are quite complex, and the selection of preset conditions and preset attributes will affect the first target result.

[0059] Figure 2 This is a flowchart of step S2 in one embodiment of the present disclosure.

[0060] refer to Figure 2 In one embodiment, step S2 may include:

[0061] Step S21: Determine the preset attribute value of each preset attribute under the target condition combination based on at least one preset condition and / or at least one preset attribute in the target condition combination;

[0062] Step S22: Determine the method for obtaining the first target result based on at least one of the preset conditions and / or at least one of the preset attributes in the target condition combination;

[0063] Step S23: Obtain the first target result according to the method for obtaining the first target result corresponding to the target condition combination and the preset attribute value of each preset attribute.

[0064] In some embodiments, a preset condition, a combination of preset conditions, a preset attribute, or a combination of preset attributes can determine the method for obtaining the preset attribute value and / or the method for obtaining the first target result. For example, it can be set that when a specific preset condition exists in the target condition combination, the preset attribute value is read from a first data table; when another specific preset condition exists in the target condition combination, the preset attribute value is read from a second data table. It is understood that these two preset conditions are mutually exclusive. Alternatively, it can be set that when three preset conditions exist simultaneously in the target condition combination, the maximum value among the preset attribute values ​​is selected as the first target result; when four preset conditions exist in the target condition combination, the preset attribute value is calculated according to a first formula; if the calculation result exceeds a preset value, the calculation result is subtracted by 100 to obtain the first target result, and so on.

[0065] In other embodiments, the simultaneous existence of a preset condition and a preset attribute can determine the method for obtaining the preset attribute value, or the method for obtaining the first target result. For example, it can be set that when a preset condition (or some preset conditions) and a preset attribute (or some preset attributes) exist simultaneously in the target condition combination, the attribute values ​​of all preset attributes in the target condition combination are set to 1, and / or the first target result is automatically output as a preset string, etc.

[0066] The above values ​​are merely examples. Since there are many types of preset conditions and preset attributes, those skilled in the art can set restrictions according to the actual situation to automatically judge the target condition combination, automatically determine the attribute value of the preset attribute in the target condition combination, automatically determine the method for obtaining the first target result corresponding to the target condition combination, and then automatically determine the first target result.

[0067] Figure 3 yes Figure 2 A flowchart of one embodiment of the method shown.

[0068] refer to Figure 3 In one embodiment of this disclosure, Figure 2 The method shown may include, for example:

[0069] Step S211: Determine the attribute value reading address of each preset attribute based on at least one preset condition and / or at least one preset attribute of the target condition combination, and obtain the preset attribute value of each preset attribute based on the attribute value reading address;

[0070] Step S221: Determine the first calculation formula corresponding to the target condition combination based on at least one preset condition and / or at least one preset attribute of the target condition combination;

[0071] Step S231: Substitute the preset attribute value of each preset attribute into the first calculation formula to obtain the first target result corresponding to the target condition combination.

[0072] exist Figure 3 In the embodiment shown, preset conditions and preset attributes can be used to determine the attribute value reading address and calculation formula, thereby automatically substituting the read preset attribute values ​​into the formula to obtain the corresponding first target result.

[0073] For example, when the data model to be tested is a premium calculation model, it can be set that when the target condition combination contains the condition "payment frequency is annual", the first data table is read from the first address to obtain the premium settings for each main insurance and supplementary insurance; when the target condition combination contains the condition "payment frequency is monthly", the second data table is read from the second address to obtain the premium settings for each main insurance and supplementary insurance, wherein the premium for each case in the second data table is higher than the premium for the same case in the first data table.

[0074] In this embodiment, the first calculation formula may also include a conditional judgment formula, such as performing different calculations on values ​​in different ranges, like subtracting 20 from a value of 200, or offering a 20% discount on a value of 300, etc. The first calculation formula can be of various types, including but not limited to mathematical calculations and logical judgments, corresponding to the data output logic of the data model under test. Those skilled in the art can make adaptive settings according to the functions of the data model under test, and this disclosure is not limited thereto.

[0075] By automatically determining the first target result corresponding to each combination of conditions, labor and time costs can be effectively saved. When upgrading the version of the data model under test, adding dimensions, modifying preset attribute values, changing the setting method of preset attribute values, or applying this method to other types of data models under test, the fully automated testing mode can be efficiently modified by changing preset parameters such as preset conditions, preset attributes, preset attribute values, methods for obtaining preset attribute values, first calculation formulas, or methods for obtaining the first target result. This enables efficient, comprehensive, and accurate acquisition of verification values ​​for multiple versions and types of data models.

[0076] In step S3, multiple data requests are generated corresponding to each of the condition combinations, and the multiple data requests are input into the data model under test to obtain the second target result output by the data model under test corresponding to each of the condition combinations.

[0077] After determining all condition combinations and the first target result corresponding to each condition combination, data requests corresponding to all condition combinations can be automatically generated and sequentially input into the data model under test. For example, if all condition combinations include 100 combinations, the data request corresponding to condition combination 1 is input into the data model under test to obtain the second target result output by the data model under test. If the second target result is the same as the first target result corresponding to condition combination 1, the data request corresponding to condition combination 2 is input into the data model under test. If the second target result is different from the first target result corresponding to condition combination 1, the test is interrupted and an error is reported, or the error situation corresponding to condition combination 1 is marked (e.g., the first and second target results corresponding to condition combination 1 are recorded and marked as error) before the data request corresponding to condition combination 2 is input into the data model under test. When the test is set not to interrupt the test when the second target result is different from the first target result, the test can continue until the second target result corresponding to condition combination 100 is obtained.

[0078] In step S4, when each of the second target results is equal to the first target result of its corresponding condition combination, the output test pass message of the data model under test is output.

[0079] In some embodiments, a test pass message for the data model under test can be output when all second target results are equal to their corresponding first target results. In some embodiments, error conditions corresponding to failed condition combinations can also be recorded, and a test report can be generated. The test report may include, for example, the failed condition combinations and their corresponding first and second target results, or the test pass rate. This facilitates subsequent analysis and improvement of the data model under test by developers.

[0080] In some embodiments, further testing may also be conducted on other functionalities of the data model under test.

[0081] For example, when the data model under test is a premium calculation model, the premium calculation model is set to upload the output of the second target result to a preset database. At this time, it can also automatically obtain the third target result from the preset database, and output the storage test pass message of the data model under test when the third target result is equal to the first target result.

[0082] The method provided in this disclosure can be used to perform comprehensive, rapid and accurate testing on a single data model under test, or to perform batch testing on multiple data models under test sequentially. This can greatly improve the testing efficiency and comprehensiveness of the data model without the need for sampling.

[0083] In one embodiment of this disclosure, the method provided can be used to automatically test a premium calculation model.

[0084] With the increasing variety of insurance plans, verifying the correctness of premiums in the development interface and stored in the database can only be done by manually inputting various underwriting business scenarios. This process is cumbersome and affects testing efficiency and the accuracy of test data. Business scenarios include various combinations of different age groups, different insurance plan codes, and different payment frequencies. The testing workflow is highly coupled with the business scenarios, hindering reusability. Each new insurance product plan requires recalculating the premium. Faced with increasingly diverse insurance products, current testing methods result in high testing costs and may lead to long testing cycles, impacting business deployment. To reduce the testing difficulty of new insurance product processes and achieve rapid deployment of new insurance products, the following examples utilize… Figure 1 The method shown automatically simulates various business scenarios based on a general rate table template provided by developers, and then automatically calculates the premium for that business scenario. This achieves complete decoupling of the testing workflow from the business scenario, automates the premium testing of each insurance product, reduces a large amount of testing work, improves testing accuracy, and enables the rapid launch of new insurance products.

[0085] This embodiment uses automated simulation to calculate premiums for various business scenarios and the premium calculation model data interface (also known as the underwriting interface) to verify and compare the premiums returned by the premium calculation model with the premiums entered into the database. This decouples the testing work from the business scenarios and minimizes the amount of testing through automated premium calculation.

[0086] In this embodiment, the preset attributes are mainly divided into generating various permutations and combinations of main insurance and supplementary insurance. The preset conditions mainly include different ages and social security statuses. The preset attribute values ​​include premiums under various age, social security status, and insurance type permutations and combinations. The various permutations and combinations of main insurance and supplementary insurance (all attribute combinations of the preset attributes) can be obtained by reading the preset rate table provided by the developers. The preset rate table can include the plan codes of main insurance and supplementary insurance, as well as the premiums for different age groups under various plans. The premiums for various insurance type permutations and combinations at different ages are obtained by iteratively obtaining various supplementary insurance plan codes and various age stages. The calculated premium is compared with the premium stored in the database and the premium returned by the underwriting interface. If the comparison results are consistent, the premium calculation model is considered to have passed the test; otherwise, the test is considered to have failed. This solves the complexity of manually calculating premiums in different business scenarios, the timeliness of manually generating the insured's ID information in different business scenarios, and the accuracy of generating underwriting request messages under various circumstances (different ages, different plan code combinations).

[0087] Table 1 is an example of a preset rate table for an insurance plan (fixed main insurance) provided in an embodiment of this disclosure.

[0088] Table 1:

[0089]

[0090] Referring to Table 1, in step one, for a main insurance policy, its corresponding preset rate table can be obtained, where ZAAMIP01, ZAAMIP02, ZAAMIP03, and ZAAMIP04 are the supplementary insurance codes.

[0091] Then, in step two, generate all combinations of supplementary insurance policies (i.e., all attribute combinations) corresponding to the main insurance policy:

[0092] [[ZAAMIP01,ZAAMIP02,ZAAMIP03,ZAAMIP04],

[0093] [ZAAMIP01,ZAAMIP02,ZAAMIP03],

[0094] [ZAAMIP01,ZAAMIP02,ZAAMIP04],

[0095] [ZAAMIP01,ZAAMIP03,ZAAMIP04],

[0096] [ZAAMIP02,ZAAMIP03,ZAAMIP04],

[0097] [ZAAMIP01,ZAAMIP02]

[0098] [ZAAMIP01,ZAAMIP03]

[0099] [ZAAMIP01,ZAAMIP04]

[0100] [ZAAMIP02,ZAAMIP03]

[0101] [ZAAMIP02,ZAAMIP04]

[0102] [ZAAMIP03,ZAAMIP04]

[0103] [ZAAMIP01],

[0104] [ZAAMIP02],

[0105] [ZAAMIP03],

[0106] [ZAAMIP04]

[0107] []].

[0108] The brackets "[]" indicate that no supplementary insurance is purchased, meaning that only the main insurance is purchased. In this embodiment, the main insurance is a mandatory attribute by default in all attribute combinations.

[0109] Next, in step three, the preset conditions are determined, including age group, presence of social security, and absence of social security. This generates different combinations of conditions for different age groups and with or without social security. The premiums for each plan code under different age groups with or without social security are read from the preset rate table to determine the premiums corresponding to all business scenarios. The following example demonstrates the premium retrieval result (preset attribute value) for age 0; the results for other age groups are similar to age 0. The main insurance code is ZAAMIPHB(2021). ZAAMIP01_true means that the supplementary insurance ZAAMIP01 is purchased and social security is available; ZAAMIP01_true means that the supplementary insurance ZAAMIP01 is purchased but social security is not available. The right side of the equals sign represents the premiums (preset attribute values) for each supplementary insurance obtained by reading the preset rate table.

[0110] 0 = {

[0111] ZAAMIPHB(2021)ZAAMIP01_true=120.0,

[0112] ZAAMIPHB(2021)ZAAMIP01_false=120.0,

[0113] ZAAMIPHB(2021)ZAAMIP02_false=30.0,

[0114] ZAAMIPHB(2021)ZAAMIP02_true=30.0,

[0115] ZAAMIPHB(2021)ZAAMIP03_true=2.0,

[0116] ZAAMIPHB(2021)ZAAMIP03_false=2.0,

[0117] ZAAMIPHB(2021)ZAAMIP04_true=5.0,

[0118] ZAAMIPHB(2021)ZAAMIP04_false=5.0

[0119] ZAAMIPHB(2021)ZAAMIPHB(2021)_true=44.0,

[0120] ZAAMIPHB(2021)ZAAMIPHB(2021)_false=96.0,

[0121] }

[0122] Next, in step four, an array (condition combination) of age groups requiring underwriting is generated. This array contains four fields: age, social security status, payment frequency, and the relationship between the policyholder and the insured. Having social security is marked as 1, and not having social security is marked as 0. Annual payment is marked as 1, and monthly payment is marked as 2. The payment frequency flag determines which preset rate table to read; rates in the monthly rate table are higher than those in the annual rate table under the same conditions. The relationship between the policyholder and the insured is used to determine the preferential scenario; if the policyholder is the insured person, it is marked as 1; if the policyholder is someone else, it is marked as 0.

[0123] The array example is as follows:

[0124] {{"32",String.valueOf(true),"1","1"},{"25",String.valueOf(true),"1","0"}}

[0125] The supplementary insurance combination (all plan code combination) determined in step two is combined with the main insurance plan code (ZAAMIPHB(2021)), and then iterated through the array determined in step four. The premium corresponding to the age can be obtained from the age field in the array of step four using the algorithm of step three. Then, underwriting messages for various scenarios are generated based on the all plan code combination, age range, premium, payment frequency, and other information. Underwriting requests are made to the premium calculation model (underwriting model) to be tested based on these underwriting messages. The premium returned by the underwriting request and the premium stored in the database by the model are verified. If the premium returned by the model, the premium returned by the database, and the pre-calculated premium are all consistent, the model test is returned as successful; otherwise, the model test is returned as unsuccessful.

[0126] The above embodiments can decouple the insurance service testing process from the business logic, improve the efficiency and reusability of insurance service testing, reduce the testing cost of launching new services, and make all service processes in the system drag-and-drop modifiable.

[0127] Figure 4 This is a flowchart illustrating the automatic testing of a premium calculation model in one embodiment of this disclosure. Figure 4 This is an illustration of the above embodiment.

[0128] refer to Figure 4 In step S401, the rate table associated with the current main insurance in the premium calculation model to be tested is first read.

[0129] In step S402, various supplementary insurance combinations are generated based on the supplementary insurance plan code. These combinations include the case where there is no supplementary insurance.

[0130] In step S403, the first premium for each supplementary insurance combination, each age range, and under social security conditions under the current main insurance is determined according to the rate table.

[0131] In step S404, the input of each supplementary insurance combination, each age range, and social security condition combination is used to calculate the premium to be tested, and the second premium output by the model and the third premium stored in the database by the model are obtained.

[0132] In step S405, it is determined whether the first premium, second premium, and third premium under the same combination of conditions are the same. If they are the same, proceed to step S406 to return a test pass message and record the result; if they are different, proceed to step S407 to return a test fail message and return the error status.

[0133] Figure 4 The process described in the embodiment can be used to test premium calculation models corresponding to various main insurance policies. When it is necessary to test premium calculation models corresponding to multiple main insurance policies, the main insurance policy can be added to the generated condition combination and set as a mandatory condition to generate all condition combinations that at least include the main insurance policy. The address for reading the preset rate table and the preferential method for calculating premiums are determined based on the main insurance policy code and payment frequency. The testing tool established using the method provided in this disclosure embodiment can perform batch testing of premium calculation models under various insurance plans at once, greatly improving testing efficiency and accuracy.

[0134] Corresponding to the above method embodiments, this disclosure also provides an automatic testing device for data models, which can be used to execute the above method embodiments.

[0135] Figure 5 This is a block diagram of an automated testing apparatus for a data model according to an exemplary embodiment of this disclosure.

[0136] refer to Figure 5 The data model automatic testing device 500 may include:

[0137] The condition combination acquisition module 51 is configured to acquire all attribute combinations of multiple preset attributes and multiple preset conditions corresponding to the data model under test, and determine all condition combinations corresponding to the data model under test based on the all attribute combinations and the multiple preset conditions.

[0138] The target result acquisition module 52 is configured to acquire the preset attribute value of each preset attribute under each condition combination, and determine the first target result corresponding to each condition combination based on the preset attribute value of the preset attribute.

[0139] Input test module 53 is configured to generate multiple data requests corresponding to each of the condition combinations, and input the multiple data requests into the data model under test to obtain the second target result output by the data model under test corresponding to each of the condition combinations;

[0140] The test judgment module 54 is configured to output a test pass message for the data model under test when each of the second target results is equal to the first target result of the corresponding combination of conditions.

[0141] In one exemplary embodiment of this disclosure, at least one of the preset conditions is a range-limited condition, and the complete combination of conditions includes the combination of conditions corresponding to all allowed values ​​in the range-limited condition.

[0142] In one exemplary embodiment of this disclosure, the plurality of preset attributes include mandatory attributes and optional attributes, and each of the attribute combinations in the total attribute combinations includes at least one of the mandatory attributes.

[0143] In an exemplary embodiment of this disclosure, the target result acquisition module 52 is configured to: determine a preset attribute value for each preset attribute under the target condition combination based on at least one preset condition and / or at least one preset attribute in the target condition combination; determine a method for acquiring the first target result based on at least one preset condition and / or at least one preset attribute in the target condition combination; and acquire the first target result based on the method for acquiring the first target result corresponding to the target condition combination and the preset attribute value of each preset attribute.

[0144] In one exemplary embodiment of this disclosure, the target result acquisition module 52 is configured to: determine the attribute value reading address of each preset attribute based on at least one preset condition and / or at least one preset attribute of the target condition combination, and acquire the preset attribute value of each preset attribute based on the attribute value reading address; determine the first calculation formula corresponding to the target condition combination based on at least one preset condition and / or at least one preset attribute of the target condition combination; and substitute the preset attribute value of each preset attribute into the first calculation formula to obtain the first target result corresponding to the target condition combination.

[0145] In one exemplary embodiment of this disclosure, the data model to be tested is a premium calculation model, the plurality of preset conditions include at least age and participation in social security and non-participation in social security, the plurality of preset attributes include at least a plurality of target insurance types, and the preset attribute values ​​of the plurality of preset attributes include at least the pricing of each target insurance type.

[0146] In one exemplary embodiment of this disclosure, the premium calculation model uploads the second target result to a preset database, and the test judgment module 54 is further configured to obtain a third target result from the preset database, and when the third target result is equal to the first target result, output a storage test pass message for the data model under test.

[0147] Since the functions of the device 500 have been described in detail in their respective method embodiments, they will not be repeated here.

[0148] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to embodiments of this disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.

[0149] In an exemplary embodiment of this disclosure, an electronic device capable of implementing the above-described method is also provided.

[0150] Those skilled in the art will understand that various aspects of the present invention can be implemented as systems, methods, or program products. Therefore, various aspects of the present invention can be specifically implemented in the following forms: entirely hardware implementations, entirely software implementations (including firmware, microcode, etc.), or implementations combining hardware and software aspects, collectively referred to herein as “circuits,” “modules,” or “systems.”

[0151] The following reference Figure 6 To describe an electronic device 600 according to this embodiment of the present invention. Figure 6 The electronic device 600 shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.

[0152] like Figure 6 As shown, the electronic device 600 is manifested in the form of a general-purpose computing device. The components of the electronic device 600 may include, but are not limited to: at least one processing unit 610, at least one storage unit 620, and a bus 630 connecting different system components (including storage unit 620 and processing unit 610).

[0153] The storage unit stores program code that can be executed by the processing unit 610, causing the processing unit 610 to perform the steps described in the "Exemplary Methods" section of this specification according to various exemplary embodiments of the present invention. For example, the processing unit 610 can perform the method shown in the embodiments of this disclosure.

[0154] Storage unit 620 may include a readable medium in the form of a volatile storage unit, such as random access memory (RAM) 6201 and / or cache memory 6202, and may further include a read-only memory (ROM) 6203.

[0155] Storage unit 620 may also include a program / utility 6204 having a set (at least one) program module 6205, such program module 6205 including but not limited to: operating system, one or more application programs, other program modules and program data, each or some combination of these examples may include an implementation of a network environment.

[0156] Bus 630 can represent one or more of several types of bus structures, including a memory cell bus or memory cell controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local bus using any of the various bus structures.

[0157] Electronic device 600 can also communicate with one or more external devices 700 (e.g., keyboard, pointing device, Bluetooth device, etc.), and with one or more devices that enable a user to interact with electronic device 600, and / or with any device that enables electronic device 600 to communicate with one or more other computing devices (e.g., router, modem, etc.). This communication can be performed via input / output (I / O) interface 650. Furthermore, electronic device 600 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 660. As shown, network adapter 660 communicates with other modules of electronic device 600 via bus 630. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with electronic device 600, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0158] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, terminal device, or network device, etc.) to execute the methods according to the embodiments of this disclosure.

[0159] In exemplary embodiments of this disclosure, a computer-readable storage medium is also provided, on which a program product capable of implementing the methods described above is stored. In some possible embodiments, various aspects of the invention may also be implemented as a program product comprising program code that, when the program product is run on a terminal device, causes the terminal device to perform the steps of the various exemplary embodiments of the invention described in the "Exemplary Methods" section of this specification.

[0160] The program product for implementing the above-described method according to embodiments of the present invention may employ a portable compact disc read-only memory (CD-ROM) and include program code, and may run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto. In this document, the readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, apparatus, or device.

[0161] The program product may employ any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0162] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium, capable of sending, propagating, or transmitting programs for use by or in conjunction with an instruction execution system, apparatus, or device.

[0163] The program code contained on the readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.

[0164] Program code for performing the operations of this invention can be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java and C++, and conventional procedural programming languages ​​such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0165] Furthermore, the above figures are merely illustrative of the processes included in the method according to exemplary embodiments of the present invention, and are not intended to be limiting. It is readily understood that the processes shown in the above figures do not indicate or limit the temporal order of these processes. Additionally, it is readily understood that these processes may be executed synchronously or asynchronously, for example, in multiple modules.

[0166] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and concept of this disclosure are indicated by the claims.

Claims

1. An automatic testing method for data models, characterized in that, include: Obtain all attribute combinations and multiple preset conditions corresponding to the data model under test. Determine all condition combinations corresponding to the data model under test based on the all attribute combinations and the multiple preset conditions. The multiple preset attributes include mandatory attributes and optional attributes. Each attribute combination in the all attribute combinations includes at least one mandatory attribute. The preset attribute refers to a dimension with an attribute value, which is directly used by the data model under test and participates in the calculation. Obtain the preset attribute value of each preset attribute under each combination of conditions, and determine the first target result corresponding to each combination of conditions based on the preset attribute value of the preset attribute; Generate multiple data requests corresponding to each of the condition combinations, and input the multiple data requests into the data model under test to obtain the second target result output by the data model under test corresponding to each of the condition combinations; When each of the second target results is equal to the first target result of its corresponding combination of conditions, the output test pass message of the data model under test is output. The method of determining the first target result corresponding to each condition combination based on the preset attribute value of the preset attribute includes: determining a method for obtaining the first target result based on at least one preset condition and / or at least one preset attribute in the target condition combination, wherein the method for obtaining the first target result includes determining a first calculation formula corresponding to the target condition combination based on at least one preset condition and / or at least one preset attribute of the target condition combination.

2. The automatic testing method for data models as described in claim 1, characterized in that, At least one of the preset conditions is a range-limited condition, and all condition combinations include all condition combinations corresponding to all allowed values ​​in the range limit.

3. The automatic testing method for data models as described in claim 1, characterized in that, The step of obtaining the preset attribute value of each preset attribute under each of the condition combinations, and determining the first target result corresponding to each of the condition combinations based on the preset attribute values, includes: The preset attribute value of each preset attribute under the target condition combination is determined based on at least one preset condition and / or at least one preset attribute in the target condition combination; A method for obtaining the first target result is determined based on at least one preset condition and / or at least one preset attribute in the combination of target conditions; The first target result is obtained according to the method for obtaining the first target result corresponding to the combination of target conditions and the preset attribute value of each preset attribute.

4. The automatic testing method for data models as described in claim 2, characterized in that, The step of obtaining the preset attribute value of each preset attribute under each of the condition combinations, and determining the first target result corresponding to each of the condition combinations based on the preset attribute values, includes: The attribute value reading address of each preset attribute is determined based on at least one preset condition and / or at least one preset attribute of the target condition combination, and the preset attribute value of each preset attribute is obtained based on the attribute value reading address; The first calculation formula corresponding to the target condition combination is determined based on at least one preset condition and / or at least one preset attribute of the target condition combination; Substitute the preset attribute value of each preset attribute into the first calculation formula to obtain the first target result corresponding to the combination of target conditions.

5. The automatic testing method for data models as described in claim 1, characterized in that, The data model to be tested is a premium calculation model. The multiple preset conditions include at least age and participation in social security or non-participation in social security. The multiple preset attributes include at least multiple target insurance types. The preset attribute values ​​of the multiple preset attributes include at least the pricing of each target insurance type.

6. The automatic testing method for data models as described in claim 5, characterized in that, The premium calculation model uploads the second target result to a preset database, and the automatic testing method for the data model further includes: Obtain the third target result from the preset database; When the third target result equals the first target result, a storage test pass message for the data model under test is output.

7. An automatic testing device for data models, characterized in that, include: The condition combination acquisition module is configured to acquire all attribute combinations of multiple preset attributes and multiple preset conditions corresponding to the data model under test, and determine all condition combinations corresponding to the data model under test based on the all attribute combinations and the multiple preset conditions. The multiple preset attributes include mandatory attributes and optional attributes. Each attribute combination in the all attribute combinations includes at least one of the mandatory attributes. The preset attribute refers to a dimension with an attribute value, which is directly used by the data model under test and participates in the calculation. The target result acquisition module is configured to acquire the preset attribute value of each preset attribute under each combination of conditions, and determine the first target result corresponding to each combination of conditions based on the preset attribute value of the preset attribute. The input test module is configured to generate multiple data requests corresponding to each of the condition combinations, and input the multiple data requests into the data model under test to obtain the second target result output by the data model under test corresponding to each of the condition combinations; The test judgment module is configured to output a test pass message for the data model under test when each of the second target results is equal to the first target result of the corresponding combination of conditions. The target result acquisition module is configured to: determine a method for acquiring the first target result based on at least one preset condition and / or at least one preset attribute in the target condition combination, wherein the method for acquiring the first target result includes determining a first calculation formula corresponding to the target condition combination based on at least one preset condition and / or at least one preset attribute in the target condition combination.

8. An electronic device, characterized in that, include: Memory; as well as A processor coupled to the memory, the processor being configured to execute the automatic data model testing method as described in any one of claims 1-6 based on instructions stored in the memory.

9. A computer-readable storage medium having a program stored thereon that, when executed by a processor, implements the automatic testing method for a data model as described in any one of claims 1-6.

Citation Information

Patent Citations

  • Test method and device for insurance product, storage medium and electronic equipment

    CN109376093A

  • Implementation method and device for telecommunication charging service automatic testing

    CN111240983A