Test data generation method and device

By analyzing business scenarios and generating time-series link tables, the problem of insufficient test data coverage in financial business systems was solved, enabling efficient generation and accurate coverage of test data across all business lines, thus ensuring the completeness of test results.

CN115437953BActive Publication Date: 2025-10-28AGRICULTURAL BANK OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211202928.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-29
Publication Date
2025-10-28
Estimated Expiration
2042-09-29

AI Technical Summary

Technical Problem

Existing technologies cannot effectively cover key moments and time relationships between activities in various business scenarios within financial business systems, resulting in low efficiency and insufficient coverage in test data generation.

Method used

By acquiring the generation requests of business activities, parsing business lines and activities, establishing business scenarios, analyzing time data items and business rules, generating a time-series link table, determining the data table and performing data writing operations, and generating test data.

Benefits of technology

It improved the efficiency of test data generation, ensured that test data covered the entire business lifecycle, avoided omissions, and improved the accuracy and coverage of test results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115437953B_ABST
    Figure CN115437953B_ABST
Patent Text Reader

Abstract

This application provides a method and apparatus for generating test data, relating to the field of computer technology. The method includes: classifying and analyzing all business activities to establish business scenarios; analyzing the time data items of each business activity within a business scenario, determining the time-series link of the business scenario, and then determining a time-series link table; determining the business rules for each business activity within the business scenario, and obtaining the scripts corresponding to the business rules to determine the data tables for each business activity; generating data templates for each business activity, and performing data writing operations on the data templates of each business activity according to the time-series link table of the business scenario and the data tables of each business activity to generate test data corresponding to each business activity within the business scenario. This method improves the coverage of test data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a method and apparatus for generating test data. Background Technology

[0002] Constructing test data is a crucial step in testing business systems. To improve testing efficiency, business system testing typically uses test data that meets testing requirements and conforms to actual production business time rules, ideally authentic production data. However, in the financial industry, due to its confidentiality and special nature, financial business systems contain a large amount of sensitive data that cannot be used directly. To avoid a series of problems caused by the leakage of customer privacy information, it is often necessary to anonymize the data within financial business systems to generate test data. Because anonymization hides many business attributes, especially the time attributes, the data cannot well match business rules and therefore cannot be fully used as test data. Therefore, an effective method for constructing test data that can fully cover business time rules is particularly important.

[0003] The process of some existing test data construction methods is as follows: First, obtain the generation rules of multiple sets of test data to be generated, as well as the association information of each set of test data in the multiple sets of test data; then, based on the association information, determine the associated data items between each set of test data and other sets of test data; finally, generate multiple sets of test data with consistent data content of associated data items according to the data generation rules.

[0004] However, the above method has the following drawbacks: the method requires first determining the correlation information of each group of test data, and also requires finding the table correlation and field correlation. In addition, data is constructed for each field. Since there are many data tables and a large number of field attributes involved, the manpower cost of constructing test data is too high. Furthermore, the time information needs to be manually corrected again, resulting in low data coverage. Therefore, the existing technology cannot guarantee that the test data fully covers the key time points and time relationships between activities in various business scenarios. Summary of the Invention

[0005] This application provides a method and apparatus for generating test data to solve the problem that existing technologies cannot guarantee that test data fully covers key time points and time relationships between activities in various business scenarios.

[0006] According to a first aspect of this application, a method for generating test data is provided, comprising:

[0007] Obtain the generation request for test data to be generated for testing the target financial business system, and parse the business line to which the test data to be generated belongs, as well as several business activities under the business line, from the generation request;

[0008] All the aforementioned business activities are categorized and analyzed to establish business scenarios;

[0009] Analyze the time data items of various business activities in the business scenario and determine the time sequence of the business scenario; wherein, the time data items include at least one of: key time points, duration, and flow order, and the time sequence includes the flow order of each business activity;

[0010] Obtain an empty table, and generate a time sequence table for the business scenario based on the time sequence of the business scenario and the empty table;

[0011] Determine the business rules for each business activity under the business scenario, and obtain the scripts corresponding to the business rules for each business activity under the business scenario, so as to determine the data table for each business activity;

[0012] Data templates for each business activity are generated, and data writing operations are performed on the data templates of each business activity according to the time-series link table of the business scenario and the data table of each business activity to generate test data corresponding to each business activity in the business scenario. The target financial business system is then tested using the test data corresponding to each business activity in the business scenario to obtain test results.

[0013] Optionally, the step of classifying and analyzing all the business activities to establish business scenarios includes:

[0014] A correlation analysis is performed on all the aforementioned business activities to obtain the analysis results; wherein, the analysis results represent the correlation strength between different business activities;

[0015] Multiple business activities with a correlation strength greater than a preset threshold are grouped into one business scenario.

[0016] Optionally, determining the timing sequence of the business scenario includes:

[0017] Based on the business rules of each business activity in the aforementioned business scenario, determine the attribute information of each business activity in the aforementioned business scenario; wherein, the attribute information includes at least one of: activity name, activity content, activity scope, and triggering conditions;

