Report test method and device, electronic equipment and computer program product

By automatically generating and processing report test data, the problems of low efficiency and poor accuracy of manual testing in the existing technology are solved, and the automation and efficiency of report tests are achieved.

CN119473832APending Publication Date: 2025-02-18中国邮政储蓄银行股份有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411435490.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-15
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

In the process of verification of report data accuracy, the existing technology relies on manual testing, resulting in problems such as omissions in analysis, low data writing efficiency, poor consistency of test data, low accuracy of calculation and verification, and slow problem investigation.

Method used

Provide a report testing method, which automatically generates and processes report test data by obtaining data generation configuration information and data calculation configuration information, and realizes automatic verification of report test results using data generator and data calculation components.

Benefits of technology

It improves report testing efficiency and accuracy, supports the automatic generation of report testing data under multiple data sources, ensures the consistency of test data, and improves the efficiency and accuracy of data calculations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119473832A_ABST
    Figure CN119473832A_ABST
Patent Text Reader

Abstract

The invention discloses a report test method and device, electronic equipment and a computer program product. The method comprises the following steps: acquiring data generation configuration information; according to the data generation configuration information, generating report test data by using a data generator which is compiled based on data generation rules of a plurality of data sources; acquiring data measurement and calculation configuration information; according to the data measurement and calculation configuration information, a data measurement and calculation assembly is used for measuring and calculating the report test data, report measurement and calculation data is generated, and the data measurement and calculation assembly is obtained through compiling based on a data calculation rule; and obtaining a report operation result of the tested software, and checking the report measurement and calculation data and the report operation result to obtain a report test result. According to the method, automatic generation of report test data under multiple data sources is supported, various test scenes can be instantiated, and the data writing efficiency and the test data consistency are improved; and filtering and processing of the test data are supported, a report expected result is obtained, and the data measurement and calculation efficiency and accuracy are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of report testing, and in particular to a report testing method, device, electronic equipment, and computer program product. Background Art

[0002] In the functional testing phase, report verification includes verification of front-end functions and back-end data accuracy. The process of verifying data accuracy includes five stages: statistical caliber analysis, data writing, data calculation, data verification, and data cleaning.

[0003] In the statistical caliber analysis phase, due to the introduction of data marts, the original business data is isolated from the report data. This requires testers to further understand the data source and data structure and analyze the explicit and implicit data filtering conditions while being familiar with the business background. In the data writing phase, testers are required to understand the source data structure and refer to black box testing methods such as equivalence partitioning and boundary value method to write normal data and abnormal data. At the same time, testers must ensure that the data record specifications are consistent, the data logic is consistent, and the multi-node data is consistent. In the data calculation phase, testers use spreadsheets, databases and other tools to process the test data according to the statistical caliber and calculate the report results that meet the statistical caliber. In the data verification phase, testers compare the measured data with the report operation results to determine whether the report operation is correct. In the data cleaning phase, the data is cleaned to avoid affecting subsequent tests.

[0004] At present, each link of report data accuracy verification has different ability requirements for testers. If it relies entirely on manual testing, it is easy to have analysis omissions, low data writing efficiency, poor consistency of test data, low measurement and verification accuracy, and slow problem troubleshooting. Summary of the invention

[0005] The embodiments of the present application provide a report testing method, device, electronic device, and computer program product to improve the efficiency and accuracy of report testing.

[0006] The present application embodiment adopts the following technical solutions:

[0007] In a first aspect, an embodiment of the present application provides a report testing method, the report testing method comprising:

[0008] Get data generation configuration information;

[0009] According to the data generation configuration information, report test data is generated using a corresponding data generator, wherein the data generator is written based on data generation rules of multiple data sources;

[0010] Obtain data calculation configuration information;

[0011] According to the data calculation configuration information, the report test data is calculated and processed by using the corresponding data calculation component to generate report calculation data, wherein the data calculation component is written based on the data calculation rule;

[0012] The report operation result of the software under test is obtained, and the report measurement data is compared with the report operation result of the software under test to obtain the report test result.

[0013] Optionally, the acquiring data to generate configuration information includes:

[0014] Obtain inter-table generation configuration information and intra-table generation configuration information;

[0015] Among them, the inter-table generation configuration information includes detailed information of two fields with an association relationship in any two data tables, the data generator corresponding to the association relationship, and the data generation order; the intra-table generation configuration information includes detailed information of the fields in a single data table that affect the report data, the data generator used, and the constraints required to generate the data.

[0016] Optionally, before generating report test data using a preset data generator according to the data generation configuration information, the report test method further includes:

[0017] Determine data generation rules for multiple data sources;

[0018] Writing multiple data generators based on data generation rules of multiple data sources, wherein the data generators are divided into intra-table generators and inter-table generators;

[0019] The plurality of data generators are stored in a data generator maintenance library and the status of the data generators is recorded. The status of the data generator is divided into a registered status and a deregistered status.

