Method, device, equipment and medium for obtaining test data

By obtaining the transaction links and system node sequences, generating test scripts and automatically running them using RPA technology, the problem of difficult test data screening in complex business scenarios is solved, and efficient test data acquisition is achieved.

CN115048285BActive Publication Date: 2025-09-09AGRICULTURAL BANK OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210391129.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-14
Publication Date
2025-09-09
Estimated Expiration
2042-04-14

AI Technical Summary

Technical Problem

In complex business scenarios, the screening conditions for test data are complex and involve multiple data tables, which makes it impossible to filter out qualified test data in the database, resulting in low testing efficiency.

Method used

By obtaining the transaction links under the target business scenario, determining the order of system nodes and the execution order of database scripts, modifying the target fields to test fields, generating test scripts, and using robotic process automation technology to automatically run the test scripts to obtain test data.

Benefits of technology

It simplifies manual operations, quickly obtains correct test data, improves test efficiency, and adapts to dynamic adjustments to changes in business scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115048285B_ABST
    Figure CN115048285B_ABST
Patent Text Reader

Abstract

The present application discloses a method, apparatus, equipment and medium for obtaining test data. First, a transaction link under a target business scenario is obtained, and based on the order of each transaction process in the transaction link, the order of each system node executing each transaction process is determined; for any system node, the execution order of one or more database scripts involved in the execution of the corresponding transaction process by the system node is determined. For any database script, the target field of the database script is modified to a test field, thereby obtaining a test script. Then, based on the determined order of each system node and the execution order of the test script corresponding to each system node, all test scripts are run to obtain test data. The embodiment of the present application can simulate the operation process of a business scenario, run the test script in the order of the transaction process, thereby generating data for testing, simplifying manual operations, quickly obtaining correct test data, and improving testing efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a method, apparatus, device, and medium for obtaining test data. Background Art

[0002] With the deepening digital transformation of banking systems and the impact of internet finance on traditional banking, bank information systems are undergoing more frequent changes and involving more diverse business scenarios. To ensure information accuracy, continuous system testing is necessary. As the front-end system directly facing customers, the channel side requires extensive testing based on different business scenarios.

[0003] Testers typically preliminarily screen test data in the backend database based on test conditions, and then execute the test data on the channel side. For simple business scenarios, the business generally involves fewer systems, that is, fewer joint tables in the corresponding database, and screening in the database can obtain qualified test data. However, for complex business scenarios involving more systems, the conditions for screening test data are more complex, and complex business scenarios involve more data tables, which may make it impossible to filter out qualified test data in the database. Therefore, staff need to continuously check and modify database scripts until they can filter out the correct test data, resulting in relatively low testing efficiency. Summary of the Invention

[0004] In view of this, embodiments of the present application provide a method, apparatus, device, and medium for obtaining test data, so as to obtain correct test data and improve test efficiency.

[0005] In a first aspect, an embodiment of the present application provides a method for obtaining test data, the method comprising:

[0006] Obtaining a transaction link under a target business scenario, where the transaction link represents a transaction process involved in completing the business of the target business scenario;

[0007] Determining the order of the system nodes for executing the transaction processes based on the order of the transaction processes in the transaction link;

[0008] For any system node, determine the execution order of one or more database scripts corresponding to the system node, the one or more database scripts being used by the system node to execute a corresponding transaction process, and the one or more database scripts being used to process a data table;

[0009] For any database script, modify the target field in the database script to a test field to obtain a test script. The execution order of the test script corresponds one-to-one to the execution order of the database script. The target field is used to change the data table corresponding to the database script after running the database script.

[0010] Based on the order of the system nodes and the execution order of the test scripts corresponding to each of the system nodes, all the test scripts are run to obtain test data.

[0011] In a possible implementation, the method further includes:

[0012] When the transaction link under the target business scenario changes, the order of executing each system node of the changed transaction process is determined according to the transaction process involved in the changed transaction link, and subsequent processes are performed to re-acquire test data.

[0013] In a possible implementation, the step of running all test scripts based on the order of the system nodes and the execution order of the test scripts corresponding to each of the system nodes to obtain test data includes:

[0014] By using Robotic Process Automation (RPA) technology, all test scripts are automatically run based on the order of the system nodes and the execution order of the test scripts corresponding to each system node to obtain test data.

[0015] In a possible implementation, the method further includes:

[0016] A test condition is generated based on the target business scenario, and the test data is obtained by screening from a database based on the test condition.