[0018] The time data items of each business activity in the business scenario and the attribute information of each business activity in the business scenario are combined to form the time sequence link of the business scenario.

[0019] Optionally, generating a time-series table for the business scenario based on the time-series links of the business scenario and the empty table includes:

[0020] According to the flow order of each business activity in the time-series link of the business scenario, set a corresponding sequence number for each business activity;

[0021] The business activities are written vertically into the empty table in ascending order of their serial numbers, and the time data items and / or non-critical information of each business activity are written horizontally into the empty table to generate a time-series link table for the business scenario.

[0022] Optionally, after generating the time-series link table for the business scenario, the following may also be included:

[0023] Set the key time point adjacency coefficients for each business activity in the business scenario, and write the key time point adjacency coefficients into the time sequence link table of the business scenario.

[0024] Optionally, the data table for determining each business activity includes:

[0025] Analyze the scripts corresponding to the business rules of each business activity in the business scenario to obtain the statements corresponding to the business rules of each business activity in the business scenario.

[0026] Based on the statement, extract the data tables for each of the business activities from the preset database.

[0027] Optionally, the step of performing a data writing operation on the data templates of each business activity based on the time-series link table of the business scenario and the data table of each business activity to generate test data corresponding to each business activity in the business scenario includes:

[0028] Identify the key fields of the dataset templates for each business activity in the business scenario, and write the time data items of each business activity in the time-series link table of the business scenario into the key fields of their respective dataset templates;

[0029] Identify the non-key fields of the dataset templates for each of the business activities in the business scenario, and write the existing data from the data tables of each business activity in the business scenario into the non-key fields of their respective dataset templates to obtain the test data corresponding to each business activity in the business scenario.

[0030] Optionally, the method further includes:

[0031] The test data corresponding to all the business activities in the business scenario are determined as the test data corresponding to the business scenario.

[0032] When there is one business line and multiple business scenarios, determine the flow order of each business scenario;

[0033] According to the flow order of each business scenario, the test data corresponding to all the business scenarios are adjusted in order to obtain the test data corresponding to the business line.

[0034] Optionally, the method further includes:

[0035] The time sequence link table is sent to a third-party organization so that the third-party organization can review the time relationship between the test data corresponding to each business activity in the business scenario and / or the time relationship between the test data corresponding to each business scenario under the business line based on the time sequence link table.

[0036] The review results received from the third-party organization confirm the correctness and completeness of the time relationships between test data corresponding to various business activities within the business scenario and / or the time relationships between test data corresponding to various business scenarios under the business line.

[0037] According to a second aspect of this application, a test data generation apparatus is provided, comprising:

[0038] The acquisition and parsing module is used to acquire the generation request of test data to be generated for testing the target financial business system, and to parse the business line to which the test data to be generated belongs, as well as several business activities under the business line, from the generation request.

[0039] The classification and analysis module is used to classify and analyze all the business activities to establish business scenarios;

[0040] The analysis and determination module is used to analyze the time data items of various business activities under the business scenario and determine the time sequence of the business scenario; wherein, the time data items include at least one of: key time points, duration, and flow order, and the time sequence includes the flow order of each business activity;

[0041] The acquisition and generation module is used to acquire an empty table and generate a time sequence table for the business scenario based on the time sequence of the business scenario and the empty table.

[0042] The acquisition module is used to determine the business rules of each business activity under the business scenario and acquire the scripts corresponding to the business rules of each business activity under the business scenario, so as to determine the data table of each business activity.

[0043] The generation and writing module is used to generate data templates for each business activity, and to perform data writing operations on the data templates of each business activity according to the time-series link table of the business scenario and the data table of each business activity, so as to generate test data corresponding to each business activity in the business scenario, and to use the test data corresponding to each business activity in the business scenario to test the target financial business system and obtain test results.

[0044] According to a third aspect of this application, an electronic device is provided, comprising: at least one processor and a memory;

[0045] The memory stores computer-executed instructions;

[0046] The at least one processor executes computer execution instructions stored in the memory, causing the at least one processor to perform the test data generation method as described in the first aspect above.

[0047] According to a fourth aspect of this application, a computer-readable storage medium is provided, wherein computer-executable instructions are stored therein, which, when executed by a processor, are used to implement the test data generation method described in the first aspect above.

[0048] According to a fifth aspect of this application, a computer program product is provided, including a computer program that, when executed by a processor, implements the test data generation method described in the first aspect.