[0020] Optionally, determining data generation rules for multiple data sources includes:

[0021] Decomposing the multiple data sources in layers to obtain the relationships between the multiple data sources, wherein the relationships between the multiple data sources include parallel relationships and inclusion relationships between data tables;

[0022] Decompose the fields of each data source and determine the valid and invalid intervals of each field based on the data calculation caliber;

[0023] In the case where the effective range of the field is determined by the inclusion relationship between data tables, the fields involved in the inclusion relationship between the data tables are preferentially decomposed.

[0024] Optionally, the acquiring of data calculation configuration information includes:

[0025] Obtain inter-table calculation configuration information and intra-table calculation configuration information;

[0026] Among them, the inter-table calculation configuration information includes detailed information of two fields with an association relationship in any two data tables, the data calculation components corresponding to the association relationship, and the data processing order; the intra-table calculation configuration information includes detailed information of the fields in a single data table that affect the report data, the data calculation components used, the constraints required for calculating the data, and the data processing order.

[0027] Optionally, before calculating and processing the report test data using a corresponding data calculation component according to the data calculation configuration information to generate report calculation data, the report test method further includes:

[0028] Summarize and decompose the data calculation process to obtain multiple functional nodes included in the data calculation process;

[0029] Compile multiple data calculation components according to multiple functional nodes, wherein the data calculation components are divided into intra-table calculation components and inter-table calculation components;

[0030] The plurality of data calculation components are stored in a data calculation component maintenance library and the status of the data calculation components is recorded. The status of the data calculation components is divided into a registered status and a deregistered status.

[0031] Optionally, generating report test data using a corresponding data generator according to the data generation configuration information includes:

[0032] Searching in a data generator maintenance library according to the data generation configuration information to determine whether there is a data generator in a registered state corresponding to the data generation configuration information;

[0033] If it exists, generate report test data using the data generator in the registered state corresponding to the data generation configuration information;

[0034] If it does not exist, write a data generator according to the data generation configuration information and register it in the data generator maintenance library;

[0035] The generating report calculation data by calculating and processing the report test data according to the data calculation configuration information using the corresponding data calculation component includes:

[0036] Searching in a data calculation component maintenance library according to the data calculation configuration information to determine whether there is a registered data calculation component corresponding to the data calculation configuration information;

[0037] If it exists, the registered data calculation component corresponding to the data calculation configuration information is used to perform calculation processing to generate report calculation data;

[0038] If it does not exist, a data calculation component is written according to the data calculation configuration information and registered in the data calculation component maintenance library.

[0039] In a second aspect, an embodiment of the present application further provides a report testing device, the report testing device comprising:

[0040] A first acquisition unit, used to acquire data generation configuration information;

[0041] A generating unit, configured to generate configuration information according to the data, and generate report test data using a corresponding data generator, wherein the data generator is written based on data generation rules of multiple data sources;

[0042] A second acquisition unit, used to acquire data measurement configuration information;

[0043] A calculation unit, configured to calculate and process the report test data according to the data calculation configuration information using a corresponding data calculation component to generate report calculation data, wherein the data calculation component is written based on a data calculation rule;

[0044] The checking unit is used to obtain the report operation result of the software under test, and check the report measurement data with the report operation result of the software under test to obtain the report test result.

[0045] In a third aspect, an embodiment of the present application further provides an electronic device, including:

[0046] A processor; and a memory arranged to store computer executable instructions, wherein when the executable instructions are executed, the processor executes any of the aforementioned report testing methods.

[0047] In a fourth aspect, an embodiment of the present application further provides a computer program product, including a computer program or instructions, which implement any of the aforementioned report testing methods when executed by a processor.

[0048] At least one of the above technical solutions adopted in the embodiment of the present application can achieve the following beneficial effects: the report test method of the embodiment of the present application first obtains data generation configuration information; then, according to the data generation configuration information, generates report test data using the corresponding data generator, and the data generator is written based on the data generation rules of multiple data sources; then obtains data measurement configuration information; then, according to the data measurement configuration information, uses the corresponding data measurement component to measure and process the report test data to generate report measurement data, and the data measurement component is written based on the data calculation rules; finally, obtains the report operation result of the tested software, and verifies the report measurement data and the report operation result of the tested software to obtain the report test result. On the one hand, the embodiment of the present application supports the automatic generation of report test data under multiple data sources. Through the data generator and its configuration information, various normal and abnormal test scenarios can be instantiated, which improves the efficiency of data writing and ensures the consistency of test data. On the other hand, it supports configurable data measurement, which can realize the filtering and processing of test data, obtain the expected results of the report, and improve the efficiency and accuracy of data measurement. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0050] Figure 1 A flowchart of a report testing method in an embodiment of the present application;

[0051] Figure 2 This is a schematic diagram of the overall flow of a report test in an embodiment of the present application;