[0017] In one possible implementation, the system nodes and the test script corresponding to each system node are stored in a table format, wherein the system nodes are stored in the same column in the order of executing each transaction process in the transaction link, and for any system node, the test script corresponding to the system node is stored in the same row as the system node in the order of execution.

[0018] In a second aspect, an embodiment of the present application provides a device for acquiring test data, the device comprising: a first acquisition module, a first determination module, a second determination module, a second acquisition module, and a third acquisition module;

[0019] The first acquisition module is configured to acquire a transaction link in a target business scenario, where the transaction link represents a transaction process involved in completing a business in the target business scenario;

[0020] The first determining module is configured to determine the order of executing each transaction process on each system node based on the order of each transaction process in the transaction link;

[0021] The second determination module is configured to determine, for any system node, an execution order of one or more database scripts corresponding to the system node, the one or more database scripts being used by the system node to execute a corresponding transaction process, and the one or more database scripts being used to process a data table;

[0022] The second acquisition module is configured to modify a target field in any database script into a test field to obtain a test script, wherein the execution order of the test script corresponds to the execution order of the database script. The target field is used to change the data table corresponding to the database script after the database script is executed;

[0023] The third acquisition module is used to run all test scripts and acquire test data based on the order of the system nodes and the execution order of the test scripts corresponding to each system node.

[0024] In a third aspect, an embodiment of the present application provides a device for acquiring test data, the device comprising: a memory and a processor;

[0025] The memory is used to store relevant program codes;

[0026] The processor is used to call the program code to execute the method for obtaining test data described in any one of the implementations of the first aspect above.

[0027] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store a computer program, and the computer program is used to execute the method for obtaining test data described in any one of the implementations of the first aspect above.

[0028] In a fifth aspect, an embodiment of the present application provides a computer program product, which includes a program. When the program runs on a processor, it enables a computer or network device to execute the method for obtaining test data described in any one of the implementation methods of the first aspect above.

[0029] It can be seen that the embodiments of the present application have the following beneficial effects:

[0030] In the above implementation method provided in the embodiment of the present application, first obtain the transaction link under the target business scenario, which represents the various transaction processes involved in completing the business of the target business scenario; based on the order of each transaction process in the transaction link, determine the order of each system node that executes each transaction process; for any system node, determine one or more database scripts involved in the execution of the corresponding transaction process by the system node, and when the system node executes a transaction process involving multiple database scripts, determine the execution order of the multiple database scripts. The system node runs the above one or more database scripts to perform processing operations such as adding / deleting / modifying the data table in the database and executes the corresponding transaction process. For any database script, when running the database script to test the business scenario, the target field in the database script will cause the data table to change, so when generating test data, it is necessary to reverse the actual test process and modify the target field of the database script to the test field to obtain the test script, and the execution order of the test script corresponds one to one with the execution order of the database script. Then, based on the determined order of each system node and the execution order of the test script corresponding to each system node, run all the test scripts to obtain test data. The method for obtaining test data provided by the embodiment of the present application can simulate the business operation process under the business scenario, determine the test script corresponding to each system node, run the test script in the order of the transaction process, and thus generate data for testing. This can simplify manual operations, quickly obtain correct test data, and improve testing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments provided in the present application. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.

[0032] Figure 1 A flowchart of a method for obtaining test data provided in an embodiment of the present application;

[0033] Figure 2 A flowchart of another method for obtaining test data provided in an embodiment of the present application;

[0034] Figure 3 A schematic diagram of a device for acquiring test data provided in an embodiment of the present application;

[0035] Figure 4 A schematic diagram of a device for acquiring test data provided in an embodiment of the present application. DETAILED DESCRIPTION

[0036] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. The described embodiments are only exemplary implementation methods of the present application and are not all implementation methods. Those skilled in the art can combine the embodiments of the present application to obtain other embodiments without creative work, and these embodiments are also within the scope of protection of the present application.

[0037] In order to facilitate understanding of the technical solution of this application, the technical background involved in this application will be introduced below.