[0049] This application provides a method for generating test data. The method involves obtaining a request to generate test data for a target financial business system, parsing the business line to which the test data belongs, and several business activities within that business line, from the request; classifying and analyzing all business activities to establish a business scenario; analyzing the time data items of each business activity within the business scenario and determining the time sequence of the business scenario; wherein the time data items include at least one of key time points, duration, and flow order, and the time sequence includes the flow order of each business activity; obtaining an empty table and generating a time sequence table for the business scenario based on the time sequence and the empty table; determining the business rules for each business activity within the business scenario and obtaining the scripts corresponding to the business rules for each business activity to determine the data table for each business activity; generating data templates for each business activity and performing data writing operations on the data templates for each business activity based on the time sequence table and the data tables for each business activity to generate test data corresponding to each business activity within the business scenario; and using the test data corresponding to each business activity within the business scenario to test the target financial business system and obtain test results.

[0050] This application categorizes and analyzes all business activities, enabling the establishment of business scenarios. Within these scenarios, the following operations are performed: The timeline is determined by analyzing the time data items of each business activity; the data tables for each activity are determined based on their business rules, thus narrowing the scope of test data generation; and data is quickly written to the data templates of each activity based on the timeline table of the business scenario, comprehensively covering the entire business lifecycle. This avoids missing test data generation for certain business activities. Therefore, this application improves both the efficiency and coverage of test data generation, thereby enhancing the accuracy of test results.

[0051] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this application, nor is it intended to limit the scope of this application. Other features of this application will become readily apparent from the following description. Attached Figure Description

[0052] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0053] Figure 1 A flowchart illustrating a method for generating test data provided in an embodiment of this application;

[0054] Figure 2 for Figure 1 A flowchart illustrating step S102;

[0055] Figure 3 for Figure 1 A flowchart illustrating step S103;

[0056] Figure 4 A flowchart illustrating another method for generating test data provided in an embodiment of this application;

[0057] Figure 5 This is a schematic diagram of a test data generation device provided in an embodiment of this application.

[0058] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation

[0059] Exemplary embodiments are described in detail herein, with examples illustrated in the accompanying drawings. When the following description refers to the drawings, identical numerals in different drawings represent identical or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all embodiments consistent with this application.

[0060] In related technologies, constructing test data based on business time sequence and table structure is the most tedious step in the construction process, mainly for several reasons:

[0061] (1) Each business line involves multiple business scenarios and multiple business activities.

[0062] (2) Different business activities involve multiple time rules and multiple data tables.

[0063] (3) There are multiple key time points in a business activity, and this field has a significant impact on business rules.

[0064] (4) Each data table has many different fields.

[0065] (5) Each field has different attributes.

[0066] (6) There are different relationships between the fields.

[0067] In business system testing, due to varying business requirements, the timing rules for business activities across multiple business lines differ. Testing business systems with different timing rules typically requires a significant amount of time to construct test data for each of these rules.

[0068] However, in the current construction process, testers often adopt manual construction methods. Due to the lack of standardized test data construction methods, and the different levels of understanding of business requirements among different testers, test data design errors and omissions of test scenarios are common occurrences.

[0069] To address at least one of the aforementioned technical problems, this application provides a test data generation method and apparatus, applied in the computer field, to reduce problems such as high personnel costs, high data error rates, and incomplete test scenario coverage caused by manual data generation. This effectively reduces the need for redesigning test data later, avoids the omission of test data generation for certain business activities, ensures the smooth writing and execution of test cases, and thus guarantees the quality of the corresponding projects in the business system.

[0070] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will be described below with reference to the accompanying drawings.

[0071] Figure 1 This is a flowchart illustrating a method for generating test data according to an embodiment of this application. Figure 1 As shown, the method of this embodiment includes the following steps S101 to S106:

[0072] S101: Obtain the generation request for the test data to be generated for testing the target financial business system, and parse out the business line to which the test data to be generated belongs, as well as several business activities under the business line, from the generation request.

[0073] It should be understood that the test data, after being generated, is used to test the target financial business system. This application embodiment does not specifically limit the content of the business line; for example, a business line can refer to loans, or it can refer to individual loan collection, agricultural loans, or micro-loans under loans. Several business activities under the parsed business line are determined by the business requirements carried in the generation request.

[0074] S102: Categorize and analyze all business activities to establish business scenarios.

[0075] For example, under the personal loan collection business line, there are multiple business activities. Among them, three business activities—initiating SMS on T+1 day, initiating automated voice on T+5 day, and initiating human voice on T+15 day—can be identified as online collection business scenarios. The purpose of step S102 is to establish business scenarios based on business needs. The specific process is described in S201 to S202 below, and will not be repeated here.

[0076] S103: Analyze the time data items of various business activities in the business scenario and determine the time sequence of the business scenario.

[0077] It should be understood that by analyzing the temporal characteristics of various business activities in a business scenario, the temporal data items of each business activity in that scenario can be identified. These temporal data items include key moments, duration, and flow sequence information of the business activities. The aforementioned time sequence includes the flow sequence of each business activity. The aforementioned key moments are the time nodes that can trigger significant changes in a business activity. The aforementioned flow sequence refers to the flow sequence between this business activity and other business activities. The aforementioned time sequence is used to describe the key moments, duration, and flow sequence of each business activity. The purpose of step S103 is to analyze the business scenario to determine the time sequence; the specific description process is given in S301-S302 below and will not be repeated here.