[0052] Figure 3 This is a structural schematic diagram of a report test device in an embodiment of the present application;

[0053] Figure 4 This is a schematic diagram of the structure of an electronic device in an embodiment of the present application. DETAILED DESCRIPTION

[0054] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in combination with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.

[0055] The technical solutions provided by various embodiments of the present application are described in detail below in conjunction with the accompanying drawings.

[0056] At present, the data writing and data calculation stages of data accuracy verification are highly dependent on manual work, resulting in analysis omissions, low data writing efficiency, inconsistent data, low calculation and verification accuracy, and slow problem troubleshooting.

[0057] 1) In the data writing stage, it is necessary to fully consider the normal and abnormal scenarios of each data table, field and their combination in the report data source. The manual writing process has high requirements on the ability of testers. Without knowledge accumulation or unified writing standards, it is very easy to miss test scenarios. A report can be processed from multiple data sources in multiple steps. Manual writing of data may lead to inconsistent data record specifications, inconsistent data logic and inconsistent data at multiple nodes. At the same time, manual writing itself and rework caused by omissions will lead to low efficiency in this stage.

[0058] 2) In the data calculation phase, testers need to calculate the expected report results based on statistical criteria. This process requires testers to use relatively complex SQL or other structured data statistical tools such as spreadsheets for calculation. Operational errors by testers may lead to incorrect calculation results or failure to obtain trial calculation results, resulting in misjudgment of test results and invalid troubleshooting.

[0059] The present application embodiment provides a report testing method, such as Figure 1 As shown, a flow chart of a report testing method in an embodiment of the present application is provided, and the report testing method at least includes the following steps S110 to S150:

[0060] Step S110, obtaining data generation configuration information.

[0061] When performing report testing, it is necessary to first obtain the data generation configuration information configured by the tester. The data generation configuration information may include, for example, the hierarchical relationship and constraint relationship of each table of the data source, the data generator used by the fields in each table, and the data interval, etc. The specific configuration can be flexibly set by those skilled in the art according to the test requirements, and is not specifically limited here.

[0062] Step S120: generating report test data using a corresponding data generator according to the data generation configuration information, wherein the data generator is written based on data generation rules of multiple data sources.

[0063] After obtaining the data generation configuration information, it is necessary to determine the data generator required to generate the test data based on the data generation configuration information. The data generator in the embodiment of the present application can be understood as a code segment written based on the data generation rules of multiple data sources. By executing the code of the data generator, report test data that meets the requirements of the data generation rules can be generated. The report test data can be regarded as the detailed data required for the report job. What types of data generators to write and how to define the data generation rules can be flexibly set according to the test requirements and are not specifically limited here.

[0064] Step S130, obtaining data calculation configuration information.

[0065] After generating the report test data, it is necessary to further obtain data calculation configuration information, which is mainly the configuration information of the report test data calculation rules, for example, it may include the data calculation components required to calculate the data, the order of data processing, etc. The specific configuration can be flexibly set by those skilled in the art according to the test requirements, and is not specifically limited here.

[0066] Step S140, according to the data calculation configuration information, use the corresponding data calculation component to calculate and process the report test data to generate report calculation data, and the data calculation component is written based on data calculation rules.

[0067] After obtaining the data calculation configuration information, it is necessary to determine the data calculation components required for data calculation based on the data calculation configuration information. The data calculation component of the embodiment of the present application is a code segment that calculates the report data according to the data calculation rule configuration information, and automatically calculates the report data according to the configuration information. The data calculation component can disassemble the data processing logic according to the statistical caliber of the report, and filter and process the test data step by step by configuring the preset calculation components, so as to obtain the report calculation data. What types of data calculation components to write and how to define the data calculation rules can be flexibly set according to the test requirements, and are not specifically limited here.

[0068] Step S150, obtaining the report operation result of the software under test, and comparing the report measurement data with the report operation result of the software under test to obtain the report test result.

[0069] The report calculation data obtained through the above steps can be regarded as the expected result of the report operation, which is used to corroborate and check with the actual report operation results of the software under test to verify whether the report operation logic of the software or system under test is correct.

[0070] On the one hand, the embodiment of the present application supports the automatic generation of report test data under multiple data sources. Through the data generator and its configuration information, various normal and abnormal test scenarios can be instantiated, which improves the efficiency of data writing and ensures the consistency of test data. On the other hand, it supports configurable data measurement, which can filter and process test data, obtain the expected results of the report, and improve the efficiency and accuracy of data measurement.

[0071] In some embodiments of the present application, before generating report test data using a preset data generator according to the data generation configuration information, the report testing method also includes: determining data generation rules for multiple data sources; writing multiple data generators based on the data generation rules for the multiple data sources, and the data generators are divided into intra-table generators and inter-table generators; storing the multiple data generators in a data generator maintenance library and recording the status of the data generators, and the status of the data generators is divided into a registered state and a deregistered state.