[0038] Before executing the test on the channel side, the test personnel usually preliminarily screen the test data in the background database according to the test conditions, and then execute the test on the channel side. For simple business scenarios, there are generally fewer systems involved in implementing the business, that is, there are fewer joint tables in the corresponding database, and the test data that meets the conditions can be obtained by screening in the database. However, for complex business scenarios involving more systems, the conditions for screening test data are more complicated, and complex business scenarios involve more data tables, which will make it impossible to screen out the test data that meets the conditions in the database. Therefore, the staff needs to constantly check and modify the database script until the correct test data can be screened out, resulting in relatively low test efficiency. Figure 1 The figure below illustrates the current process for testers to obtain test data. Testers first generate preliminary test conditions based on the target business scenario, then query data in the database based on the test conditions. Once the data is filtered and obtained, they open customer-facing channels to verify whether the obtained data meets the test conditions. If the verification passes, the obtained data can be used to execute the test case. If the verification fails, the cause of the error must be investigated based on the error code, the data table of the relevant system causing the error must be modified, and the newly obtained test data must be verified again until qualified test data is found for test execution. This continuous trial and error modification leads to relatively low testing efficiency.

[0039] Based on this, an embodiment of the present application provides a method for obtaining test data so that correct test data can be obtained and the efficiency of testing can be improved. In specific implementation, the transaction chain under the target business scenario is first obtained. The transaction chain represents the various transaction processes involved in completing the business of the target business scenario; based on the order of each transaction process in the transaction chain, the order of each system node executing each transaction process is determined; for any system node, one or more database scripts involved in the corresponding transaction process executed by the system node are determined. When the system node executes a transaction process involving multiple database scripts, the execution order of the multiple database scripts is determined. The system node runs the above one or more database scripts, performs processing operations such as adding / deleting / modifying data tables in the database, and executes the corresponding transaction process. For any database script, when running the database script to test the business scenario, the target field in the database script will cause the data table to change. Therefore, when generating test data, it is necessary to reverse the actual test process and modify the target field of the database script to the test field to obtain the test script. The execution order of the test script corresponds one-to-one with the execution order of the database script. Then, based on the determined order of each system node and the execution order of the test script corresponding to each system node, all test scripts are run to obtain test data. The method for obtaining test data provided by the embodiment of the present application can simulate the business operation process under the business scenario, determine the test script corresponding to each system node, run the test script in the order of the transaction process, and thus generate data for testing. This can simplify manual operations, quickly obtain correct test data, and improve testing efficiency.

[0040] The following describes the method for obtaining test data provided in the embodiment of the present application with reference to the accompanying drawings.

[0041] When the target business scenario is relatively simple, you can initially generate test conditions based on the target business scenario. Then, using these conditions to query data in the database, the resulting data serves as test data. To reduce manual intervention, Robotic Process Automation (RPA) can be used to automatically detect whether the filtered data meets the test conditions. If so, it can be applied to actual test cases. RPA technology uses software robots to automate business processes. It can interact with existing user systems according to pre-defined procedures and complete the intended tasks.

[0042] When the target business scenario is complex and test data cannot be directly filtered from the database, you can simulate the actual business operation process, sort out the flow order of data in each related system, determine the database script executed by each system, and obtain the test script that generates test data based on the database script. Run all test scripts in the order of execution of the original database script to generate test data. Figure 2 , Figure 2 A flowchart of a method for obtaining test data provided in an embodiment of the present application.

[0043] In specific implementation, the method mainly includes the following steps:

[0044] S201: Acquire a transaction link under a target business scenario, where the transaction link represents a transaction process involved in completing the business of the target business scenario.

[0045] Implementing the business in the target business scenario may involve multiple transaction processes, all of which form a complete transaction chain to implement the business in the target scenario. Therefore, when simulating actual business, you first need to obtain the transaction chain for the target business scenario. This transaction chain represents the transaction processes involved in completing the business in the target business scenario.

[0046] S202: Based on the order of each transaction process in the transaction link, determine the order of each system node that executes each transaction process.

[0047] To achieve a specific business objective, multiple systems may be required to perform different functions. To accomplish this goal, each system can be considered a system node. This way, each transaction process in the transaction chain corresponds to a corresponding system. After determining the system nodes for executing each transaction process, the order in which these system nodes execute each transaction process must be determined based on the execution order of the transaction processes within the chain. This means determining the order in which each system executes within the chain.

[0048] S203: For any system node, determine the execution order of one or more database scripts corresponding to the system node.

[0049] System nodes execute corresponding transaction processes by running database scripts to achieve their corresponding functions. Therefore, for each system node, it is necessary to obtain the database scripts that the system runs when executing the corresponding transaction process. These database scripts are primarily used to perform operations such as adding, deleting, and modifying data tables in the database. When executing a transaction process, multiple database scripts may be run. In this case, it is necessary to determine the execution order of each database script to accurately simulate the actual business operation process.