[0078] S104: Obtain an empty table and generate a time sequence table for the business scenario based on the time sequence of the business scenario and the empty table.

[0079] In this embodiment of the application, the purpose of step S104 is to generate a timing link table based on the timing links.

[0080] S105: Determine the business rules for each business activity in the business scenario, and obtain the scripts corresponding to the business rules for each business activity in the business scenario, so as to determine the data table for each business activity.

[0081] In this embodiment, the business rules include, but are not limited to: the type of collection task, the specific time of the on-site visit, the means of collection, and filtering conditions. The means of collection include: human telephone calls, robot voice, and on-site visits in the local area. Filtering conditions can be understood as filtering out business activities within a certain amount or outside a certain time period. This embodiment can generate different collection tasks based on these business rules under different time conditions. The purpose of step S105 is to analyze business activities to determine the data table; the specific process is described in S1051-S1052 below, and will not be repeated here.

[0082] The above script can be understood as a batch script. In S105, the business rules of each business activity in the business scenario are determined, and the operation of obtaining the script corresponding to the business rules of each business activity in the business scenario can be executed in step S102. This application embodiment does not specifically limit the execution order of each step.

[0083] S106: Generate data templates for each business activity, and perform data writing operations on the data templates of each business activity according to the time-series link table of the business scenario and the data table of each business activity to generate test data corresponding to each business activity in the business scenario. Then, use the test data corresponding to each business activity in the business scenario to test the target financial business system and obtain the test results.

[0084] In this embodiment, the test data corresponding to each business activity in the business scenario is also referred to as the test dataset. Step S106 generates a data template for each business activity based on the associated data items between the data tables of each business activity. The generation process is described in S1061 to S1062 below, and will not be repeated here. This embodiment does not specifically limit the testing method or the specific testing process.

[0085] Overall, this application embodiment categorizes and analyzes all business activities, enabling the establishment of business scenarios. Within these scenarios, the following operations are performed: Timelines are determined by analyzing the time data items of each business activity within the scenario; data tables for each business activity are determined based on their business rules, thus reducing the scope of test data generation; and data is quickly written to the data templates of each business activity according to the timeline table of the business scenario, comprehensively covering the entire business lifecycle. This avoids missing the generation of test data for some business activities. Therefore, this application embodiment improves both the efficiency and coverage of test data generation.

[0086] Based on the above embodiments, the technical solution of this application will be described in more detail below with reference to several specific embodiments.

[0087] Figure 2 for Figure 1 A flowchart illustrating step S102. Figure 1 Based on the illustrated embodiment, this embodiment focuses on Figure 1 Step S102 in the text is further refined. For example... Figure 2 As shown, step S102 involves classifying and analyzing all business activities to establish business scenarios, including the following steps S201 to S202:

[0088] S201: Perform correlation analysis on all business activities and obtain the analysis results; among which, the analysis results are the correlation strength between different business activities.

[0089] S202: Group multiple business activities with a correlation strength greater than a preset threshold into one business scenario.

[0090] By executing S201-S202, this embodiment of the application sets up various business activities for different business lines in the business requirements. To facilitate subsequent processing, strongly related business activities under the same business line can be aggregated into a single business scenario. Based on this, the business rules of each business activity are classified and summarized according to their characteristics, and batch scripts involved in the business rules of each business activity under this business scenario are obtained. Test data corresponding to each business activity is generated under the business scenario, thus the established business scenario provides a foundation for ensuring data integrity.

[0091] Figure 3 for Figure 1 A flowchart illustrating step S103. Figure 1 Based on the illustrated embodiment, this embodiment focuses on Figure 1 Step S103 in the text is further refined. For example... Figure 3 As shown, in step S103, the timing sequence of the business scenario is determined, including the following steps S301 to S302:

[0092] S301: Based on the business rules of each business activity in the business scenario, determine the attribute information of each business activity in the business scenario. The attribute information includes at least one of the following: activity name, activity content, activity scope, and triggering conditions.

[0093] S302: Combine the time data items of various business activities in the business scenario with the attribute information of each business activity in the business scenario to form the time sequence link of the business scenario.

[0094] It should be understood that the embodiments of this application, by analyzing the temporal characteristics of business activities in a business scenario, can identify the time data items of various business activities within that scenario. Based on this, the activity names, content, scope, and triggering conditions of each activity are identified according to business rules, and these are combined with the time data items of various business activities within the business scenario to effectively determine the temporal sequence of the business scenario.

[0095] In one possible implementation, in S104, a time sequence table for the business scenario is generated based on the time sequence of the business scenario and an empty table, including the following steps S1041 to S1042:

[0096] S1041: Assign a corresponding sequence number to each business activity according to the flow order of each business activity in the time-series of the business scenario.

[0097] S1042: Write each business activity vertically into an empty table in ascending order of serial number, and write the time data items and / or non-critical information of each business activity horizontally into an empty table to generate a time-series table of the business scenario.