[0072] Data generators are code segments written according to data generation rules to automatically generate test data. Data generators can be divided into intra-table generators and inter-table generators. Intra-table generators generate test data based on different field data types in the data table, and inter-table generators generate test data based on the constraints between data tables. Some data generators are listed in Table 1:

[0073] Table 1

[0074]

[0075] The generated data generator can be stored in the data generator maintenance library for unified maintenance and management, and the status of the data generator can be recorded. The status of the data generator can be divided into registered status and deregistered status. New data generators can be flexibly registered or data generators that are no longer used can be deregistered according to actual test requirements. Only data generators in the registered state can be used to generate test data.

[0076] In some embodiments of the present application, the data generation rules for determining multiple data sources include: hierarchically decomposing the multiple data sources to obtain the relationship between the multiple data sources, the relationship between the multiple data sources including the parallel relationship and the inclusion relationship between data tables; decomposing the fields of each data source, and determining the valid interval and invalid interval of each field according to the data calculation caliber; when the valid interval of the field is determined by the inclusion relationship between the data tables, the fields involved in the inclusion relationship between the data tables are preferentially decomposed.

[0077] The data generator mainly instantiates the test data according to the test data generation rules, where the data generation rules may include:

[0078] 1) Decompose the data sources in layers and decompose the relationships between multiple data sources, that is, the parallel (e.g. association) or inclusion (e.g. subquery) relationships between data tables;

[0079] 2) Decompose the fields of each data source, determine the valid interval and invalid interval of each field according to the data calculation caliber, and select the data to be tested in the two intervals respectively;

[0080] 3) If the effective range of a field is dynamically determined by a subquery, the subquery field is decomposed first.

[0081] Of course, the specific data generation rules can be flexibly set by those skilled in the art according to actual needs, and are not specifically limited here.

[0082] In some embodiments of the present application, obtaining data generation configuration information includes: obtaining inter-table generation configuration information and intra-table generation configuration information; wherein, the inter-table generation configuration information includes detailed information of two fields with an association relationship in any two data tables, the data generator corresponding to the association relationship, and the data generation order; the intra-table generation configuration information includes detailed information of fields in a single data table that affect report data, the data generator used, and the constraints required to generate data.

[0083] The data generation configuration information of the embodiment of the present application can be divided into inter-table generation configuration information and intra-table generation configuration information. The inter-table generation configuration information mainly records the detailed information of two fields with an association relationship in any two data tables, the data generator corresponding to the relationship, and the data generation order, i.e., priority, and other information. As shown in Table 2 below, according to the following configuration, the data generator can generate data field by field in the order of Table3, Table1, Table2 or Table3, Table2, Table1.

[0084] Table 2

[0085] Field 1 Belonging table 1 Field 2 Belonging table 2 Generator Priority Customer Number Table 1 Customer Number Table 2 Equality Generator 1 Transaction Status Table 1 state Table 3 Contains generator 2

[0086] The in-table generation configuration information mainly records the detailed information of the fields in a single data table that affect the report data (such as field name, table to which it belongs), the data generator used, and the constraints required to generate the data. If there are no constraints, the data generator generates random numbers that meet the format requirements, otherwise, the generated random numbers are further selected.

[0087] Table 3-5 below provides examples of generating configuration information in Table 1, Table 2, and Table 3.

[0088] Table 3

[0089]

[0090] Table 4

[0091]

[0092] Table 5

[0093]

[0094] A code segment that generates test data based on the data generation rule configuration information. The generated data also satisfies the relationship between data tables, the data type of the fields in the data tables, and the constraints.

[0095] Except for the fields that use the "in-table constraint generator", other fields will randomly generate data lists. After all field lists are ready, the configured generated data is fully combined. Assume that there are N fields from multiple data sources (different data tables), and the number of field data is n1, n2...n n , then at most n1*n2*……n can be generated n Since only the fields that affect the report data need to be configured, the overall data volume is controllable.

[0096] In some embodiments of the present application, before generating report calculation data by calculating and processing the report test data according to the data calculation configuration information and using the corresponding data calculation component, the report testing method also includes: summarizing and decomposing the data calculation process to obtain multiple functional nodes included in the data calculation process; writing multiple data calculation components according to the multiple functional nodes, and the data calculation components are divided into intra-table calculation components and inter-table calculation components; storing the multiple data calculation components in the data calculation component maintenance library and recording the status of the data calculation components, and the status of the data calculation components is divided into a registered state and a deregistered state.

[0097] The data calculation component summarizes and decomposes the data processing process and refines it into a processor with a single function. It is a code segment that processes or filters the data in one step. Specifically, Python Pandas provides a large number of functions and methods for processing data quickly and conveniently. The embodiments of this application can encapsulate the methods and construct a calculation component, which can directly process the data in the spreadsheet. Some components are listed in Table 6 below:

