A test data generation method, device, equipment and readable storage medium
By modifying database parameter values for financial projects through interface operations and database interfaces, test data can be generated, solving the problem of low testing efficiency in financial projects and achieving efficient multi-scenario testing and parameter feedback.
Patent Information
- Application Number
- CN202111544532.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-16
- Publication Date
- 2025-11-28
- Estimated Expiration
- 2041-12-16
AI Technical Summary
In the testing process of financial projects, testing efficiency is low, and issues such as incorrect parameter changes and forgotten cache clearing are quite common.
By responding to the user's selection of a target business tag on the interface, the corresponding parameter type tag interface is displayed, database parameter values are obtained and modified, test data is generated, and the creation of new business tags and interfaces is supported, as well as calling database interfaces and displaying modification results.
It improves testing efficiency without considering parameter relationships or writing code, supports multi-scenario testing, and provides parameter modification feedback and integration test file generation.
Smart Images

Figure CN114138673B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of information sending, and more particularly to a test data generation method and device, equipment and a readable storage medium. BACKGROUND
[0002] Testing is an indispensable part of the entire research and development process. A research and development project cannot be put into use without testing. Even when it is finally in a state dominated by maintenance after rapid iteration, testing is still indispensable. Introducing testing at a reasonable time and in a reasonable way can effectively reduce the cost of manual maintenance.
[0003] Among them, for research and development projects related to finance, a large amount of code needs to be written to modify parameters during testing. When writing code to modify parameters, there may be complex relationships between parameters, making it difficult to use code to write data and prone to parameter change errors and forgetting when cleaning up caches. As a result, the efficiency of the testing process of the financial project is not high.
[0004] Based on the above situation, there is an urgent need for a test data generation method to solve the problem of low test efficiency in the testing process of the financial project in the prior art. SUMMARY
[0005] Therefore, the present application provides a test data generation method, device, equipment and readable storage medium to solve the problem of low test efficiency in the testing process of the financial project in the prior art.
[0006] In order to achieve the above purpose, the present scheme is as follows:
[0007] A test data generation method comprises:
[0008] In response to the user's operation of selecting a target business tag corresponding to a financial scenario on a first interface, a second interface corresponding to the target business tag is displayed, the first interface comprising a business tag corresponding to each financial scenario, and the second interface comprising a parameter type tag corresponding to the target business;
[0009] In response to the user's operation of writing a target parameter value corresponding to each parameter type tag in the second interface, the target parameter value of each type parameter corresponding to the target business is obtained;
[0010] The values of each type parameter in the database are modified to the target parameter value;
[0011] According to the parameter values of each type parameter in the modified database, test data is generated.
[0012] Optionally, the generating the test data according to the parameter values of the parameters of each type in the modified database comprises:
[0013] The test data is generated according to the parameter values of the parameters of each type in the modified database.
[0014] Optionally, before the responding to the operation of selecting the target business label corresponding to the financial scenario by the user on the first interface, the method further comprises:
[0015] The new business label is created on the first interface in response to the operation of adding the new business label corresponding to the financial scenario by the user on the first interface.
[0016] A second interface corresponding to the new business label is created, and the second interface comprises a parameter type label corresponding to the new business label.
[0017] Optionally, the modifying the numerical values of the parameters of each type in the database to the target parameter values comprises:
[0018] The database interface is called to modify the numerical values of the parameters of each type in the database to the target parameter values.
[0019] Optionally, after the modifying the numerical values of the parameters of each type in the database to the target parameter values, the method further comprises:
[0020] The parameter modification result information returned by the database is received, and the parameter modification result information is used to indicate whether the parameter modification is successful.
[0021] The parameter modification result information is displayed.
[0022] Optionally, the parameter modification result information comprises a parameter modification success, or a parameter modification failure and a failure reason.
[0023] A test data generation device comprises:
[0024] A display unit is configured to display a second interface corresponding to a target business label in response to an operation of selecting the target business label corresponding to a financial scenario by a user on a first interface, the first interface comprising a business label corresponding to each financial scenario, and the second interface comprising a parameter type label corresponding to the target business.
[0025] A obtaining unit is configured to obtain target parameter values of parameters of each type corresponding to the target business in response to an operation of writing the target parameter values corresponding to each parameter type label by the user on the second interface.
[0026] A modifying unit is configured to modify numerical values of the parameters of each type in a database to the target parameter values.
[0027] The generating unit is configured to generate test data according to the parameter values of the parameters of each type in the modified database.
[0028] Optionally, the generating unit comprises:
[0029] The file generating unit is configured to generate a joint debugging test file according to the parameter values of the parameters of each type in the modified database.
[0030] A test data generation device comprises a memory and a processor.
[0031] The memory is configured to store a program.
[0032] The processor is configured to execute the program to implement each step of the test data generation method.
[0033] A readable storage medium has a computer program stored thereon, and the computer program, when executed by a processor, implements each step of the test data generation method.
[0034] As can be seen from the above technical solution, the test data generation method provided by the embodiments of the present application displays a second interface corresponding to a target business label corresponding to a financial scenario in response to the operation of a user selecting the target business label on a first interface, the first interface comprising a business label corresponding to each financial scenario, and the second interface comprising a parameter type label corresponding to a target business; obtains target parameter values of parameters of each type corresponding to the target business in response to the operation of the user writing target parameter values corresponding to each parameter type label in the second interface, so that the parameter values corresponding to the parameter type labels that need to be modified can be obtained; modifies the values of parameters of each type in the database to the target parameter values; and generates test data according to the parameter values of the parameters of each type in the modified database. In this way, the parameter values corresponding to the test scenario that need to be modified can be modified without considering the complex association relationship between parameters of each type or writing a large amount of code. It can be seen that the present application can solve the problem of low test efficiency in the process of financial project testing. BRIEF DESCRIPTION OF DRAWINGS
[0035] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments or the prior art description will be briefly introduced. Obviously, the drawings in the following description are only embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor on the basis of the provided drawings.
[0036] Figure 1 A test data generation method flowchart disclosed by the present application;
[0037] Figure 2 A first interface schematic diagram is shown as an example of the present application;
[0038] Figure 3 A second interface schematic diagram is shown as an example of the present application;
[0039] Figure 4 A test data generation device structure block diagram disclosed by the present application is shown in FIG. 2;
[0040] Figure 5 A hardware structure block diagram of a test data generation device disclosed by an embodiment of the present application is shown in FIG. 3. DETAILED DESCRIPTION
[0041] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of protection of the present application.
[0042] Next, the test data generation method of the present application will be described in detail, including the following steps: Figure 1
[0043] Step S110, in response to the operation of the user selecting the target business label corresponding to the financial scenario on the first interface, displaying the second interface corresponding to the target business label.
[0044] Specifically, the first interface includes a business label corresponding to each financial scenario.
[0045] For example, as shown in FIG. 1, a first interface schematic diagram is shown as an example of the present application. Figure 2 That is, a first interface schematic diagram is shown as an example of the present application.
[0046] Specifically, the user can divide the area in the first interface according to the needs and specific application scenarios, for example, as shown in FIG. 1, the first interface is divided into two areas, which are “cash” and “cash underlying”. Figure 2
[0047] The user can also write each business label into the corresponding area according to the specific scenario corresponding to each business label, and give each label a serial number. For example, as shown in FIG. 1, each business label is written into the corresponding area according to the specific scenario of each business label, and the same area uses a unified naming method, such as the area where “cash” is located is sorted with F as the beginning, and the area where “cash underlying” is located is sorted with Q as the beginning. Figure 2
[0048] The second interface includes a parameter type label corresponding to the target business.
[0049] For example, as shown in FIG. 1, the second interface 100 can include a parameter type label corresponding to each type of parameter. Figure 3 For example, as shown in FIG. 1, the second interface 100 can include a parameter type label corresponding to each type of parameter.
[0050] The second interface can include a parameter type label corresponding to each type of parameter, for example, as shown in FIG. 1, the parameter type labels are "user id", "bank channel" and "account opening type". Figure 3 The second interface can include a parameter type label corresponding to each type of parameter, for example, as shown in FIG. 1, the parameter type labels are "user id", "bank channel" and "account opening type".
[0051] For example, as shown in FIG. 1, the second interface 100 can include a parameter type label corresponding to each type of parameter. Figure 3 Figure 3 For example, as shown in FIG. 1, the second interface 100 can include a parameter type label corresponding to each type of parameter.
[0052] For example, as shown in FIG. 1, the second interface 100 can include a parameter type label corresponding to each type of parameter.
[0053] For example, as shown in FIG. 1, the second interface 100 can include a parameter type label corresponding to each type of parameter.
[0054] For example, as shown in FIG. 1, the second interface 100 can include a parameter type label corresponding to each type of parameter.
[0055] For example, as shown in FIG. 1, the second interface 100 can include a parameter type label corresponding to each type of parameter. Figure 3 For example, as shown in FIG. 1, the second interface 100 can include a parameter type label corresponding to each type of parameter.
[0056] For example, as shown in FIG. 1, the second interface 100 can include a parameter type label corresponding to each type of parameter.
[0057] For example, as shown in FIG. 1, the second interface 100 can include a parameter type label corresponding to each type of parameter.
[0058] For example, as shown in FIG. 1, the second interface 100 can include a parameter type label corresponding to each type of parameter.
[0059] It can be seen from the technical solution that the test data generation method provided by the embodiment of the application displays a second interface corresponding to the target business label in response to the operation of the user selecting the target business label corresponding to the financial scenario on the first interface. The first interface includes a business label corresponding to each financial scenario, and the second interface includes a parameter type label corresponding to the target business. In response to the operation of the user writing a target parameter value corresponding to each parameter type label in the second interface, the target parameter value of each type parameter corresponding to the target business is obtained. In this way, the parameter value corresponding to each type parameter label that needs to be modified can be obtained. The values of each type parameter in the database are modified to the target parameter value. The test data is generated according to the parameter values of each type parameter in the modified database. In this way, the parameter values corresponding to the test scenario that need to be modified can be modified without considering the complex association relationship between each type parameter or writing a large amount of code. It can be seen that the application can solve the problem of low test efficiency in the financial project test process.
[0060] In some embodiments of the application, it is considered that the first interface may not include a target business label corresponding to the financial scenario required by the user, and there is no second interface corresponding to the target business label. Therefore, it is necessary to add a business label corresponding to the financial scenario on the first interface and establish a second interface corresponding to the business label. Based on this, before step S110, in response to the operation of the user selecting the target business label corresponding to the financial scenario on the first interface, displaying the second interface corresponding to the target business label, the following steps can also be included:
[0061] S10, in response to the operation of the user adding a new business label corresponding to the financial scenario on the first interface, creating the new business label on the first interface.
[0062] Specifically, the user can add a new business label corresponding to the financial scenario on the first interface according to the need, and the application can create the new business label on the first interface in response to the operation of the user adding the business label.
[0063] In addition, the new business label can be written into a region corresponding to the first interface according to a specific financial scenario, and the new business label can be sorted according to the original sorting manner in the region.
[0064] S11, creating a second interface corresponding to the new business label, the second interface including a parameter type label corresponding to the new business label.
[0065] Specifically, after the new business label is created on the first interface, a second interface corresponding to the new business label can be created, so that the user can jump to the corresponding second interface after selecting the new business label on the first interface.
[0066] In the corresponding second interface, a parameter type label corresponding to the new business label can be included, and a prompt corresponding to the parameter type label can also be included to help the user write a parameter value corresponding to each parameter type label.
[0067] As can be seen from the above technical solution, compared with the previous embodiment, the embodiment adds a process of adding a new business label and a second interface corresponding thereto. Specifically, the new business label is created on the first interface according to the user's demand, and the second interface corresponding thereto is established. As can be seen, through the above steps, the new business label and the second interface corresponding thereto can be added according to the user's demand. In this way, different test data can be generated for different financial scenarios, so that the financial business in different financial scenarios can be better tested.
[0068] In some embodiments of the present application, the process of modifying the values of various types of parameters in the database to the target parameter values in step S130 is described in detail as follows:
[0069] S20, calling a database interface to modify the values of various types of parameters in the database to the target parameter values.
[0070] Wherein, various types of parameters can not exist in the same database, and the database interface can connect multiple databases corresponding to various types of parameters.
[0071] Specifically, considering that the values of various types of parameters in the database need to be modified to the target parameter values, multiple databases may need to be called, that is, the values in multiple databases need to be modified. At this time, a database interface can be called to modify the values of various types of parameters in the database to the target parameter values.
[0072] Wherein, the parameter value written by the user can be spliced with the public parameter corresponding to the financial scenario, and the interface is called to modify the values of various types of parameters in the database to the target parameter values.
[0073] As can be seen from the above technical solution, compared with the previous embodiment, the embodiment adds a process of calling a database interface to modify the values of various types of parameters in the database to the target parameter values. As can be seen, through the above steps, the data in multiple databases can be modified, so that test data can be better generated, and therefore, different financial scenarios can be better tested.
[0074] In some embodiments of the present application, after the values of the parameters of different types in the database are modified to the target parameter values, the user can not know whether the process is performed or not, and the result of the process, if there is no feedback information. Therefore, after the values of the parameters of different types in the database are modified to the target parameter values in step S130, the following step can be further performed in some embodiments of the present application:
[0075] S30, receiving the parameter modification result information returned by the database, the parameter modification result information being used to indicate whether the parameter modification is successful.
[0076] Specifically, after the values of the parameters of different types in the database are modified to the target parameter values, the database can return the parameter modification result information.
[0077] In this way, the parameter modification result information returned by the database can be received.
[0078] The parameter modification result information can be feedback information, used to indicate whether the parameter modification is successful.
[0079] S31, displaying the parameter modification result information.
[0080] Specifically, the parameter modification result information can be displayed on the third interface, so as to help the user to know the modification result of the values of the parameters of different types in the database.
[0081] As can be seen from the above technical solution, compared with the previous embodiment, the present embodiment provides a process of displaying feedback information for the user, and the specific manner is to receive and display the parameter modification result information returned by the database, the parameter modification result information being used to indicate whether the parameter modification is successful. It can be seen that the user can be provided with feedback information by the above steps, so as to help the user to know the execution process and the execution result of the present application. In this way, the financial business of different financial scenarios can be better tested.
[0082] Further, in some embodiments of the present application, the parameter modification result information includes parameter modification success, or parameter modification failure and the failure reason.
[0083] As can be seen from the above technical solution, compared with the previous embodiment, the present embodiment increases the content that the parameter modification result information can include, i.e., the parameter modification result information includes parameter modification success, or parameter modification failure and the failure reason. It can be seen that the user can clearly know the modification result through the parameter modification result information, and if the modification fails, the user can also know the failure reason. The modification is corrected through the failure reason, so that the values of the parameters of different types in the database are successfully modified to the target parameter values. Therefore, the financial business of different financial scenarios can be better tested.
[0084] In some embodiments of this application, the process of generating test data based on the parameter values of various types of parameters in the modified database is described in detail, and the steps are as follows:
[0085] S40. Generate a joint debugging test file based on the parameter values of each type of parameter in the modified database.
[0086] Specifically, the generated test data may be used for integration testing. Therefore, integration testing files can be generated based on the parameter values of each type of parameter in the modified database for integration testing.
[0087] The joint debugging test file may contain parameter values of various types of parameters corresponding to multiple business tags. Therefore, the parameter values of various types of parameters in the database corresponding to multiple business tags in the first interface can be modified, and then the joint debugging test file corresponding to the multiple business tags can be generated.
[0088] As can be seen from the above technical solution, compared to the previous embodiment, this embodiment adds a process of generating joint debugging test files. Specifically, the joint debugging test files are generated based on the parameter values of each type of parameter in the modified database. Therefore, this process allows the acquisition of joint debugging test files for joint debugging testing. Based on this, the joint debugging test results can comprehensively consider the parameter values of each parameter type corresponding to multiple financial scenarios, thereby enabling better testing of financial businesses in different financial scenarios.
[0089] The following will combine Figure 4 The test data generation apparatus provided in the embodiments of this application will be described below. The test data generation apparatus described below can be referred to in correspondence with the test data generation method described above.
[0090] like Figure 4 As shown, the test data generation device may include:
[0091] The display unit 100 is used to respond to the user's operation of selecting a target business tag corresponding to a financial scenario on a first interface and display a second interface corresponding to the target business tag. The first interface includes a business tag corresponding to each financial scenario, and the second interface includes a parameter type tag corresponding to the target business.
[0092] The acquisition unit 110 is used to respond to the user's operation of writing the target parameter value corresponding to each parameter type label in the second interface, and to acquire the target parameter value of each type of parameter corresponding to the target business.
[0093] Modification unit 120 is used to modify the values of various types of parameters in the database to the target parameter values;
[0094] The generating unit 130 is configured to generate test data according to the parameter values of the parameters of each type in the modified database.
[0095] Further, the generating unit can include:
[0096] The file generating unit is configured to generate a joint debugging test file according to the parameter values of the parameters of each type in the modified database.
[0097] Further, the test data generating apparatus can further include:
[0098] The first interface creating unit is configured to create the new business label on the first interface in response to an operation of adding the new business label corresponding to the financial scenario by a user on the first interface.
[0099] The second interface creating unit is configured to create a second interface corresponding to the new business label, and the second interface includes a parameter type label corresponding to the new business label.
[0100] Further, the modifying unit can include:
[0101] The interface calling unit is configured to call a database interface to modify the values of the parameters of each type in the database to the target parameter values.
[0102] Further, the test data generating apparatus can further include:
[0103] The result information receiving unit is configured to receive parameter modification result information returned by the database, and the parameter modification result information is used to indicate whether the parameter modification is successful.
[0104] The result information displaying unit is configured to display the parameter modification result information.
[0105] The test data generating apparatus provided by the embodiments of the present application can be applied to a test data generating device, such as a computer device, a terminal device, etc. Figure 5 FIG. 1 shows a hardware structure block diagram of the test data generation, and refer to Figure 5 The hardware structure of the test data generating device can include at least one processor 1, at least one communication interface 2, at least one memory 3 and at least one communication bus 4; and the processor 1, the communication interface 2 and the memory 3 can communicate with each other through the communication bus 4.
[0106] The processor 1 can be a central processing unit CPU, or a specific integrated circuit ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of the present application, etc.
[0107] The memory 3 can comprise a high-speed RAM memory and can also comprise a non-volatile memory such as at least one disk memory;
[0108] The memory stores a program, and the processor can invoke the program stored in the memory, and the program is used for:
[0109] In response to an operation of a user selecting a target business label corresponding to a financial scenario on a first interface, a second interface corresponding to the target business label is displayed, the first interface comprising a business label corresponding to each financial scenario, and the second interface comprising a parameter type label corresponding to a target business;
[0110] In response to an operation of the user writing a target parameter value corresponding to each parameter type label in the second interface, a target parameter value of each type parameter corresponding to the target business is acquired;
[0111] The numerical values of each type parameter in the database are modified to the target parameter value;
[0112] Test data is generated according to the parameter values of each type parameter in the modified database.
[0113] The embodiments of the present application also provide a readable storage medium, which can store a program suitable for processor execution, and the program is used for:
[0114] In response to an operation of a user selecting a target business label corresponding to a financial scenario on a first interface, a second interface corresponding to the target business label is displayed, the first interface comprising a business label corresponding to each financial scenario, and the second interface comprising a parameter type label corresponding to a target business;
[0115] In response to an operation of the user writing a target parameter value corresponding to each parameter type label in the second interface, a target parameter value of each type parameter corresponding to the target business is acquired;
[0116] The numerical values of each type parameter in the database are modified to the target parameter value;
[0117] Test data is generated according to the parameter values of each type parameter in the modified database.
[0118] Optionally, the refinement function and the extension function of the program can refer to the description above.
[0119] Finally, it should be noted that the terms "first", "second", and the like, herein do not denote any order, quantity, combination, or otherwise, but are used to identify one entity from another, and do not imply any actual relationship or sequence among entities. Also, the use of the term "including", "containing" or any other variation thereof is intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements is not necessarily limited to those elements, but can include other elements not expressly listed or inherent to such process, method, article, or apparatus.
[0120] The various embodiments in the specification are described with progression in this order of description. Embodiments of each order of description can be combined with embodiments of the other orders of description.
[0121] The above description of disclosed embodiments is intended to enable those skilled in the art to apply the application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and generic principles defined herein can be applied to other embodiments without departing from the spirit or scope of the application. The various embodiments of the application can be combined with each other. Thus, the application will not be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed in the specification.
Claims
1. A test data generation method, characterized by, The method comprises the following steps: In response to an operation of a user selecting a target business label corresponding to a financial scenario on a first interface, a second interface corresponding to the target business label is displayed, the first interface comprises a business label corresponding to each financial scenario, and the second interface comprises a parameter type label corresponding to a target business and a prompt corresponding to each parameter type label; In response to an operation of the user writing a target parameter value corresponding to each parameter type label in the second interface according to the prompts, target parameter values of each type of parameter corresponding to the target business are obtained; The values of each type of parameter in a database are modified to the target parameter values; A joint debugging test file is generated according to the parameter values of each type of parameter in the modified database, and the joint debugging test file comprises parameter values of each type of parameter corresponding to a plurality of business labels.
2. The method of claim 1, wherein, Before the operation of the user selecting the target business label corresponding to the financial scenario on the first interface, the method further comprises the following steps: In response to an operation of the user adding a new business label corresponding to the financial scenario on the first interface, the new business label is created on the first interface; A second interface corresponding to the new business label is created, and the second interface comprises a parameter type label corresponding to the new business label.
3. The method according to claim 1 or 2, characterized in that, The step of modifying the values of each type of parameter in the database to the target parameter values comprises the following steps: A database interface is called to modify the values of each type of parameter in the database to the target parameter values.
4. The method according to claim 1 or 2, characterized in that, After the values of each type of parameter in the database are modified to the target parameter values, the method further comprises the following steps: Parameter modification result information returned by the database is received, and the parameter modification result information is used to indicate whether the parameter modification is successful; The parameter modification result information is displayed.
5. The method of claim 4, wherein, The parameter modification result information comprises parameter modification success, parameter modification failure and a failure reason.
6. A test data generation apparatus characterized by comprising: The method comprises the following steps: A display unit is configured to display, in response to an operation of a user selecting a target business label corresponding to a financial scenario on a first interface, a second interface corresponding to the target business label, the first interface comprises a business label corresponding to each financial scenario, and the second interface comprises a parameter type label corresponding to a target business and a prompt corresponding to each parameter type label; An acquisition unit is configured to, in response to an operation of the user writing a target parameter value corresponding to each parameter type label in the second interface according to the prompts, acquire target parameter values of each type of parameter corresponding to the target business; A modification unit is configured to modify values of each type of parameter in a database to the target parameter values; A file generation unit is configured to generate a joint debugging test file according to parameter values of each type of parameter in the modified database, and the joint debugging test file comprises parameter values of each type of parameter corresponding to a plurality of business labels.
7. A test data generation device, characterized by, The method comprises a memory and a processor; The memory is configured to store a program; The processor is configured to execute the program to implement each step of the test data generation method according to any one of claims 1-5.
8. A readable storage medium, having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement each step of the test data generation method according to any one of claims 1-5.
Citation Information
Patent Citations
Test case generation method and device and server
CN109933535A
Joint debugging test method, device and equipment of system and computer readable storage medium
CN109977012A
Test case management method and device and electronic equipment
CN111881037A
Interface test method and device, equipment and storage medium
CN112363949A
Automated testing of an application system
US20150339213A1