[0098] In this embodiment, the flow order of each business activity can characterize the temporal relationship between the activities. This embodiment constructs a time-series link table based on the flow order of each business activity in the time-series link. Specifically, this may include the following steps: first, assigning sequence numbers to each business activity in the business scenario according to their flow order; then, arranging the business activities vertically in ascending order in the time-series link table, with the horizontal axis containing information such as key time points, duration, scope, and triggering conditions for each activity. This time-series link table provides the foundation for subsequently writing the time data items of each business activity in the time-series link table of the business scenario into the key fields of their respective dataset templates.

[0099] In one possible implementation, after generating the time-series link table of the business scenario, the test data generation method further includes: setting the adjacency coefficients of key time points for each business activity in the business scenario, and writing the adjacency coefficients of key time points into the time-series link table of the business scenario.

[0100] In S1042, business activities are arranged vertically in the time-series link table from smallest to largest, with horizontally arranged information such as key time points, duration, scope, and triggering conditions for each activity. Based on this, this embodiment can also write a key time point adjacency coefficient T into the time-series link table. This coefficient is used to derive test data within ±T days of the key time point. This derived test data is also called reverse test data. Normally generated test data can be called forward test data. The generation of reverse test data can improve the sufficiency of testing.

[0101] In one possible implementation, in S105, the data tables for each business activity are determined, including the following steps S1051 to S1052:

[0102] S1051: Analyze the scripts corresponding to the business rules of each business activity in the business scenario to obtain the statements corresponding to the business rules of each business activity in the business scenario.

[0103] S1052: Based on the statement, extract the data tables for each business activity from the preset database.

[0104] In this embodiment, the scripts corresponding to the business rules of each business activity in the business scenario can be simply referred to as the batch scripts corresponding to the business scenario. The data tables of each business activity can be collectively referred to as the data tables involved in the test scenario. In order to determine the data tables, this embodiment further decomposes and analyzes the batch scripts corresponding to the business scenario, extracts the statements related to the business rules in the batch scripts, and filters and removes duplicates from the data tables involved therein to determine the data tables involved in the test scenario, thus narrowing the scope of data generation.

[0105] In one possible implementation, in S106, generating data templates for each business activity includes: S1061: finding existing data in the data tables of each business activity under the business scenario, and determining the associated data items between the data tables of each business activity under the business scenario based on the existing data; S1062: obtaining data generation parameters for each business activity under the business scenario, and generating dataset templates for each business activity under the business scenario based on the data generation parameters and associated data items.

[0106] Specifically, to obtain the relationships between tables, this embodiment first searches for existing data in the database and analyzes the association information of the existing data. This association information represents the interrelated data items in the test data corresponding to different business activities. Based on this association information, the associated data items between each set of test data and other sets of test data are determined. The aforementioned data generation parameters include at least the number of data rows generated, the delimiter between fields, and the directory location information for data generation. After constructing the associated data items, this embodiment generates multiple dataset templates corresponding to business activities based on the data generation parameters and the associated data items, thus facilitating improved test data generation efficiency.

[0107] In one possible implementation, S106: Based on the time-series link table of the business scenario and the data tables of each business activity, perform data writing operations on the data templates of each business activity to generate test data corresponding to each business activity in the business scenario, including the following steps S1061~S1062:

[0108] S1061: Identify the key fields of the dataset templates for each business activity in the business scenario, and write the time data items of each business activity in the time-series link table of the business scenario into the key fields of their respective dataset templates.

[0109] S1062: Identify the non-key fields of the dataset templates for each business activity in the business scenario, and write the existing data in the data tables of each business activity in the business scenario into the non-key fields of their respective dataset templates to obtain the test data corresponding to each business activity in the business scenario.

[0110] After executing S1061 to S1062, the time data items of each business activity are used as the key field values ​​of their respective dataset templates, and the existing data in the data tables of each business activity are used as the non-key field values ​​of their respective dataset templates, thus forming the test data corresponding to each business activity in the business scenario.

[0111] Specifically, for a given business scenario, the time data items of each business activity in the time-series link table are written into the key fields of their respective dataset templates, and existing data from the database is injected into the non-key fields of the dataset templates to complete the construction of test data for that business activity. Since the time-series link table contains a key time point adjacency coefficient T, representing the number of days adjacent to a key date, reverse test data for the number of days adjacent to a key date can be derived based on this key time point adjacency coefficient T, building upon the generated forward test data. At this point, all test data for each business activity in this scenario has been generated, improving the accuracy of the test results.

[0112] In this embodiment, non-critical fields are extracted from the database, which reduces the number of fields required to construct test data, reduces workload while ensuring data integrity, and improves the efficiency of test data generation.

[0113] In one possible implementation, the method for generating the test data further includes the following steps S107 to S109:

[0114] S107: Determine the test data corresponding to all business activities in the business scenario as the test data corresponding to the business scenario.

[0115] S108: When there is one business line and multiple business scenarios, determine the flow order of each business scenario.