[0098] Table 6

[0099]

[0100] The generated data calculation components can be stored in the data calculation component maintenance library for unified maintenance and management, and the status of the data calculation components can be recorded. The status of the data calculation components can be divided into registered status and deregistered status. New data calculation components can be flexibly registered or data calculation components that are no longer used can be deregistered according to actual testing needs. Only data calculation components in the registered state can be used to calculate data.

[0101] In some embodiments of the present application, obtaining data calculation configuration information includes: obtaining inter-table calculation configuration information and intra-table calculation configuration information; wherein, the inter-table calculation configuration information includes detailed information of two fields with an association relationship in any two data tables, the data calculation components corresponding to the association relationship, and the data processing order; the intra-table calculation configuration information includes detailed information of fields in a single data table that affect report data, the data calculation components used, the constraints required for calculating the data, and the data processing order.

[0102] The data calculation configuration information of the embodiment of the present application can be divided into inter-table calculation configuration information and intra-table calculation configuration information. According to the calculation component configuration information, the calculation components are arranged, the input parameters and output data are instantiated, and finally expanded into Python code that can process data. The following Tables 7 and 8 are used as examples for explanation.

[0103] The inter-table calculation configuration information records the detailed information of two fields with an association relationship in any two data tables, the data calculation components corresponding to the relationship, the order of data screening and processing, and the order of data screening and processing in the previous step. Among them, the "processing order" and "previous step sequence number" are numbered from small to large, indicating the order of filtering, processing, and aggregation of detailed data step by step.

[0104] Table 7

[0105] Field 1 Belonging table 1 Field 2 Belonging table 2 Calculation components Processing order Previous step number Customer Number Table 1 Customer Number Table 2 Relationship 1 - state Table 1 state Table 3 Subqueries 2 1

[0106] According to the above table calculation configuration information, the following can be performed:

[0107] 【1】inner_join=Table1_df.join(Table2_df.set_index('Customer Number'),on='Customer Number',how='inner')

[0108] 【2】result=data[inner_join['status'].isin([status list])]

[0109] The calculation configuration information in the table records the detailed information of the fields in a single data table that affect the report data (such as field name, table to which it belongs), the filtering and processing components required for report calculation, constraints, the order of data screening and processing, the order of data screening and processing in the previous step, etc.

[0110] Table 8

[0111] Connection Field Name Belonging table Calculation components Constraints Processing order Previous step number - state Table 3 Value Deduplication 0 - AND Transaction amount Table 1 Greater than 10000 3 2 OR Transaction amount Table 1 Less than 5000 3 2 - Transaction amount Table 1 Value Descending 4 3 AND Remark Table 1 Contains keywords Subscription 3 2

[0112] Combined with the inter-table and intra-table calculation configuration information, the following content can be executed, and the calculation result will be used as the expected result of data verification.

[0113] 【0】Status list = Table3_df['status'].unique()

[0114] 【1】inner_join=Table1_df.join(Table2_df.set_index('Customer Number'),on='Customer Number',how='inner')

[0115] 【2】result=data[inner_join['status'].isin([status list])]

[0116] 【3】result2=data[(result['Transaction amount']>10000|result['Transaction amount']<5000)&(data['Remarks'].str.contains(['Subscription']))]

[0117] 【4】result3=result2['transaction amount'].sort_values('transaction amount',ascending=False)

[0118] In some embodiments of the present application, generating report test data according to the data generation configuration information using the corresponding data generator includes: searching in the data generator maintenance library according to the data generation configuration information to determine whether there is a data generator in a registered state corresponding to the data generation configuration information; if so, generating report test data using the data generator in a registered state corresponding to the data generation configuration information; if not, writing a data generator according to the data generation configuration information and registering it in the data generator maintenance library; performing calculation processing on the report test data using the corresponding data calculation component according to the data calculation configuration information to generate report calculation data includes: searching in the data calculation component maintenance library according to the data calculation configuration information to determine whether there is a data calculation component in a registered state corresponding to the data calculation configuration information; if so, performing calculation processing using the data calculation component in a registered state corresponding to the data calculation configuration information to generate report calculation data; if not, writing a data calculation component according to the data calculation configuration information and registering it in the data calculation component maintenance library.

[0119] When loading the corresponding data generator based on the data generation configuration information, you can first search the data generator maintenance library to determine whether the configured data generator matches. If it does not exist or the configured data generator is in a deregistered state, you can rebuild a new data generator and maintain it in the data generator maintenance library.

[0120] Similarly, when loading the corresponding data computing component based on the data computing configuration information, you can first search in the data computing component maintenance library to determine whether the configured data computing component matches. If it does not exist or the configured data computing component is in a deregistered state, you can rebuild a new data computing component and maintain it in the data computing component maintenance library.

