Method and device for acquiring test data, equipment, storage medium and product
By combining the number components to generate the target number components, the problem of high efficiency and low cost acquisition of test data in the prior art is solved, and fast and efficient generation of test data is achieved.
Patent Information
- Application Number
- CN202411425132.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-12
- Publication Date
- 2025-02-14
AI Technical Summary
The cost and inefficient acquisition of test data in the prior art is that testers need to manually write scripts to generate the test data required for complex business scenarios.
By determining multiple manufacturing components based on the target business scenario, combining them using the interface, generating the target manufacturing components corresponding to the target business scenario, and generating test data through the manufacturing components.
Reduces the cost of obtaining test data, improves efficiency, and eliminates the need to manually write scripts, and can quickly generate test data that meets business scenarios.
Smart Images

Figure CN119441026A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to methods, devices, equipment, storage media and products for obtaining test data. Background Art
[0002] During the testing phase of software development, a large amount of test data is needed to test the software in order to verify the performance of the developed software. In addition, the more complex the business functions of the developed software are and the higher the integration, the richer its business scenarios are, and the richer the types of test data required.
[0003] In the related art, testers generally manually write scripts for business scenarios to generate test data required for the business scenarios. However, this method of obtaining test data has high labor costs and low efficiency in obtaining test data.
[0004] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention
[0005] The main purpose of the present application is to provide a method, apparatus, device, storage medium and product for obtaining test data, which can reduce the cost of obtaining test data and improve the efficiency of obtaining test data.
[0006] To achieve the above purpose, the present application proposes a method for obtaining test data, the method comprising:
[0007] Determine a plurality of number-generating components based on a target business scenario, wherein the number-generating components correspond to business processes in the target business scenario, and the number-generating components are used to generate business data required by the corresponding business processes;
[0008] Displaying the multiple number-generating components in the interface;
[0009] Combining the multiple number-generating components through the interface to obtain a target number-generating component corresponding to the target business scenario;
[0010] The test data corresponding to the target business scenario is generated through the target number generation component.
[0011] Optionally, the number generation component includes a graphic node, a connection line corresponding to at least one input parameter, and a connection line corresponding to at least one output parameter;
[0012] The combining the multiple number-generating components through the interface to obtain a target number-generating component corresponding to the target business scenario includes:
[0013] Based on the output parameters and the connection lines corresponding to the output parameters, the multiple number-generating components are spliced according to the business processes corresponding to the multiple number-generating components to obtain the target number-generating component.
[0014] Optionally, after the multiple number-generating components are spliced based on the output parameters and the connection lines corresponding to the output parameters and according to the business processes corresponding to the multiple number-generating components to obtain the target number-generating component, the method further includes:
[0015] Through the interface, the input parameters of the target number generation component are selected from the input parameters of the multiple number generation components, and the output parameters of the target number generation component are selected from the output parameters of the multiple number generation components.
[0016] Optionally, before determining a plurality of number-generating components based on the target business scenario, the method further includes:
[0017] Obtain a number-generating script, wherein the number-generating script is used to generate business data required by a corresponding business process;
[0018] Through the interface, a graphical number-generating component corresponding to the number-generating script is constructed, and the number-generating component includes the graphical node, a connecting line corresponding to at least one input parameter of the number-generating script, and a connecting line corresponding to at least one output parameter of the number-generating script.
[0019] Optionally, the determining of multiple number-generating components based on the target business scenario includes:
[0020] Acquire a component search term input based on the target business scenario, where the component search term is used to describe a business process included in the target business scenario;
[0021] Based on the component search term, a number-making component library is searched to obtain a plurality of number-making components associated with the component search term.
[0022] Optionally, after combining the multiple number-generating components through the interface to obtain a target number-generating component corresponding to the target business scenario, the method further includes:
[0023] Determine a label corresponding to the target number-generating component, where the label is used to describe the business process corresponding to the target number-generating component;
[0024] The target number-generating component is stored in the number-generating component library as a new number-generating component in association with the corresponding label.
[0025] Optionally, after generating the test data corresponding to the target business scenario by the target number generation component, the method further includes:
[0026] Determine a scenario tag of the test data, where the scenario tag is used to describe a test scenario to which the test data is applied;
[0027] The test data is associated with the corresponding scene tags and stored in a test database.
[0028] Optionally, after the test data is associated with the corresponding scene tags and stored in a test database, the method further includes:
[0029] Acquire a test data search term, where the test data search term is used to describe a test scenario of required target test data;
[0030] The test database is searched based on the test data search term to obtain the target test data associated with the test scenario.
[0031] In addition, to achieve the above purpose, the present application also proposes a device for acquiring test data, the device comprising:
[0032] A component determination module, used to determine a plurality of number-generating components based on a target business scenario, wherein the number-generating components correspond to business processes in the target business scenario, and the number-generating components are used to generate business data required by the corresponding business processes;
[0033] A component display module, used to display the multiple number-generating components in an interface;
[0034] A component combination module, used to combine the multiple number-generating components through the interface to obtain a target number-generating component corresponding to the target business scenario;
[0035] The data generation module is used to generate test data corresponding to the target business scenario through the target number generation component.
[0036] Optionally, the number-generating component includes a graphic node, a connection line corresponding to at least one input parameter, and a connection line corresponding to at least one output parameter;
[0037] The component combination module is used to splice the multiple number-generating components based on the output parameters and the connection lines corresponding to the output parameters and according to the business processes corresponding to the multiple number-generating components to obtain the target number-generating component.
[0038] Optionally, the component combination module is further used to select, through the interface, input parameters of the target number generation component from the input parameters of the multiple number generation components, and select output parameters of the target number generation component from the output parameters of the multiple number generation components.
[0039] Optionally, the device further comprises:
[0040] A component construction module is used to obtain a number-generating script, wherein the number-generating script is used to generate business data required by a corresponding business process; through the interface, a graphical number-generating component corresponding to the number-generating script is constructed, wherein the number-generating component includes the graphical node, a connecting line corresponding to at least one input parameter of the number-generating script, and a connecting line corresponding to at least one output parameter of the number-generating script.
[0041] Optionally, the component determination module is used to obtain a component search term input based on the target business scenario, wherein the component search term is used to describe the business process included in the target business scenario; based on the component search term, the number-generating component library is searched to obtain multiple number-generating components associated with the component search term.
[0042] Optionally, the device further comprises:
[0043] The component storage module is used to determine the label corresponding to the target number-generating component, where the label is used to describe the business process corresponding to the target number-generating component; and store the target number-generating component as a new number-generating component in the number-generating component library in association with the corresponding label.
[0044] Optionally, the device further comprises:
[0045] The data storage module is used to determine the scenario tag of the test data, where the scenario tag is used to describe the test scenario to which the test data is applied; and associate the test data with the corresponding scenario tag and store them in a test database.
[0046] Optionally, the device further comprises:
[0047] The data query module is used to obtain test data search terms, where the test data search terms are used to describe the test scenario of the required target test data; based on the test data search terms, the test database is searched to obtain the target test data associated with the test scenario.
[0048] In addition, to achieve the above-mentioned purpose, the present application also proposes a device for obtaining test data, the device comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the method for obtaining test data as described above.
[0049] In addition, to achieve the above objectives, the present application also proposes a storage medium, which is a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the method for obtaining test data as described above are implemented.
[0050] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps of the method for obtaining test data as described above are implemented.
[0051] One or more technical solutions proposed in this application have at least the following technical effects:
[0052] The solution for obtaining test data provided by the present application is not to write scripts for business scenarios to generate test data, but to use existing number-making components to construct target number-making components corresponding to business scenarios through image arrangement, and to generate test data through the target number-making components. Among them, multiple number-making components are determined based on the target business scenario. Since the determined number-making components correspond to the business processes in the target business scenario, and the number-making components are used to generate the business data required for the corresponding business processes, then the target number-making components constructed based on these multiple number-making components can match the business processes of the target business scenario, and the generated test data meets the test requirements of the target business scenario. In addition, by combining multiple number-making components displayed in the interface, the target number-making components corresponding to the target business scenario are obtained, and the test data corresponding to the target business scenario is generated through the target number-making components. The method is simple and efficient, and there is no need for testers to manually write scripts, which not only reduces labor costs, but also improves the efficiency of obtaining test data. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0054] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0055] Figure 1 A schematic diagram of an implementation environment of the method for obtaining test data of the present application;
[0056] Figure 2 A flowchart of a first embodiment of a method for obtaining test data according to the present application is provided;
[0057] Figure 3 A schematic diagram of a number-generating component provided for this application;
[0058] Figure 4 A schematic diagram of another number-generating component provided for this application;
[0059] Figure 5A schematic diagram of another number-generating component provided for this application;
[0060] Figure 6 A flowchart of a second embodiment of the method for obtaining test data of the present application is provided;
[0061] Figure 7 A schematic diagram of a test data table provided in an embodiment of the present application;
[0062] Figure 8 A schematic diagram of the module structure of a device for acquiring test data according to an embodiment of the present application;
[0063] Fig. 9 A schematic diagram of the device structure of the hardware operating environment involved in the method for obtaining test data in an embodiment of the present application.
[0064] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0065] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0066] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0067] Figure 1 is a schematic diagram of an implementation environment provided by an embodiment of the present application. Figure 1 , the implementation environment includes a terminal 101 and a server 102. The terminal 101 and the server 102 are connected via a wireless or wired network. Exemplarily, the terminal 101 is a computer, a mobile phone, a tablet computer or other terminals. Exemplarily, the server 102 is a background server of an application or a cloud server that provides cloud computing and cloud storage services.
[0068] In an embodiment of the present application, the terminal 101 is used to determine multiple number-generating components based on a target business scenario, and display the multiple number-generating components in an interface; combine the multiple number-generating components through the interface to obtain a target number-generating component corresponding to the target business scenario; and generate test data corresponding to the target business scenario through the target number-generating component.
[0069] In a possible implementation, the number-generating components are stored in the server 102. Accordingly, the terminal 101 is used to obtain a component search term input based on a target business scenario, and send a component search request to the server 102. The server 102 is used to receive the component search request, search the number-generating component library based on the component search term, obtain multiple number-generating components associated with the component search term, and then send the multiple number-generating components to the terminal 101. Afterwards, the terminal 101 can combine the multiple number-generating components to obtain a target number-generating component, and generate test data corresponding to the target business scenario through the target number-generating component.
[0070] Figure 2 This is a flow chart of the first embodiment of the method for obtaining test data in this application. Figure 2 Taking the execution subject as a terminal as an example, the method for obtaining test data includes the following steps S10 to S40:
[0071] Step S10, determining a plurality of number-generating components based on the target business scenario, wherein the number-generating components correspond to business processes in the target business scenario, and the number-generating components are used to generate business data required by the corresponding business processes.
[0072] A number-making component is a graphical component corresponding to a number-making script. Exemplarily, the number-making script is a SQL (Structured Query Language) script for data processing. Input parameters are given to the number-making script, and output parameters can be obtained by processing. The data processing function implemented by the number-making component is similar to that of the corresponding number-making script. The difference from the number-making script is that the number-making script is composed of a programming language, while the number-making component is composed of a graph, specifically including a graph node, a connection line corresponding to at least one input parameter, and a connection line corresponding to at least one output parameter.
[0073] The target business scenario includes multiple business processes, and the number-generating component corresponds to the business process in the target business scenario, and is used to generate the business data required by the corresponding business process. Exemplarily, the scenario of purchasing daily necessities includes an account registration process and an order generation process, so the scenario of purchasing daily necessities corresponds to two number-generating components, and the first number-generating component corresponds to the account registration process, and is used to generate the business data required for the account registration process. For example, the input parameters of the first number-generating component include a mobile phone number and a name, and the first number-generating component can output the registered shopping account based on the mobile phone number and the name. The second number-generating component corresponds to the order generation process, and is used to generate the business data required for the order generation process. For example, the input parameters of the second number-generating component include a shopping account and shopping information, and the second number-generating component can output order information based on the shopping account and the shopping information.
[0074] Exemplarily, the shape of the graphic node in the number-generating component may be a circle, a rectangle, a pentagon, a hexagon or other shapes, which is not limited in the embodiment of the present application. Figure 3 This is a schematic diagram of a number-generating component provided by this application. Figure 3 , the number-generating component includes a rectangular node, three connecting lines corresponding to input parameters, and three connecting lines corresponding to output parameters.
[0075] Optionally, the terminal determines multiple number-generating components based on the target business scenario, including: obtaining a component search term input based on the target business scenario, the component search term is used to describe the business process included in the target business scenario; based on the component search term, searching the number-generating component library to obtain multiple number-generating components associated with the component search term.
[0076] The number-generating component library is used to store number-generating components. Each number-generating component has a corresponding label, which is used to describe the business process corresponding to the number-generating component. For example, the label corresponding to the number-generating component is "shopping account registration", which means that the number-generating component is used to register a shopping account. For another example, the label corresponding to the number-generating component is "order information generation", which means that the number-generating component is used to generate order information. Correspondingly, the two number-generating components can be quickly retrieved from the number-generating component library through the component search terms "shopping account registration and order information generation".
[0077] In the embodiment of the present application, in the target business scenario, by using component search terms to search for number-generating components from a number-generating component library, it is possible to efficiently and accurately retrieve number-generating components corresponding to the business process in the target business scenario.
[0078] Step S20, displaying the multiple number-generating components in the interface.
[0079] For example, the interface is a construction interface of a number-making component. After a plurality of number-making components are displayed in the interface, the position of the number-making components can be moved, the size of the number-making components can be changed, the color of the number-making components can be set, the shape of the image node of the number-making components can be set, the type of the connection line in the number-making components can be set, etc.
[0080] Step S30, combining the multiple number-generating components through an interface to obtain a target number-generating component corresponding to a target business scenario.
[0081] The number-generating component includes a graphic node, a connection line corresponding to at least one input parameter, and a connection line corresponding to at least one output parameter. Accordingly, the terminal combines multiple number-generating components through an interface to obtain a target number-generating component corresponding to a target business scenario, including: splicing multiple number-generating components according to business processes corresponding to multiple number-generating components based on output parameters and connection lines corresponding to the output parameters to obtain the target number-generating component. For example, the target number-generating component is constructed in series sequentially, that is, the connection line of the output parameter of the number-generating component corresponding to each business process is connected to the connection line of the input parameter of the number-generating component corresponding to the next business process, until the multiple number-generating components are connected together to obtain the target number-generating component.
[0082] Optionally, the terminal splices multiple number-generating components based on the output parameters and the connection lines corresponding to the output parameters according to the business processes corresponding to the multiple number-generating components, and after obtaining the target number-generating component, the input parameters and output parameters of the target number-generating component must be determined. The implementation method is: through the interface, the input parameters of the target number-generating component are selected from the input parameters of the multiple number-generating components, and the output parameters of the target number-generating component are selected from the output parameters of the multiple number-generating components.
[0083] It should be noted that in the embodiments of the present application, the number-generating component corresponding to the indivisible business process is called atomic number-generating, and the number-generating component obtained by combining atomic number-generating is called combined number-generating. For example, the number-generating component corresponding to a single transaction, a third-party business interface, or other indivisible business method is called atomic number-generating.
[0084] For example, the working principle of combination number creation is:
[0085] The execution of combined number creation is carried out in the order of internally arranged atomic number creation. The execution steps of each atomic number creation include: Input action (input parameter conversion), Send action (transaction sending), Store action (data storage), and Output action (output parameter conversion).
[0086] Input action: mainly processes input parameters to facilitate subsequent transaction sending, such as field name conversion of request information, additional parameter processing, etc.
[0087] Send action: Sends a business request containing some input parameters to implement scenario construction and determine whether the business request is successful.
[0088] Store action: stores business data that needs to be stored in the database after successful atomic number creation.
[0089] Output action: mainly processes the input parameters and the obtained business data to obtain output parameters. Some parameters can be used as input parameters for subsequent atomic number creation.
[0090] Figure 4 is a schematic diagram of another number-generating component provided by this application. Figure 4 , the combined number E includes two atomic numbers A, one atomic number B, one atomic number C and one atomic number D. The two atomic numbers A are connected to the atomic number B through the parameter "customer number". The atomic number B is connected to the atomic number D through the three parameters "name", "ID number" and "mobile phone number". The atomic number C is connected to the atomic number D through the two parameters "project partner code" and "merchant number". Moreover, the atomic number A located below is also connected to the atomic number D through the parameter "card number". In addition, Figure 4 In the figure, the business scenario "A+A+B+C+D" of the combined number E means that the business process in the business scenario corresponding to the combined number E includes two business processes corresponding to the atomic number A, one business process corresponding to the atomic number B, one business process corresponding to the atomic number C, and one business process corresponding to the atomic number D.
[0091] Figure 5 is a schematic diagram of another number-generating component provided by this application. Figure 5 , the combined number H includes the combined number E, the atomic number F and the atomic number G. Among them, the combined number E is connected to the atomic number F through the parameters "merchant number" and "protocol number", and the atomic number F is connected to the atomic number G through the parameter "Netcom account number". Figure 5 In the scenario "E+F+G" of the combined number H, it means that the business process in the business scenario corresponding to the combined number H includes the business process corresponding to the combined number E, the business process corresponding to the atomic number F, and the business process corresponding to the atomic number G.
[0092] In the embodiment of the present application, by connecting lines corresponding to input parameters and output parameters of the number-generating components and in accordance with the business processes corresponding to the multiple number-generating components, a target number-generating component is obtained by splicing the multiple number-generating components. There is no need for technicians to manually write number-generating scripts to produce test data. Instead, the existing number-generating components are graphically spliced by line connection to generate the target number-generating component, and the test data is generated by the target number-generating component. This not only greatly reduces the difficulty of manufacturing new number-generating components, but also improves the efficiency of manufacturing new number-generating components, thereby improving the efficiency of generating test data and reducing labor costs.
[0093] In the embodiment of the present application, after a plurality of grouping components are spliced to obtain a target number-generating component, input parameters of the target number-generating component are selected from the input parameters of the plurality of number-generating components through an interface, and output parameters of the target number-generating component are selected from the output parameters of the plurality of number-generating components. The method is simple and efficient, and can reduce technical dependence on technical personnel.
[0094] Optionally, after the terminal combines multiple number-generating components through the interface and obtains the target number-generating component corresponding to the target business scenario, the target number-generating component needs to be stored. The implementation method is: determining the label corresponding to the target number-generating component, the label is used to describe the business process corresponding to the target number-generating component; the target number-generating component is stored as a new number-generating component in association with the corresponding label in the number-generating component library, so as to facilitate the later retrieval of the number-generating component based on the number-generating component library.
[0095] Step S40: Generate test data corresponding to the target business scenario through the target data generation component.
[0096] Exemplarily, the input parameters required by the target number generation component are assigned to the target number generation component, and the target number generation component can output test data corresponding to the target business scenario based on the input parameters.
[0097] Optionally, before the terminal determines multiple number-generating components based on the target business scenario, it must first construct the number-generating component. The implementation method is: obtaining a number-generating script, the number-generating script is used to generate business data required by the corresponding business process; through the interface, constructing a graphical number-generating component corresponding to the number-generating script, the number-generating component includes a graphical node, a connection line corresponding to at least one input parameter of the number-generating script, and a connection line corresponding to at least one output parameter of the number-generating script.
[0098] Exemplarily, the interface is a construction interface of a number-making component. The interface includes at least one graphic node and at least one type of connection line. The user selects the graphic node corresponding to the number-making script, the connection line of the input parameter, and the connection line of the output parameter through the interface, and then obtains the number-making component corresponding to the number-making script.
[0099] In the embodiment of the present application, a graphical number-generating component corresponding to a number-generating script is constructed through an interface. The method is simple, and the existing number-generating component can be reused to quickly construct a new number-generating component to quickly generate the test data required for a new business scenario.
[0100] One point that needs to be explained is that, in some embodiments, the above-mentioned number-generating script can be replaced by a number-generating interface, that is, obtaining a number-generating interface, which is used to generate business data required by the corresponding business process; through the interface, constructing a graphical number-generating component corresponding to the number-generating interface, the number-generating component includes a graphical node, a connecting line corresponding to at least one input parameter of the number-generating interface, and a connecting line corresponding to at least one output parameter of the number-generating interface.
[0101] The solution for obtaining test data provided by the present application is not to write scripts for business scenarios to generate test data, but to use existing number-making components to construct target number-making components corresponding to business scenarios through image arrangement, and to generate test data through the target number-making components. Among them, multiple number-making components are determined based on the target business scenario. Since the determined number-making components correspond to the business processes in the target business scenario, and the number-making components are used to generate the business data required for the corresponding business processes, then the target number-making components constructed based on these multiple number-making components can match the business processes of the target business scenario, and the generated test data meets the test requirements of the target business scenario. In addition, by combining multiple number-making components displayed in the interface, the target number-making components corresponding to the target business scenario are obtained, and the test data corresponding to the target business scenario is generated through the target number-making components. The method is simple and efficient, and there is no need for testers to manually write scripts, which not only reduces labor costs, but also improves the efficiency of obtaining test data.
[0102] Based on the above first embodiment, a second embodiment of the present application is proposed. For the same or similar contents as the first embodiment, please refer to the above introduction and will not be described in detail later. Figure 6 In the second embodiment, after the above step S40, steps S50 to S80 are further performed:
[0103] Step S10, determining a plurality of number-generating components based on the target business scenario, wherein the number-generating components correspond to business processes in the target business scenario, and the number-generating components are used to generate business data required by the corresponding business processes.
[0104] Step S20, displaying the multiple number-generating components in the interface.
[0105] Step S30, combining the multiple number-generating components through an interface to obtain a target number-generating component corresponding to a target business scenario.
[0106] Step S40: Generate test data corresponding to the target business scenario through the target data generation component.
[0107] Step S50: determining a scenario tag of the test data, where the scenario tag is used to describe the test scenario to which the test data is applied.
[0108] Exemplarily, the test data corresponding to the target business scenario is used to describe the target business scenario. For example, if the target business scenario is to purchase daily necessities, the label of the test data may be "Scenario-Purchase of Daily Necessities". For another example, if the target business scenario is to calculate the income of a financial product, the label of the test data may be "Scenario-Calculate the income of a financial product".
[0109] Step S60: associate the test data with the corresponding scene tags and store them in a test database.
[0110] In the embodiment of the present application, considering that the larger the amount of test data and the more complex the test data, the greater the retrieval difficulty, therefore, complex data retrieval is achieved by labeling the test data to reduce the retrieval difficulty, that is, the scene label of the test data is determined, and the test data is associated with the corresponding scene label and stored in the test database. Subsequently, based on the scene label corresponding to the test data, the test data is quickly retrieved from the test database, and there is no need for technical personnel to write complex SQL scripts to retrieve test data, which reduces the labor cost of obtaining test data and improves the efficiency of obtaining test data.
[0111] Exemplarily, the scenario labels of the test data are stored in the test database in a table format, for example, the scenario labels of the test data are stored in a test data table in the test database. Figure 7 A schematic diagram of a test data table provided in an embodiment of the present application. Figure 7 ,The test data table includes two columns, where the content of the first column is the ,scene label of the test data, and the content of the second column is the ,data volume of the test data under each scene label.
[0112] Step S70: acquiring a test data search term, where the test data search term is used to describe a test scenario of the required target test data.
[0113] Exemplarily, the terminal displays a data search interface and receives a test data search term input by a user in the data search interface. For example, the test data search term is "test data in the scenario of purchasing daily necessities" or "test data in the scenario of calculating the income of financial products".
[0114] Step S80: searching the test database based on the test data search term to obtain target test data associated with the test scenario.
[0115] Exemplarily, after the terminal retrieves the target test data, the target test data is displayed in the data retrieval interface, for example, the scene label of the target test data, the number of target test data, the content of the target test data, etc. are displayed to facilitate user browsing.
[0116] In the embodiment of the present application, since the test data search term is used to describe the test scenario of the required target test data, and the test data in the test database is provided with a scenario tag for describing the test scenario to which the test data is applied, after the terminal obtains the test data search term, it can search the test database based on the test data search term, determine the scenario tag semantically associated with the test data search term, thereby determining the test data corresponding to the scenario tag, and determining the test data as the target test data. This method improves the efficiency and accuracy of obtaining the target test data.
[0117] One thing that needs to be explained is that there is currently no systematic solution for the construction of test data in the testing phase of the software development process. For the testing of large-scale software systems with complex business functions and high system integration, one of the important work contents is the construction of test data. In most cases, testers manually write test scripts one-to-one based on test scenarios to construct test data. The disadvantages are high cost, poor reusability, and inconvenient sharing. The solution in this application forms new scenarios with richer number-making components through the arrangement of number-making components to produce various test data. The existing number-making components are fully reused, and the writing cost is reduced through the arrangement method. In addition, complex data retrieval is achieved by labeling, without the need for users to write complex SQL scripts. Current practical effect: The data resource pool has a total of millions of test data, nearly 100 types of test scenario data types, and most types require a combination of multiple business scenarios. New scenario data requirements can generate new combination numbers in just a few minutes without adding new atomic numbers.
[0118] Another point that needs to be explained is that the above examples are only used to understand the present application and do not constitute a limitation on the method of obtaining test data in the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.
[0119] This application also provides a device for obtaining test data, please refer to Figure 8 , the device for obtaining test data includes:
[0120] A component determination module 10 is used to determine a plurality of number-generating components based on a target business scenario, wherein the number-generating components correspond to business processes in the target business scenario, and the number-generating components are used to generate business data required by the corresponding business processes;
[0121] The component display module 20 is used to display multiple number-generating components in the interface;
[0122] The component combination module 30 is used to combine multiple number-generating components through an interface to obtain a target number-generating component corresponding to a target business scenario;
[0123] The data generation module 40 is used to generate test data corresponding to the target business scenario through the target data generation component.
[0124] Optionally, the number-generating component includes a graphic node, a connection line corresponding to at least one input parameter, and a connection line corresponding to at least one output parameter;
[0125] The component combination module 30 is used to combine multiple number-generating components based on the output parameters and the connection lines corresponding to the output parameters and according to the business processes corresponding to the multiple number-generating components to obtain a target number-generating component.
[0126] Optionally, the component combination module 30 is further used to select input parameters of a target number generation component from input parameters of multiple number generation components through an interface, and select output parameters of a target number generation component from output parameters of multiple number generation components.
[0127] Optionally, the device further comprises:
[0128] The component construction module is used to obtain a number-generating script, which is used to generate business data required by the corresponding business process; through the interface, a graphical number-generating component corresponding to the number-generating script is constructed, and the number-generating component includes a graphical node, a connection line corresponding to at least one input parameter of the number-generating script, and a connection line corresponding to at least one output parameter of the number-generating script.
[0129] Optionally, the component determination module 10 is used to obtain a component search term input based on a target business scenario, where the component search term is used to describe a business process included in the target business scenario; based on the component search term, the number-making component library is searched to obtain multiple number-making components associated with the component search term.
[0130] Optionally, the device further comprises:
[0131] The component storage module is used to determine the label corresponding to the target number-making component, where the label is used to describe the business process corresponding to the target number-making component; the target number-making component is associated with the corresponding label as a new number-making component and stored in the number-making component library.
[0132] Optionally, the device further comprises:
[0133] The data storage module is used to determine the scenario label of the test data, where the scenario label is used to describe the test scenario to which the test data is applied; and associate the test data with the corresponding scenario label and store it in the test database.
[0134] Optionally, the device further comprises:
[0135] The data query module is used to obtain test data search terms, which are used to describe the test scenarios of the required target test data; based on the test data search terms, the test database is searched to obtain the target test data associated with the test scenario.
[0136] The solution for obtaining test data provided by the present application is not to write scripts for business scenarios to generate test data, but to use existing number-making components to construct target number-making components corresponding to business scenarios through image arrangement, and to generate test data through the target number-making components. Among them, multiple number-making components are determined based on the target business scenario. Since the determined number-making components correspond to the business processes in the target business scenario, and the number-making components are used to generate the business data required for the corresponding business processes, then the target number-making components constructed based on these multiple number-making components can match the business processes of the target business scenario, and the generated test data meets the test requirements of the target business scenario. In addition, by combining multiple number-making components displayed in the interface, the target number-making components corresponding to the target business scenario are obtained, and the test data corresponding to the target business scenario is generated through the target number-making components. The method is simple and efficient, and there is no need for testers to manually write scripts, which not only reduces labor costs, but also improves the efficiency of obtaining test data.
[0137] The device for acquiring test data provided by the present application adopts the method for acquiring test data in the above-mentioned embodiment, which can solve the technical problems of high labor cost for acquiring test data and low efficiency for acquiring test data in the related art. Compared with the prior art, the beneficial effects of the device for acquiring test data provided by the present application are the same as the beneficial effects of the method for acquiring test data provided by the above-mentioned embodiment, and other technical features in the device for acquiring test data are the same as the features disclosed in the above-mentioned embodiment method, which will not be described in detail here.
[0138] The present application provides a device for acquiring test data, the device for acquiring test data comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method for acquiring test data in the above-mentioned embodiment one.
[0139] Reference below Fig. 9 , which shows a schematic diagram of the structure of a device for acquiring test data suitable for implementing the embodiment of the present application. The device for acquiring test data in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Fig. 9The device for acquiring test data shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0140] like Fig. 9 As shown, the device for acquiring test data may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the device for acquiring test data are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the device for acquiring test data to communicate wirelessly or wired with other devices to exchange data. Although the figure shows a device for acquiring test data with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have alternatively.
[0141] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0142] The device for acquiring test data provided by the present application adopts the method for acquiring test data in the above embodiment, which can solve the technical problems of high labor cost for acquiring test data and low efficiency for acquiring test data in the related art. Compared with the prior art, the beneficial effects of the device for acquiring test data provided by the present application are the same as the beneficial effects of the method for acquiring test data provided by the above embodiment, and other technical features in the device for acquiring test data are the same as the features disclosed in the method of the previous embodiment, which will not be described in detail here.
[0143] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0144] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0145] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the method for acquiring test data in the above-mentioned embodiment.
[0146] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.
[0147] The computer-readable storage medium may be included in the device for acquiring test data; or may exist independently without being assembled into the device for acquiring test data.
[0148] The computer-readable storage medium carries one or more programs. When the one or more programs are executed by a device for acquiring test data, the device for acquiring test data: determines multiple number-generating components based on a target business scenario, the number-generating components correspond to business processes in the target business scenario, and the number-generating components are used to generate business data required by the corresponding business processes; displays multiple number-generating components in an interface; combines multiple number-generating components through the interface to obtain a target number-generating component corresponding to the target business scenario; and generates test data corresponding to the target business scenario through the target number-generating component.
[0149] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0150] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0151] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0152] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned method for obtaining test data, and can solve the technical problems of high labor costs for obtaining test data and low efficiency for obtaining test data in the related art. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the method for obtaining test data provided by the above-mentioned embodiment, and will not be repeated here.
[0153] The present application also provides a computer program product, including a computer program, which implements the steps of the method for acquiring test data as described above when executed by a processor.
[0154] The computer program product provided by the present application can solve the technical problems of high labor cost and low efficiency of obtaining test data in the related art. Compared with the prior art, the beneficial effects of the computer program product provided by the present application are the same as the beneficial effects of the method for obtaining test data provided by the above embodiment, and will not be described in detail here.
[0155] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A method for obtaining test data, characterized in that: The method comprises: Determine a plurality of number-generating components based on a target business scenario, wherein the number-generating components correspond to business processes in the target business scenario, and the number-generating components are used to generate business data required by the corresponding business processes; Displaying the multiple number-generating components in the interface; Combining the multiple number-generating components through the interface to obtain a target number-generating component corresponding to the target business scenario; The test data corresponding to the target business scenario is generated through the target number generation component.
2. The method according to claim 1, characterized in that The number-generating component includes a graphic node, a connection line corresponding to at least one input parameter, and a connection line corresponding to at least one output parameter; The combining the multiple number-generating components through the interface to obtain a target number-generating component corresponding to the target business scenario includes: Based on the output parameters and the connection lines corresponding to the output parameters, the multiple number-generating components are spliced according to the business processes corresponding to the multiple number-generating components to obtain the target number-generating component.
3. The method according to claim 2, characterized in that After the target number-generating component is obtained by splicing the plurality of number-generating components based on the output parameters and the connection lines corresponding to the output parameters and according to the business processes corresponding to the plurality of number-generating components, the method further includes: Through the interface, the input parameters of the target number generation component are selected from the input parameters of the multiple number generation components, and the output parameters of the target number generation component are selected from the output parameters of the multiple number generation components.
4. The method according to claim 2, characterized in that Before determining a plurality of number-generating components based on the target business scenario, the method further includes: Obtain a number-generating script, wherein the number-generating script is used to generate business data required by a corresponding business process; Through the interface, a graphical number-generating component corresponding to the number-generating script is constructed, and the number-generating component includes the graphical node, a connecting line corresponding to at least one input parameter of the number-generating script, and a connecting line corresponding to at least one output parameter of the number-generating script.
5. The method according to claim 1, characterized in that The determining of multiple number-generating components based on the target business scenario includes: Acquire a component search term input based on the target business scenario, where the component search term is used to describe a business process included in the target business scenario; Based on the component search term, a number-making component library is searched to obtain a plurality of number-making components associated with the component search term.
6. The method according to claim 5, characterized in that After combining the multiple number-generating components through the interface to obtain a target number-generating component corresponding to the target business scenario, the method further includes: Determine a label corresponding to the target number-generating component, where the label is used to describe the business process corresponding to the target number-generating component; The target number-generating component is stored in the number-generating component library as a new number-generating component in association with the corresponding label.
7. The method according to claim 1, characterized in that After the target data generation component generates the test data corresponding to the target business scenario, the method further includes: Determine a scenario tag of the test data, where the scenario tag is used to describe a test scenario to which the test data is applied; The test data is associated with the corresponding scene tags and stored in a test database.
8. The method according to claim 7, characterized in that After the test data is associated with the corresponding scene tags and stored in the test database, the method further includes: Acquire a test data search term, where the test data search term is used to describe a test scenario of required target test data; The test database is searched based on the test data search term to obtain the target test data associated with the test scenario.
9. A device for acquiring test data, characterized in that: The device comprises: A component determination module, used to determine a plurality of number-generating components based on a target business scenario, wherein the number-generating components correspond to business processes in the target business scenario, and the number-generating components are used to generate business data required by the corresponding business processes; A component display module, used to display the multiple number-generating components in an interface; A component combination module, used to combine the multiple number-generating components through the interface to obtain a target number-generating component corresponding to the target business scenario; The data generation module is used to generate test data corresponding to the target business scenario through the target number generation component.
10. A device for acquiring test data, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the method for acquiring test data according to any one of claims 1 to 8.
11. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the method for acquiring test data according to any one of claims 1 to 8 are implemented.
12. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the method for acquiring test data according to any one of claims 1 to 8 are implemented.