[0116] S109: Adjust the order of test data for all business scenarios according to their flow sequence to obtain the test data for each business line.

[0117] Since this business line encompasses multiple business scenarios, the test data corresponding to this business line can also be referred to as the test data corresponding to all business scenarios. By connecting the various business scenarios within the business line according to their flow order, a flow sequence of each business scenario can be formed, which can be called the time sequence link of the business line.

[0118] When multiple business scenarios exist under the same business line, the process is repeated to generate test data corresponding to each business scenario. The test data corresponding to all business scenarios is adjusted according to the time sequence of the business line, thereby generating test data corresponding to the time sequence of the business line. The generation method is highly intelligent and improves the generation efficiency of test data corresponding to the business line.

[0119] In one possible implementation, the method for generating the test data further includes the following step S110:

[0120] S110: Send the time sequence list to a third-party organization so that the third-party organization can review the time relationship between test data corresponding to each business activity within the business scenario and / or the time relationship between test data corresponding to each business scenario under the business line based on the time sequence list.

[0121] S111: Review the accuracy and completeness of the time relationships between test data corresponding to various business activities within a business scenario and / or between test data corresponding to various business scenarios under a business line, sent by a third-party organization.

[0122] This application embodiment can set up a third-party review method so that one business activity, one business scenario, or one business line corresponds to one review result. Furthermore, this application embodiment does not specifically limit the specific process of data interaction with third-party organizations involved in the generation of test data.

[0123] In this embodiment of the application, the third-party organization uses the time sequence link table to assess the correctness and / or completeness of the time relationship between test data corresponding to each business activity within the scenario, the time relationship between test data corresponding to each business scenario within the business line, whether there are erroneous time relationships, and whether there are missing time relationships.

[0124] In one possible implementation, after step S111, the method for generating the test data further includes the following step S112: repeating the above steps S101 to S111 until test data corresponding to all business lines is generated.

[0125] After generating test data for all business lines, this embodiment of the application can manage and back up the data to a cloud server to improve data security and reliability. This embodiment of the application requires no human intervention in the process of generating test data for all business lines, demonstrating a high degree of automation and improving the efficiency of test data generation.

[0126] In one possible implementation, the embodiments of this application can pre-obtain candidate datasets to reduce the analysis of related data items between data tables, and construct test data by only modifying the key fields of the dataset template, while other non-key fields are not modified, which can further reduce the workload of generating test data for fields.

[0127] In summary, this application's embodiments determine the timeline and data tables based on business requirements, enabling deduplication and narrowing the scope of test data generation. By analyzing business rules to identify related data items and construct dataset templates, the timeline allows for rapid synchronization of test data's temporal information, comprehensively covering the entire business lifecycle and preventing omissions in test scenarios. Simultaneously, the automatic generation of forward and reverse test data based on key time points improves test sufficiency. Extracting non-critical fields from the database reduces the number of fields required to construct test data, alleviating workload while ensuring data integrity, improving test data generation efficiency, reducing labor costs, and maximizing test sufficiency to effectively guarantee test quality.

[0128] Figure 4 This is a flowchart illustrating another method for generating test data provided in an embodiment of this application.

[0129] like Figure 4 As shown, the method includes the following steps S401 to S409, wherein:

[0130] S401: Establish a business scenario; S402: Determine the time sequence of the business scenario; S403: Generate a time sequence table for the business scenario; S404: Determine the data tables for each business activity; S405: Generate data templates for each business activity; S406: Generate test data corresponding to each business activity under the business scenario; S407: Determine the flow order of each business scenario and generate test data corresponding to a business line; S408: Interact with third-party organizations to determine the review results; S409: Generate test data corresponding to all business lines.

[0131] The implementation principle and technical effect of this technical solution are similar to those of the technical solutions in the above embodiments, and will not be repeated here.

[0132] Figure 5 This is a schematic diagram of a test data generation device provided in an embodiment of this application. The device in this embodiment can be in the form of software and / or hardware. For example... Figure 5 As shown, the test data generation device provided in this embodiment includes: an acquisition and parsing module 51, a classification and analysis module 52, an analysis and determination module 53, an acquisition and generation module 54, a determination and acquisition module 55, and a generation and writing module 56. Wherein:

[0133] The parsing module 51 is used to obtain the generation request of the test data to be generated for the target financial business system, and to parse the business line to which the test data to be generated belongs, as well as several business activities under the business line, from the generation request.

[0134] The classification analysis module 52 is used to classify and analyze all business activities in order to establish business scenarios.

[0135] The analysis and determination module 53 is used to analyze the time data items of various business activities in the business scenario and determine the time sequence of the business scenario; wherein, the time data items include at least one of the following: key time points, duration, and flow order, and the time sequence includes the flow order of each business activity.

[0136] The generation module 54 is used to obtain an empty table and generate a time sequence table for the business scenario based on the time sequence of the business scenario and the empty table.