[0121] In order to facilitate the understanding of the above embodiments, Figure 2 As shown, a schematic diagram of the overall flow of a report test in an embodiment of the present application is provided. It mainly includes the following steps S1-S8:

[0122] S1: Check the test data generator: Check whether the preset generator can meet the data requirements. If it cannot meet the requirements, enter S1-1, update the data generator, and complete the registration.

[0123] S2: Enter data generation configuration information: Analyze the data table and field information related to the report data source, the report calculation logic, and complete the filling of the inter-table configuration information and the intra-table configuration information based on the above information. Note that the generator filled in must be a registered generator.

[0124] S3: Generate test data: Generate configuration information based on the data, automatically generate test data, and store it in a spreadsheet.

[0125] S4: Check test data: Check whether there is garbled code, duplication, etc. in the test data generation. If so, it is necessary to maintain the test data generator and start again from S1.

[0126] S5: Check data calculation components: Check whether the preset calculation components can meet the report calculation requirements. If not, go to S5-1, write a new data calculation component, and complete the registration.

[0127] S6: Enter data calculation configuration information: Complete the filling of inter-table configuration information and intra-table configuration information based on the report calculation logic. Note that the components filled in must be registered components.

[0128] S7: Generate calculation data: According to the data calculation configuration information, automatically generate report calculation results and save them in spreadsheet storage.

[0129] S8: Check data calculation results: Perform spot checks on the calculation results. If there are any problems, it is necessary to maintain the test data calculation component and start again from S5.

[0130] In summary, the key points of the report testing method of this application mainly include:

[0131] 1) This application proposes a data accuracy testing method that combines black box and white box. With reference to the black box testing method, data writing rules are determined under a unified data testing standard. With reference to the white box testing method, each data table, field and combination thereof in the data source is decomposed. The combination of the two can cover normal and abnormal scenarios of the report and ensure the integrity of the test scenario.

[0132] 2) This application proposes a method for automatically generating test data under multiple data sources. This method ensures that the generated data not only satisfies the constraints within the data table, but also satisfies the constraints between data tables. Through the data generator and its configuration information, various normal and abnormal test scenarios can be instantiated to improve data writing efficiency and ensure test data consistency.

[0133] 3) This application proposes a configurable data measurement method, which includes data measurement components and measurement configuration information. Testers configure the measurement components according to the statistical scope of the report to filter and process the test data and obtain the expected results of the report, thereby improving the efficiency and accuracy of data measurement.

[0134] The report testing method of this application has achieved at least the following technical effects:

[0135] 1) For the first time, it supports the automatic generation of data from multiple data sources. Test data is no longer limited to a single data source, thus greatly improving the applicability of the automatic report data generation method;

[0136] 2) During the data generation process, only the data tables and fields that affect the report calculation need to be configured, so the data volume is controllable and the operability is strong;

[0137] 3) The introduction of atomic-scale data generators and data measurement components makes the data verification process highly configurable and scalable;

[0138] 4) During the data measurement process, the measurement components are arranged according to the measurement component configuration information, and expanded into layered and sequential data processing codes. The data processing results can be obtained step by step, which is convenient for quickly locating the cause of the problem and corroborating with the measured code (such as SQL).

[0139] The present application embodiment also provides a report testing device 300, such as Figure 3 As shown, a structural schematic diagram of a report testing device in an embodiment of the present application is provided, wherein the report testing device 300 includes: a first acquisition unit 310, a generation unit 320, a second acquisition unit 330, a calculation unit 340 and a checking unit 350, wherein:

[0140] A first acquisition unit 310 is used to acquire data generation configuration information;

[0141] A generating unit 320, configured to generate report test data according to the data generation configuration information using a corresponding data generator, wherein the data generator is written based on data generation rules of multiple data sources;

[0142] The second acquisition unit 330 is used to acquire data calculation configuration information;

[0143] A calculation unit 340 is used to calculate and process the report test data according to the data calculation configuration information using a corresponding data calculation component to generate report calculation data, wherein the data calculation component is written based on a data calculation rule;

[0144] The checking unit 350 is used to obtain the report operation result of the software under test, and check the report measurement data with the report operation result of the software under test to obtain the report test result.

[0145] In some embodiments of the present application, the first acquisition unit 310 is specifically used to: acquire inter-table generation configuration information and intra-table generation configuration information; wherein the inter-table generation configuration information includes detailed information of two fields with an association relationship in any two data tables, the data generator corresponding to the association relationship, and the data generation order; the intra-table generation configuration information includes detailed information of fields in a single data table that affect report data, the data generator used, and the constraints required to generate data.

[0146] In some embodiments of the present application, the report testing device 300 also includes: a determination unit, used to determine data generation rules for multiple data sources before generating report test data using a preset data generator according to the data generation configuration information; a first writing unit, used to write multiple data generators based on the data generation rules of multiple data sources, and the data generators are divided into intra-table generators and inter-table generators; a first storage unit, used to store the multiple data generators in a data generator maintenance library and record the status of the data generator, and the status of the data generator is divided into a registered state and a deregistered state.