[0050] Furthermore, a database script may involve multiple data tables for table joins. In one possible implementation, the database script involving the table joins can be treated as a single database script based on the functions implemented by the database script, i.e., one database script implements one function. Alternatively, based on the add / delete / modify processing operations corresponding to each data table in the table join, the single database script can be split into multiple database scripts, each corresponding to the processing operations of one data table. This is not limited in the present embodiment.

[0051] S204: For any database script, modify the target field in the database script to a test field to obtain a test script.

[0052] Since the database script is used to test the functions of the business scenario, and this embodiment is to generate test data, it is necessary to go against the test process of the actual business and modify the target field of the database script to a test field to obtain a test script. The target field refers to the field that causes the data table to change after running the database script. For example, when running a database script for testing, under normal testing conditions, the target field in the database script can change the A field in the data table from 0 to 1. Then, in order to generate test data, in this embodiment, the target field needs to be modified to a test field. The function of the test field is to change the A field in the data table to 0. If other fields in the database script do not cause changes in the data table, they do not need to be modified and can be directly used as test scripts, ultimately obtaining a test script for generating test data. Among them, the execution order of each test script corresponds one-to-one to the execution order of the database script.

[0053] S205: Based on the order of each system node and the execution order of the test script corresponding to each system node, run all the test scripts to obtain test data.

[0054] For the target business scenario, after determining the order of each system node to achieve the target business and the execution order of the database scripts corresponding to each system node, all test scripts are run based on the order of each system node and the execution order of the test scripts corresponding to each system node to obtain test data.

[0055] To reduce manual intervention and improve the efficiency of obtaining test data, RPA technology can also be used to configure the entire process of generating test data into a program. RPA can automatically execute the corresponding test scripts in the order of each system node, dynamically generate test data, and realize process automation.

[0056] The method for obtaining test data provided by the embodiment of the present application can simulate the business operation process under the business scenario, determine the test script corresponding to each system node, run the test script in the order of the transaction process, and thus generate data for testing. This can simplify manual operations, quickly obtain correct test data, and improve testing efficiency.

[0057] In the above embodiment, it is necessary to determine the order of each system node and the execution order of the test script corresponding to each system node according to the transaction link of the target business scenario. Since complex business scenarios may involve multiple system nodes and multiple test scripts, in order to facilitate the system or staff to understand the actual business operation process more intuitively and accurately, in one possible implementation method, each system node and the test script corresponding to the system node can be stored in the form of a table. For example, according to the flow order of each transaction process in the transaction link, the system nodes corresponding to each transaction process are stored in the same column of the table in sequence. For any system node, based on the execution order of the corresponding database script when the system node completes the transaction process, the test script corresponding to the system node is stored in the same row of the system node in sequence. In this way, the execution order of each system node and the test script can be understood more intuitively. The following will introduce the implementation method of storing test scripts in conjunction with a specific application scenario.

[0058] In the target business scenario, the complete transaction chain is traced according to the transaction process. There are four system nodes involved in the transaction chain. According to the execution order of the transaction process, the order of the four system nodes is determined and stored in the first column of the table in sequence. For any system node, the database script sql_ij that is executed by the system node to implement the corresponding transaction process is determined, where 1≤i≤4, 1≤j≤m, and m is the total number of database scripts corresponding to system node i. When a system node corresponds to multiple database scripts, the execution order of the database scripts is determined. Then, for each database script, the target field in the database script is modified to a test field to obtain a test script SQL_ij, and the test script SQL_ij is stored in sequence in the same row of the system node according to the execution order of the database script sql_ij. As shown in Table 1, this is an implementation method for storing test scripts.

[0059] Table 1 Storage method of test scripts

[0060]

[0061] Table 1 shows that implementing the business in this target scenario requires the collaboration of four systems, with the order in which each system executes its functions being system node 1, system node 2, system node 3, and system node 4. For example, system node 1 corresponds to two test scripts, and the execution order of the test scripts is SQL_11, SQL_12, and SQL_21. Therefore, when obtaining test data based on the table above, the order in which the test scripts are executed is SQL_11, SQL_12, SQL_21, SQL_22, SQL_23, SQL_31, SQL_32, and SQL_41.