[0137] The acquisition module 55 is used to determine the business rules of each business activity in the business scenario and to acquire the scripts corresponding to the business rules of each business activity in the business scenario, so as to determine the data table of each business activity.

[0138] The generation and writing module 56 is used to generate data templates for each business activity, and to perform data writing operations on the data templates of each business activity according to the time-series link table of the business scenario and the data table of each business activity, so as to generate test data corresponding to each business activity in the business scenario, and to use the test data corresponding to each business activity in the business scenario to test the target financial business system and obtain test results.

[0139] In one possible implementation, the classification analysis module 52 is also used for:

[0140] A correlation analysis was conducted on all business activities to obtain the analysis results; among which, the analysis results represent the strength of the correlation between different business activities.

[0141] Multiple business activities with a correlation strength greater than a preset threshold are grouped into one business scenario.

[0142] In one possible implementation, the analysis and determination module 53 is further used for:

[0143] Based on the business rules of each business activity in the business scenario, determine the attribute information of each business activity in the business scenario; wherein, the attribute information includes at least one of the following: activity name, activity content, activity scope, and triggering conditions.

[0144] The time data items of various business activities in the business scenario are combined with the attribute information of each business activity in the business scenario to form the time sequence link of the business scenario.

[0145] In one possible implementation, the generation module 54 is also used for:

[0146] According to the flow order of each business activity in the time-series of the business scenario, assign a corresponding sequence number to each business activity.

[0147] Write each business activity vertically into an empty table in ascending order of serial number, and write the time data items and / or non-critical information of each business activity horizontally into an empty table to generate a time-series table of the business scenario.

[0148] In one possible implementation, the method for generating the test data is also used for:

[0149] Set the adjacency coefficients of key time points for various business activities in the business scenario, and write the adjacency coefficients of key time points into the time sequence table of the business scenario.

[0150] In one possible implementation, the determination module 55 is also used for:

[0151] The scripts corresponding to the business rules of each business activity in the business scenario are analyzed to obtain the statements corresponding to the business rules of each business activity in the business scenario.

[0152] Based on the statement, extract the data tables for each business activity from the preset database.

[0153] In one possible implementation, the generation and writing module 56 is also used for:

[0154] Identify the key fields of the dataset templates for each business activity in the business scenario, and write the time data items of each business activity in the time-series link table of the business scenario into the key fields of their respective dataset templates.

[0155] Identify the non-key fields of the dataset templates for each business activity in the business scenario, and write the existing data from the data tables of each business activity in the business scenario into the non-key fields of their respective dataset templates to obtain the test data corresponding to each business activity in the business scenario.

[0156] In one possible implementation, the method for generating the test data is also used for:

[0157] The test data corresponding to all business activities in the business scenario is defined as the test data corresponding to the business scenario.

[0158] When there is one business line and multiple business scenarios, determine the flow order of each business scenario.

[0159] According to the flow order of each business scenario, the test data corresponding to all business scenarios are rearranged in order to obtain the test data corresponding to each business line.

[0160] In one possible implementation, the method for generating the test data is also used for:

[0161] The time sequence list will be sent to a third-party organization so that the organization can review the time relationship between test data corresponding to each business activity within the business scenario and / or the time relationship between test data corresponding to each business scenario under the business line.

[0162] The review results verify the accuracy and completeness of the time relationships between test data corresponding to various business activities within a business scenario and / or between test data corresponding to various business scenarios under a business line, sent by a third-party organization.

[0163] The test data generation device provided in this embodiment can be used to execute the test data generation method provided in any of the above method embodiments. Its implementation principle and technical effect are similar, and will not be described in detail here.

[0164] The collection, storage, use, processing, transmission, provision, and disclosure of user personal information involved in the technical solution of this application all comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0165] According to embodiments of this application, this application also provides an electronic device and a readable storage medium. The electronic device includes a receiver, a transmitter, a processor, and a memory. The electronic device, composed of the aforementioned components, can be used to implement the specific embodiments described above, which will not be repeated here.

[0166] This application also provides a computer-readable storage medium storing computer instructions, which, when executed by a processor, implement the steps of the methods described above.

[0167] This application also provides a computer program product, including computer instructions that, when executed by a processor, implement the various steps in the methods described above.

[0168] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this application can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this application can be achieved, and this is not limited herein.

[0169] The specific embodiments described above do not constitute a limitation on the scope of protection of this application. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this application should be included within the scope of protection of this application.

Claims

1. A method for generating test data, characterized in that, include: Obtain the generation request for test data to be generated for testing the target financial business system, and parse the business line to which the test data to be generated belongs, as well as several business activities under the business line, from the generation request; All the aforementioned business activities are categorized and analyzed to establish business scenarios; Analyze the time data items of various business activities in the business scenario and determine the time sequence of the business scenario; wherein, the time data items include at least one of: key time points, duration, and flow order, and the time sequence includes the flow order of each business activity; Obtain an empty table, and generate a time sequence table for the business scenario based on the time sequence of the business scenario and the empty table; Determine the business rules for each business activity under the business scenario, and obtain the scripts corresponding to the business rules for each business activity under the business scenario, so as to determine the data table for each business activity; Data templates for each business activity are generated, and data writing operations are performed on the data templates of each business activity according to the time-series link table of the business scenario and the data table of each business activity to generate test data corresponding to each business activity in the business scenario. The target financial business system is then tested using the test data corresponding to each business activity in the business scenario to obtain test results.