[0147] In some embodiments of the present application, the determination unit is specifically used to: perform hierarchical decomposition on multiple data sources to obtain the relationship between the multiple data sources, where the relationship between the multiple data sources includes a parallel relationship and an inclusion relationship between data tables; decompose the fields of each data source, and determine the valid interval and invalid interval of each field based on the data calculation caliber; when the valid interval of the field is determined by the inclusion relationship between data tables, the fields involved in the inclusion relationship between the data tables are preferentially decomposed.

[0148] In some embodiments of the present application, the second acquisition unit 330 is specifically used to: acquire inter-table calculation configuration information and intra-table calculation configuration information; wherein the inter-table calculation configuration information includes detailed information of two fields with an association relationship in any two data tables, data calculation components corresponding to the association relationship, and a data processing sequence; the intra-table calculation configuration information includes detailed information of fields in a single data table that affect report data, the data calculation components used, constraints required for calculating data, and a data processing sequence.

[0149] In some embodiments of the present application, the report testing device 300 also includes: a decomposition unit, which is used to summarize and decompose the data calculation process before generating report calculation data by using corresponding data calculation components to calculate the report test data according to the data calculation configuration information; a second writing unit, which is used to write multiple data calculation components according to multiple functional nodes, and the data calculation components are divided into intra-table calculation components and inter-table calculation components; a second storage unit, which is used to store multiple data calculation components in a data calculation component maintenance library and record the status of the data calculation components, and the status of the data calculation components is divided into a registered state and a deregistered state.

[0150] In some embodiments of the present application, the generation unit 320 is specifically used to: search in the data generator maintenance library according to the data generation configuration information to determine whether there is a data generator in a registered state corresponding to the data generation configuration information; if so, generate report test data using the data generator in a registered state corresponding to the data generation configuration information; if not, write a data generator according to the data generation configuration information and register it in the data generator maintenance library; the calculation unit 340 is specifically used to: search in the data calculation component maintenance library according to the data calculation configuration information to determine whether there is a data calculation component in a registered state corresponding to the data calculation configuration information; if so, use the data calculation component in a registered state corresponding to the data calculation configuration information to perform calculation processing and generate report calculation data; if not, write a data calculation component according to the data calculation configuration information and register it in the data calculation component maintenance library.

[0151] It can be understood that the above-mentioned report testing device can implement each step of the report testing method provided in the above-mentioned embodiment. The relevant explanations about the report testing method are applicable to the report testing device and will not be repeated here.

[0152] Figure 4 This is a schematic diagram of the structure of an electronic device according to an embodiment of the present application. Figure 4 At the hardware level, the electronic device includes a processor, and optionally also includes an internal bus, a network interface, and a memory. The memory may include a memory, such as a high-speed random access memory (RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk storage. Of course, the electronic device may also include hardware required for other services.

[0153] The processor, network interface and memory can be interconnected through an internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0154] The memory is used to store the program. Specifically, the program may include a program code, and the program code includes a computer operation instruction. The memory may include a memory and a non-volatile memory, and provides instructions and data to the processor.

[0155] The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it, forming a report test device at the logical level. The processor executes the program stored in the memory and is specifically used to perform the following operations:

[0156] Get data generation configuration information;

[0157] According to the data generation configuration information, report test data is generated using a corresponding data generator, wherein the data generator is written based on data generation rules of multiple data sources;

[0158] Obtain data calculation configuration information;

[0159] According to the data calculation configuration information, the report test data is calculated and processed by using the corresponding data calculation component to generate report calculation data, wherein the data calculation component is written based on the data calculation rule;

[0160] The report operation result of the software under test is obtained, and the report measurement data is compared with the report operation result of the software under test to obtain the report test result.

[0161] The above application Figure 1The method performed by the report test device disclosed in the illustrated embodiment can be applied to a processor or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in the processor or an instruction in the form of software. The above processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application can be directly embodied as a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. The software module can be located in a storage medium mature in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.

[0162] The present application also provides a computer program product, including a computer program or an instruction, which is implemented when the computer program or the instruction is executed by a processor. Figure 1 The report test method in the embodiment shown is specifically used to perform:

[0163] Get data generation configuration information;

[0164] According to the data generation configuration information, report test data is generated using a corresponding data generator, wherein the data generator is written based on data generation rules of multiple data sources;

[0165] Obtain data calculation configuration information;

[0166] According to the data calculation configuration information, the report test data is calculated and processed by using the corresponding data calculation component to generate report calculation data, wherein the data calculation component is written based on the data calculation rule;

[0167] The report operation result of the software under test is obtained, and the report measurement data is compared with the report operation result of the software under test to obtain the report test result.

[0168] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0169] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0170] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0171] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0172] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0173] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0174] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0175] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0176] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0177] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims

1. A report testing method, characterized in that: The report testing method comprises: Get data generation configuration information; According to the data generation configuration information, report test data is generated using a corresponding data generator, wherein the data generator is written based on data generation rules of multiple data sources; Obtain data calculation configuration information; According to the data calculation configuration information, the report test data is calculated and processed by using the corresponding data calculation component to generate report calculation data, wherein the data calculation component is written based on the data calculation rule; The report operation result of the software under test is obtained, and the report measurement data is compared with the report operation result of the software under test to obtain the report test result.

2. The report testing method according to claim 1, characterized in that: The acquiring of data to generate configuration information includes: Obtain inter-table generation configuration information and intra-table generation configuration information; Among them, the inter-table generation configuration information includes detailed information of two fields with an association relationship in any two data tables, the data generator corresponding to the association relationship, and the data generation order; the intra-table generation configuration information includes detailed information of the fields in a single data table that affect the report data, the data generator used, and the constraints required to generate the data.

3. The report testing method according to claim 1, characterized in that: Before generating report test data using a preset data generator according to the data generation configuration information, the report test method further includes: Determine data generation rules for multiple data sources; Writing multiple data generators based on data generation rules of multiple data sources, wherein the data generators are divided into intra-table generators and inter-table generators; The plurality of data generators are stored in a data generator maintenance library and the status of the data generators is recorded. The status of the data generator is divided into a registered status and a deregistered status.

4. The report testing method according to claim 3, characterized in that: The data generation rules for determining the multiple data sources include: Decomposing the multiple data sources in layers to obtain the relationships between the multiple data sources, wherein the relationships between the multiple data sources include parallel relationships and inclusion relationships between data tables; Decompose the fields of each data source and determine the valid and invalid intervals of each field based on the data calculation caliber; In the case where the effective range of the field is determined by the inclusion relationship between data tables, the fields involved in the inclusion relationship between the data tables are preferentially decomposed.

5. The report testing method according to claim 1, characterized in that: The acquisition of data calculation configuration information includes: Obtain inter-table calculation configuration information and intra-table calculation configuration information; Among them, the inter-table calculation configuration information includes detailed information of two fields with an association relationship in any two data tables, the data calculation components corresponding to the association relationship, and the data processing order; the intra-table calculation configuration information includes detailed information of the fields in a single data table that affect the report data, the data calculation components used, the constraints required for calculating the data, and the data processing order.

6. The report testing method according to claim 1, characterized in that: Before calculating and processing the report test data using the corresponding data calculation component according to the data calculation configuration information to generate the report calculation data, the report test method further includes: Summarize and decompose the data calculation process to obtain multiple functional nodes included in the data calculation process; Compile multiple data calculation components according to multiple functional nodes, wherein the data calculation components are divided into intra-table calculation components and inter-table calculation components; The plurality of data calculation components are stored in a data calculation component maintenance library and the status of the data calculation components is recorded. The status of the data calculation components is divided into a registered status and a deregistered status.

7. The report testing method according to claim 1, characterized in that: Generating the report test data using the corresponding data generator according to the data generation configuration information includes: Searching in a data generator maintenance library according to the data generation configuration information to determine whether there is a data generator in a registered state corresponding to the data generation configuration information; If it exists, generate report test data using the data generator in the registered state corresponding to the data generation configuration information; If it does not exist, write a data generator according to the data generation configuration information and register it in the data generator maintenance library; The generating report calculation data by calculating and processing the report test data according to the data calculation configuration information using the corresponding data calculation component includes: Searching in a data calculation component maintenance library according to the data calculation configuration information to determine whether there is a registered data calculation component corresponding to the data calculation configuration information; If it exists, the registered data calculation component corresponding to the data calculation configuration information is used to perform calculation processing to generate report calculation data; If it does not exist, a data calculation component is written according to the data calculation configuration information and registered in the data calculation component maintenance library.

8. A report testing device, characterized in that: The report testing device comprises: A first acquisition unit, used to acquire data generation configuration information; A generating unit, configured to generate configuration information according to the data, and generate report test data using a corresponding data generator, wherein the data generator is written based on data generation rules of multiple data sources; A second acquisition unit, used to acquire data measurement configuration information; A calculation unit, configured to calculate and process the report test data according to the data calculation configuration information using a corresponding data calculation component to generate report calculation data, wherein the data calculation component is written based on a data calculation rule; The checking unit is used to obtain the report operation result of the software under test, and check the report measurement data with the report operation result of the software under test to obtain the report test result.

9. An electronic device, comprising: processor; and a memory arranged to store computer executable instructions, wherein when the executable instructions are executed, the processor executes the report testing method according to any one of claims 1 to 7.

10. A computer program product, comprising a computer program or instructions, wherein the computer program or instructions, when executed by a processor, implements the report testing method according to any one of claims 1 to 7.