[0062] The above embodiment describes the storage of system nodes and test scripts in a table format. In another possible implementation, the order of system nodes and test scripts can be stored in a matrix format. For example, each system node corresponds to a row in the matrix, and the test scripts corresponding to the system node are stored in that row. Since each system node may correspond to a different number of test scripts, the rows containing system nodes with fewer test scripts can be padded with zeros to form a complete matrix.

[0063] It should be noted that the two methods of storing test scripts introduced above are merely exemplary descriptions and are not limited to the above two implementation methods. Other achievable forms are also within the scope of protection of this application.

[0064] After establishing a table to store all test scripts for a target business scenario, the table storing test scripts can be dynamically adjusted when the transaction process of the target business scenario changes or when the transaction function of a system changes. For example, if the order of transaction processes in the original transaction chain changes, the order of the original system nodes can be adjusted according to the new transaction process order. If a transaction process in the original transaction chain is deleted, the system node and the test script corresponding to the system node can be deleted accordingly. If a transaction process is added to a new business scenario, the system node corresponding to the new transaction process is inserted into the original system node in the execution order of the new transaction process, based on the order of the transaction processes in the new transaction chain. The test scripts corresponding to the new system node are stored in the same row as the new system node in the execution order. In addition, if the function corresponding to the transaction process changes, that is, the function implemented by the system changes, the backend developer can modify the content of the test script without the need for tester intervention. If the execution order of the test script changes, the tester only needs to adjust the execution order of the test script to adapt the table storing the test script to the new business scenario. This allows the tester to dynamically generate test data adapted to the new business scenario based on the actual business process without having to understand the operational process of the backend database. In addition, in actual business scenarios, some test data is consumable and cannot be reused once used. Through the method for obtaining test data provided in this embodiment, RPA can be configured to automatically execute test scripts to generate test data, thereby improving test efficiency.

[0065] Based on the above method embodiment, the embodiment of the present application provides a device for obtaining test data, and the working principle of the device will be described below with reference to the accompanying drawings.

[0066] See also Figure 3 , Figure 3 Schematic diagram of a device for acquiring test data provided in an embodiment of the present application. The device 300 includes: a first acquisition module 301, a first determination module 302, a second determination module 303, a second acquisition module 304, and a third acquisition module 305;

[0067] The first acquisition module 301 is used to acquire a transaction link in a target business scenario, where the transaction link represents a transaction process involved in completing the business of the target business scenario;

[0068] The first determining module 302 is configured to determine the order of executing each transaction process on each system node based on the order of each transaction process in the transaction link;

[0069] The second determination module 303 is configured to determine, for any system node, the execution order of one or more database scripts corresponding to the system node, the one or more database scripts being used by the system node to execute a corresponding transaction process, and the one or more database scripts being used to process a data table;

[0070] The second acquisition module 304 is configured to modify a target field in any database script into a test field to obtain a test script. The execution order of the test script corresponds to the execution order of the database script. The target field is used to change the data table corresponding to the database script after the database script is executed.

[0071] The third acquisition module 305 is configured to execute all test scripts and acquire test data based on the order of the system nodes and the execution order of the test scripts corresponding to each system node.

[0072] In one possible implementation, the device 300 can also be used to determine the order of executing each system node of the changed transaction process and execute subsequent processes to re-acquire test data when the transaction link in the target business scenario changes, based on the transaction process involved in the changed transaction link.

[0073] In one possible implementation, the third acquisition module 305 is specifically used to utilize robotic process automation (RPA) technology to automatically run all test scripts and obtain test data based on the order of the system nodes and the execution order of the test scripts corresponding to each system node.

[0074] In a possible implementation, the apparatus 300 further includes a screening module configured to generate a test condition based on the target business scenario, and screen and obtain the test data from a database based on the test condition.

[0075] In one possible implementation, the system nodes and the test script corresponding to each system node are stored in a table format, wherein the system nodes are stored in the same column in the order of executing each transaction process in the transaction link, and for any system node, the test script corresponding to the system node is stored in the same row as the system node in the order of execution.

[0076] The beneficial effects of the device for obtaining test data provided in the embodiment of the present application can be found in the above method embodiment and will not be repeated here.

[0077] In addition, the embodiment of the present application also provides a device for obtaining test data. Figure 4 , Figure 4A schematic diagram of a device for acquiring test data provided in an embodiment of the present application.

[0078] The device 400 includes: a memory 401 and a processor 402;

[0079] The memory 401 is used to store relevant program codes;

[0080] The processor 402 is configured to call the program code to execute the method for acquiring test data described in the above method embodiment.