2. The method according to claim 1, characterized in that, The process of categorizing and analyzing all the aforementioned business activities to establish business scenarios includes: A correlation analysis is performed on all the aforementioned business activities to obtain the analysis results; wherein, the analysis results represent the correlation strength between different business activities; Multiple business activities with a correlation strength greater than a preset threshold are grouped into one business scenario.

3. The method according to claim 1, characterized in that, The determination of the timing sequence of the business scenario includes: Based on the business rules of each business activity in the aforementioned business scenario, determine the attribute information of each business activity in the aforementioned business scenario; wherein, the attribute information includes at least one of: activity name, activity content, activity scope, and triggering conditions; The time data items of each business activity in the business scenario and the attribute information of each business activity in the business scenario are combined to form the time sequence link of the business scenario.

4. The method according to claim 1, characterized in that, The step of generating a time-series table for the business scenario based on the time-series links of the business scenario and the empty table includes: According to the flow order of each business activity in the time-series link of the business scenario, set a corresponding sequence number for each business activity; The business activities are written vertically into the empty table in ascending order of their serial numbers, and the time data items and / or non-critical information of each business activity are written horizontally into the empty table to generate a time-series table for the business scenario.

5. The method according to claim 4, characterized in that, After generating the time-series link table for the business scenario, the following is also included: Set the key time point adjacency coefficients for each business activity in the business scenario, and write the key time point adjacency coefficients into the time sequence link table of the business scenario.

6. The method according to claim 1, characterized in that, The data tables for determining each business activity include: Analyze the scripts corresponding to the business rules of each business activity in the business scenario to obtain the statements corresponding to the business rules of each business activity in the business scenario. Based on the statement, extract the data tables for each of the business activities from the preset database.

7. The method according to claim 4, characterized in that, The step of performing a data writing operation on the data templates of each business activity based on the time-series link table of the business scenario and the data table of each business activity to generate test data corresponding to each business activity in the business scenario includes: Identify the key fields of the dataset templates for each business activity in the business scenario, and write the time data items of each business activity in the time-series link table of the business scenario into the key fields of their respective dataset templates; Identify the non-key fields of the dataset templates for each of the business activities in the business scenario, and write the existing data from the data tables of each business activity in the business scenario into the non-key fields of their respective dataset templates to obtain the test data corresponding to each business activity in the business scenario.

8. The method according to claim 1, characterized in that, Also includes: The test data corresponding to all the business activities in the business scenario are determined as the test data corresponding to the business scenario. When there is one business line and multiple business scenarios, determine the flow order of each business scenario; According to the flow order of each business scenario, the test data corresponding to all the business scenarios are adjusted in order to obtain the test data corresponding to the business line.

9. The method according to claim 8, characterized in that, Also includes: The time sequence link table is sent to a third-party organization so that the third-party organization can review the time relationship between the test data corresponding to each business activity in the business scenario and / or the time relationship between the test data corresponding to each business scenario under the business line based on the time sequence link table. The review results received from the third-party organization confirm the correctness and completeness of the time relationships between test data corresponding to various business activities within the business scenario and / or the time relationships between test data corresponding to various business scenarios under the business line.

10. A test data generation device, characterized in that, include: The acquisition and parsing module is used to acquire the generation request of the test data to be generated for testing the target financial business system, and to parse the business line to which the test data to be generated belongs, as well as several business activities under the business line, from the generation request. The classification and analysis module is used to classify and analyze all the business activities to establish business scenarios; The analysis and determination module is used to analyze the time data items of various business activities under the business scenario and determine the time sequence of the business scenario; wherein, the time data items include at least one of: key time points, duration, and flow order, and the time sequence includes the flow order of each business activity; The acquisition and generation module is used to acquire an empty table and generate a time sequence table for the business scenario based on the time sequence of the business scenario and the empty table. The acquisition module is used to determine the business rules of each business activity under the business scenario and acquire the scripts corresponding to the business rules of each business activity under the business scenario, so as to determine the data table of each business activity. The generation and writing module is used to generate data templates for each business activity, and to perform data writing operations on the data templates of each business activity according to the time-series link table of the business scenario and the data table of each business activity, so as to generate test data corresponding to each business activity in the business scenario, and to use the test data corresponding to each business activity in the business scenario to test the target financial business system and obtain test results.

Citation Information

Patent Citations

  • Test case generation method and device based on user operation time sequence diagram

    CN111639023A

  • Method and device for generating test data, computer equipment and storage medium

    CN114185770A