[0081] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store a computer program, and the computer program is used to execute the method for obtaining test data described in the above method embodiment.

[0082] An embodiment of the present application further provides a computer program product, which includes a program. When the program is run on a processor, it enables a computer or a network device to execute the method for obtaining test data described in the above method embodiment.

[0083] It should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other. In particular, for system or device embodiments, since they are basically similar to method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. The device embodiments described above are merely illustrative, wherein the units or modules described as separate components may or may not be physically separated, and the components shown as units or modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units or modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. Ordinary technicians in this field can understand and implement it without expending creative work.

[0084] It should be understood that in this application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0085] It should also be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprises," "comprising," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of additional identical elements in the process, method, article, or device comprising the element.

[0086] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0087] The above description of the disclosed embodiments is intended to enable one skilled in the art to implement or use the present application. Various modifications to these embodiments will be readily apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application is not limited to the embodiments shown herein, but is intended to conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for obtaining test data, characterized in that: The method comprises: Obtaining a transaction link under a target business scenario, where the transaction link represents a transaction process involved in completing the business of the target business scenario; Determining the order of the system nodes for executing the transaction processes based on the order of the transaction processes in the transaction link; For any system node, determine the execution order of one or more database scripts corresponding to the system node, the one or more database scripts being used by the system node to execute a corresponding transaction process, and the one or more database scripts being used to process a data table; For any database script, modify the target field in the database script to a test field to obtain a test script. The execution order of the test script corresponds one-to-one to the execution order of the database script. The target field is used to change the data table corresponding to the database script after running the database script. Based on the order of the system nodes and the execution order of the test scripts corresponding to each of the system nodes, run all the test scripts to obtain test data; The method further comprises: When the transaction link under the target business scenario changes, the order of executing each system node of the changed transaction process is determined according to the transaction process involved in the changed transaction link, and subsequent processes are performed to re-acquire test data.

2. The method according to claim 1, characterized in that The step of running all test scripts based on the order of the system nodes and the execution order of the test scripts corresponding to each of the system nodes to obtain test data includes: By using Robotic Process Automation (RPA) technology, all test scripts are automatically run based on the order of the system nodes and the execution order of the test scripts corresponding to each system node to obtain test data.

3. The method according to claim 1, characterized in that The method further comprises: A test condition is generated based on the target business scenario, and the test data is obtained by screening from a database based on the test condition.

4. The method according to claim 1, wherein The system nodes and the test scripts corresponding to each system node are stored in a table, wherein the system nodes are stored in the same column according to the order of executing each transaction process in the transaction link. For any system node, the test script corresponding to the system node is stored in the same row as the system node in the order of execution.

5. A device for acquiring test data, characterized in that: The device includes: a first acquisition module, a first determination module, a second determination module, a second acquisition module, and a third acquisition module; The first acquisition module is configured to acquire a transaction link in a target business scenario, where the transaction link represents a transaction process involved in completing a business in the target business scenario; The first determining module is configured to determine the order of executing each transaction process on each system node based on the order of each transaction process in the transaction link; The second determination module is configured to determine, for any system node, an execution order of one or more database scripts corresponding to the system node, the one or more database scripts being used by the system node to execute a corresponding transaction process, and the one or more database scripts being used to process a data table; The second acquisition module is configured to modify a target field in any database script into a test field to obtain a test script, wherein the execution order of the test script corresponds to the execution order of the database script. The target field is used to change the data table corresponding to the database script after the database script is executed; The third acquisition module is configured to run all test scripts and acquire test data based on the order of the system nodes and the execution order of the test scripts corresponding to each of the system nodes; The device is also used to determine the order of executing each system node of the changed transaction process and execute subsequent processes to re-acquire test data when the transaction link under the target business scenario changes, based on the transaction process involved in the changed transaction link.

6. A device for acquiring test data, characterized in that: The device includes: a memory and a processor; The memory is used to store relevant program codes; The processor is used to call the program code to execute the method for obtaining test data according to any one of claims 1 to 4.

7. A computer-readable storage medium, characterized in that The computer-readable storage medium is used to store a computer program, and the computer program is used to execute the method for acquiring test data according to any one of claims 1 to 4.

8. A computer program product, characterized in that The computer program product includes a program, and when the program is run on a processor, it causes a computer or a network device to execute the method for obtaining test data according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Business system test method, device and equipment

    CN111625458A

  • Data preparation method and device, equipment and storage medium

    CN113760734A