Test case preparation method, device, computer equipment and storage medium

By using a business label -based test task card during the preparation of the test case, the test case is generated, and the problem of time consuming the test data preparation in the existing technology is solved, and the effect of improving the production efficiency of the test case is achieved.

CN112527654BActive Publication Date: 2025-01-24KANG JIAN INFORMATION TECH (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011489616.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-16
Publication Date
2025-01-24
Estimated Expiration
2040-12-16

AI Technical Summary

Technical Problem

The prior art consumes a lot of time and cost in the data preparation process of test data, especially when single-item data construction is complex, and the test data needs to be reconstructed when the occasionally occurring problems are reproduced.

Method used

By obtaining the query message sent by the terminal, find the test task card corresponding to the business label in the inquiry message. The card is based on the preset data preparation script generation, feedback card information to the terminal, and set information and parameter settings information generating information based on the card feedback card. Test case.

Benefits of technology

This method can save a lot of time in data preparation and data construction during test case preparation, and improve the efficiency of test case generation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112527654B_ABST
    Figure CN112527654B_ABST
Patent Text Reader

Abstract

The present application relates to the field of testing tools for R&D management, and specifically to a test case preparation method, device, computer equipment and storage medium. The method obtains a query message sent by a terminal; searches for a test task card corresponding to a service tag in the query message; feeds back the card information of the test task card to the terminal; obtains the card selection information and parameter setting information fed back by the terminal based on the card information, and generates a test case based on the card selection information and parameter setting information. In the process of generating a test case, the present application displays a preset data preparation script for generating a test case to the user of the terminal in the form of a test task card according to the service tag requested by the terminal, and then generates a corresponding test case based on the card selection information and parameter setting information fed back by the terminal, which can save a lot of time for data preparation and data construction in the process of preparing the test case, and improve the efficiency of generating the test case.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a test case preparation method, apparatus, computer equipment and storage medium. Background Art

[0002] With the development of computer technology and software technology, test case generation technology is also constantly updated. Scope determination in the test case generation process is an important part of the test case generation field, and it is different for different project characteristics. In the process of test case generation, test cases are generally used to complete the test. Test cases refer to the description of the test task for a specific software product, reflecting the test plan, method, technology and strategy. Test cases are generally divided into three parts: data preparation, execution, and assertion.

[0003] However, in the process of preparing test data in the prior art, it is necessary to build a corresponding use case generation script according to the current test situation. When the single data construction is complex, it takes a lot of man-hours to create a large amount of data; and when the data is one-time test data and a problem occurs (such as the recurrence of occasional problems) and the test data needs to be rebuilt, it needs to be done again. Therefore, the entire test data preparation process takes a lot of time and cost, affecting the efficiency of the test. Summary of the invention

[0004] Based on this, it is necessary to provide a test case preparation method, device, computer equipment and storage medium that can improve test efficiency in response to the above technical problems.

[0005] A test case preparation method, the method comprising:

[0006] Get the query message sent by the terminal;

[0007] Searching for a test task card corresponding to the service tag in the query message, wherein the test task card is generated based on a preset data preparation script;

[0008] Feedback the card information of the test task card to the terminal;

[0009] The card selection information and parameter setting information fed back by the terminal according to the card information are obtained, and a test case is generated according to the card selection information and the parameter setting information.

[0010] In one embodiment, the step of searching for a test task card corresponding to a service tag in the query message, before the test task card is generated based on a preset data preparation script, further includes:

[0011] Get the data preparation script;

[0012] Adding a business tag to the data preparation script;

[0013] Generate test task cards based on the data preparation script after adding business tags.

[0014] In one embodiment, generating a test task card according to the data preparation script after adding the business tag includes:

[0015] Packaging the data preparation script into a JAR file;

[0016] Obtain the script method and script parameters in the JAR file through binary parsing;

[0017] The blank space of the test task card is set according to the script method and the script parameters, index information is added to the test task card based on the task tag, and the test task card is generated.

[0018] In one embodiment, after generating a test task card according to the data preparation script after adding the business tag, the method further includes:

[0019] Get card update information;

[0020] Modify the data preparation script corresponding to the test task card according to the card update message.

[0021] In one embodiment, the card selection information includes card sequence information;

[0022] The acquiring terminal generates a test case based on the card selection information and parameter setting information fed back by the card information, and the generating terminal generates a test case based on the card selection information and parameter setting information, including:

[0023] Acquire card sequence information and parameter setting information of the test task card fed back by the terminal according to the card information;

[0024] Generate a test case according to the card sequence information and the parameter setting information.

[0025] In one of the embodiments, the parameter setting information includes a parameter list;

[0026] Generating a test case according to the card selection information and parameter setting information includes:

[0027] Determine the test task card according to the card selection information;

[0028] Fill the parameters in the parameter list into the test task card in sequence to generate test cases in batches.

[0029] A test case preparation device, the device comprising:

[0030] A message acquisition module, used to acquire the query message sent by the terminal;

[0031] A card search module, used to search for a test task card corresponding to a service tag in the query message, wherein the test task card is generated based on a preset data preparation script;

[0032] An information feedback module, used for feeding back the card information of the test task card to the terminal;

[0033] The test case generation module is used to obtain the card selection information and parameter setting information fed back by the terminal according to the card information, and generate a test case according to the card selection information and parameter setting information.

[0034] In one of the embodiments, a card generation module is also included, which is used to: obtain a data preparation script; add a business tag to the data preparation script; and generate a test task card according to the data preparation script after adding the business tag.

[0035] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0036] Get the query message sent by the terminal;

[0037] Searching for a test task card corresponding to the service tag in the query message, wherein the test task card is generated based on a preset data preparation script;

[0038] Feedback the card information of the test task card to the terminal;

[0039] The card selection information and parameter setting information fed back by the terminal according to the card information are obtained, and a test case is generated according to the card selection information and the parameter setting information.

[0040] A computer storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:

[0041] Get the query message sent by the terminal;

[0042] Searching for a test task card corresponding to the service tag in the query message, wherein the test task card is generated based on a preset data preparation script;

[0043] Feedback the card information of the test task card to the terminal;

[0044] The card selection information and parameter setting information fed back by the terminal according to the card information are obtained, and a test case is generated according to the card selection information and the parameter setting information.

[0045] The above-mentioned test case preparation method, device, computer equipment and storage medium obtain the query message sent by the terminal; search for the test task card corresponding to the business tag in the query message, and the test task card is generated based on the preset data preparation script; feedback the card information of the test task card to the terminal; obtain the card selection information and parameter setting information fed back by the terminal based on the card information, and generate a test case based on the card selection information and parameter setting information. In the process of generating test cases, the present application displays the preset data preparation script for generating test cases to the user of the terminal in the form of a test task card according to the business tag requested by the terminal, and then generates the corresponding test case based on the card selection information and parameter setting information fed back by the terminal, which can save a lot of time for data preparation and data construction in the process of test case preparation and improve the efficiency of test case generation. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] Figure 1 An application scenario diagram of a test case preparation method in an embodiment;

[0047] Figure 2 A flowchart of a method for preparing a test case in an embodiment;

[0048] Figure 3 A schematic diagram of a flow chart of steps for generating a test task card in an embodiment;

[0049] Figure 4 A schematic diagram of a flow chart of steps for generating a test task card in another embodiment;

[0050] Figure 5 A structural block diagram of a test case preparation device in an embodiment;

[0051] Figure 6 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0052] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0053] The test case preparation method provided in this application can be applied to Figure 1In the application environment shown. Among them, the terminal 102 communicates with the use case generation server 104 through the network. When the user needs to quickly generate a test case through the terminal 102, the corresponding query message can be sent to the server according to the type of test case required. The use case generation server 104 obtains the query message sent by the terminal 102; searches for the test task card corresponding to the business tag in the query message, and the test task card is generated based on the preset data preparation script; feeds back the card information of the test task card to the terminal 102; obtains the card selection information and parameter setting information fed back by the terminal 102 according to the card information, and generates a test case according to the card selection information and parameter setting information. Among them, the terminal 102 can be but is not limited to various personal computers, laptops, smart phones, tablet computers and portable wearable devices, and the use case generation server 104 can be implemented with an independent server or a server cluster composed of multiple servers.

[0054] In one embodiment, Figure 2 As shown, a test case preparation method is provided, which is applied to Figure 1 The use case generation server 104 in the example is used as an example to illustrate, including the following steps:

[0055] Step 201: Acquire a query message sent by a terminal.

[0056] Step 203, searching for a test task card corresponding to the business tag in the query message, where the test task card is generated based on a preset data preparation script.

[0057] Among them, the query message refers to the message used to query the test task card, and the query message specifically includes the business tag of the test task card to be queried. The business tag can be set according to the specific business environment of the test case and the content of the test case. The test task card refers to the process of data preparation in the test case preparation process being abstracted into a card, and the parameter setting part thereof is left blank to perform specific parameter settings for the test case. The test case generation process is generally divided into three parts: data preparation, execution, and assertion; the data preparation process is very important for case generation, and it takes a lot of time to prepare. For executing a case, the data preparation process takes about 50% of the time cost. The preset data preparation script refers to a script used to construct test preparation data, and the data preparation script can construct uncontaminated, real, and credible data. For example, in one embodiment, the preset data preparation script is used to construct the prepared data related to the free doctor assistant, and the business tag corresponding to the corresponding test task card can also include data tags such as "free doctor assistant", "business APP" and "basic business".

[0058] Specifically. In the scheme of the present application, the process of data preparation in the test case preparation process can be specifically simplified to a test task card, through which a preset data preparation script can be called, and the preparation data for the test case can be generated by the preset data preparation script, and at the same time, a business tag is added to the index information of the test task card, and the corresponding test task card can be indexed and found based on the business tag. By continuously obtaining and saving the test task card, a data bank corresponding to the test preparation data can be formed. When a test case needs to be generated, the terminal 102 where the user is located can search for the corresponding test task card according to the keywords of the current test content, and obtain the corresponding test preparation data by calling the script through the test task card. The test task card contains a number of parameters left blank, and also contains parameter descriptions. The user can directly obtain the corresponding test preparation data by filling in the parameters, and further construct the corresponding test case according to the test preparation data.

[0059] Step 205: Feedback the card information of the test task card to the terminal.

[0060] Step 207: Obtain card selection information and parameter setting information fed back by the terminal based on the card information, and generate a test case based on the card selection information and parameter setting information.

[0061] Among them, the card information refers to a card list fed back according to the business tag. A business tag often corresponds to multiple different test task cards. When the user queries the test task card, the use case generation server can feed back the card information of all the corresponding test task cards in the form of a list to the terminal 102 according to the business tag input by the user. The card selection information refers to the user's selection information of the test task card in the fed-back card information. It is used to determine the test task card that the user wants to use. The parameter setting information refers to the actual parameter information set by the user for the parameters to be filled in the test task card. The actual parameter information can be filled in the test task card, and the data preparation process in the test case preparation process is completed through the preset data preparation script, and the corresponding test case is generated, and then the purpose of application testing is achieved through execution and assertion and other processing.

[0062] Specifically, after the test case server determines the test task card that the user wants to query, it can feed back the corresponding card information of all test task cards related to the query content in the form of a list to the terminal, and then the user of the terminal can select the required test task card according to the fed-back card list and card information, thereby generating corresponding card selection information in the terminal 102. At the same time, after selecting the test task card, the user can also set the parameters left blank in the test task card, thereby generating corresponding parameter setting information in the terminal 102. Then the generated card selection information and parameter setting information are fed back to the case generation server 104, and the case generation server calls the corresponding preset data preparation script through the test task card corresponding to the card selection information, and generates a test case according to the test case parameters set by the user through the parameter setting information.

[0063] The above-mentioned test case preparation method obtains the query message sent by the terminal; searches for the test task card corresponding to the business tag in the query message, and the test task card is generated based on the preset data preparation script; feeds back the card information of the test task card to the terminal; obtains the card selection information and parameter setting information fed back by the terminal based on the card information, and generates a test case based on the card selection information and parameter setting information. In the process of generating test cases, the present application displays the preset data preparation script for generating test cases to the user of the terminal in the form of a test task card according to the business tag requested by the terminal, and then generates the corresponding test case based on the card selection information and parameter setting information fed back by the terminal, which can save a lot of time for data preparation and data construction in the process of preparing test cases, and improve the efficiency of generating test cases.

[0064] In one embodiment, Figure 3 As shown, before step 203, the following steps are also included:

[0065] Step 302, obtaining a data preparation script.

[0066] Step 304, adding a business tag to the data preparation script;

[0067] Step 306, generating a test task card according to the data preparation script after adding the business tag.

[0068] The data preparation script refers to a script used to construct test preparation data, and the data preparation script can construct uncontaminated, real, and reliable data. In other embodiments, the data preparation script can also be replaced by SQL to construct test preparation data. The business tag is used to find the data preparation script, and the business tag can be set according to the content of the data preparation script and the technical field used.

[0069] Specifically, the data preparation process for test case preparation can be simplified into the form of a card, through which the data preparation script can be called, and the preparation data for the test case can be generated through the data preparation script, and the corresponding business tag will also be added to the index information of the test task card, and then the corresponding test task card can be indexed and found based on the business tag. In this embodiment, the corresponding test task card is generated through the data preparation script, and a data bank is formed by continuously accumulating test task cards, thereby facilitating the test case generation process.

[0070] In one embodiment, if Figure 4 As shown, step 306 includes:

[0071] Step 401, package the data preparation script into a JAR file.

[0072] Step 403: Obtain the script method and script parameters in the JAR file through binary parsing.

[0073] Step 405, setting the blank space of the test task card according to the script method and script parameters, adding index information to the test task card based on the task tag, and generating the test task card.

[0074] Among them, the JAR file (Java Archive, English: Java Archive) is a software package file format, which is usually used to aggregate a large number of Java class files, related metadata and resource (text, pictures, etc.) files into one file to develop Java platform application software or libraries.

[0075] Specifically, the data preparation script can be packaged into a JAR file, and the script method and script parameters in the JAR file can be obtained through binary parsing, and the blank space of the test task card can be set according to these script methods and script parameters. At the same time, index information is added to the test task card based on the task label. At the same time, corresponding descriptive information can be added to the test task card, and these descriptive information are obtained based on the script method and script parameters in the JAR file. In this embodiment, by packaging the data preparation script into a JAR file and performing binary parsing to extract the methods and parameters in the script, and then by setting the blank space, the corresponding test task card can be effectively generated, and the generation efficiency of the test task card is improved.

[0076] In one embodiment, after step 306, the method further includes: obtaining a card update message; and modifying a data preparation script corresponding to the test task card according to the card update message.

[0077] Among them, the card update message is used to update the data of the generated test task card.

[0078] Specifically, after the test task card is generated, since the specific test task is constantly updated, the staff of the use case generation server 104 can import the corresponding card update message to the use case generation server 104 after the business is updated. To complete the synchronous update of the data preparation script, the update process can also modify the parameters and remarks in the test task card corresponding to the data preparation script. In this embodiment, the update of the corresponding test task card is completed through the card update message, which can ensure that the test task card can be effectively used.

[0079] In one embodiment, the card selection information includes card sequence information; step 207 includes: obtaining the card sequence information and parameter setting information of the test task card fed back by the terminal according to the card information; generating a test case according to the card sequence information and the parameter setting information.

[0080] There may be multiple test task cards selected by the user terminal 102, and a complete test case is formed by combining multiple test task cards. At this time, the user also needs to set the corresponding order in the card selection information, and set independent parameters for each test task card.

[0081] Specifically, the use case generation server 104 can obtain the order selection information and parameter setting information for multiple test task cards, and then generate a test case according to the multiple sequential test task cards and the parameter settings of each card. Specifically, for a test case simulating the behavior of a user purchasing a commodity, the tester first needs to prepare a user (user center system) and prepare sufficient funds for the user's account (payment center), and then needs to prepare several commodities (commodity center system), which need to be on the shelf and have sufficient inventory, and finally the user purchases the commodity. By using the solution of the present application, only the test of each business team needs to first complete the development of the data bank card function, such as the user center writes a method for creating a new user according to the data bank interface definition requirements, and builds a card on the card management platform of the test case server. The tester who verifies the transaction process only needs to find the corresponding cards such as creating users, user recharge, commodity creation and commodity on the shelf in the card management platform, enter a few necessary parameters to complete the data preparation, and then log in to the APP to verify the order process, and the efficiency of the entire data preparation process is greatly improved. In this embodiment, by combining multiple cards to complete the generation of corresponding test cases, the test case preparation efficiency of multi-stage test tasks can be effectively guaranteed.

[0082] In one embodiment, the parameter setting information includes a parameter list; step 207 includes: determining a test task card according to the card selection information; filling the parameters in the parameter list into the test task card in sequence, and generating test cases in batches.

[0083] Specifically, the user can batch generate test cases corresponding to a test task card by setting a parameter list. In this case, a test task card corresponds to multiple parameters in the parameter setting information. The case generation server 104 can determine the test task card according to the card selection information; fill the parameters in the parameter list into the test task card in turn, and generate test cases in batches. In one embodiment, the user terminal 102 can define a List <Map<String,Object> >This list collection variable is used to store the setting parameters required to build a single card, and then use the address of the web site where the card is located to splice the card parameter list, and finally use the corresponding data to complete the automated test data preparation. In this embodiment, by setting the parameter list to batch generate test cases, the generation efficiency of test cases can be effectively improved.

[0084] It should be understood that although Figure 2-4 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 2-4 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.

[0085] In one embodiment, Figure 5 As shown, a test case preparation device is provided, comprising:

[0086] The message acquisition module 502 is used to acquire the query message sent by the terminal.

[0087] The card search module 504 is used to search for the test task card corresponding to the business tag in the query message, and the test task card is generated based on a preset data preparation script.

[0088] The information feedback module 506 is used to feed back the card information of the test task card to the terminal.

[0089] The test case generation module 508 is used to obtain the card selection information and parameter setting information fed back by the terminal according to the card information, and generate a test case according to the card selection information and the parameter setting information.

[0090] In one of the embodiments, a card generation module is also included, which is used to: obtain a data preparation script; add a business tag to the data preparation script; and generate a test task card according to the data preparation script after adding the business tag.

[0091] In one of the embodiments, the card generation module is specifically used to: package the data preparation script into a JAR file; obtain the script method and script parameters in the JAR file through binary parsing; set the blank space of the test task card according to the script method and script parameters, add index information to the test task card based on the task tag, and generate the test task card.

[0092] In one of the embodiments, a card update module is further included, which is used to: obtain a card update message; and modify a data preparation script corresponding to a test task card according to the card update message.

[0093] In one embodiment, the card selection information includes card sequence information; the use case generation module 508 is specifically used to: obtain the card sequence information and parameter setting information of the test task card fed back by the terminal based on the card information; and generate a test case based on the card sequence information and parameter setting information.

[0094] In one embodiment, the parameter setting information includes a parameter list, and the use case generation module 508 is specifically used to: determine the test task card according to the card selection information; fill the parameters in the parameter list into the test task card in sequence, and generate test cases in batches.

[0095] For the specific definition of the test case preparation device, please refer to the definition of the test case preparation method above, which will not be repeated here. Each module in the above-mentioned test case preparation device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0096] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 6As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store test case preparation data. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a test case preparation method is implemented.

[0097] Those skilled in the art will understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0098] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0099] Get the query message sent by the terminal;

[0100] Find the test task card corresponding to the business tag in the query message. The test task card is generated based on the preset data preparation script;

[0101] Feedback the card information of the test task card to the terminal;

[0102] Obtain the card selection information and parameter setting information fed back by the terminal based on the card information, and generate a test case based on the card selection information and the parameter setting information.

[0103] In one embodiment, when the processor executes the computer program, the following steps are also implemented: obtaining a data preparation script; adding a business tag to the data preparation script; and generating a test task card according to the data preparation script after adding the business tag.

[0104] In one embodiment, when the processor executes the computer program, the following steps are also implemented: packaging the data preparation script into a JAR file; obtaining the script method and script parameters in the JAR file through binary parsing; setting the blank space of the test task card according to the script method and script parameters, adding index information to the test task card based on the task label, and generating the test task card.

[0105] In one embodiment, when the processor executes the computer program, the following steps are also implemented: obtaining a card update message; and modifying a data preparation script corresponding to the test task card according to the card update message.

[0106] In one embodiment, when the processor executes the computer program, the following steps are also implemented: obtaining card sequence information and parameter setting information of the test task card fed back by the terminal according to the card information; generating a test case according to the card sequence information and the parameter setting information.

[0107] In one embodiment, when the processor executes the computer program, the following steps are also implemented: determining the test task card according to the card selection information; filling the parameters in the parameter list into the test task card in sequence, and generating test cases in batches.

[0108] In one embodiment, a computer storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0109] Get the query message sent by the terminal;

[0110] Find the test task card corresponding to the business tag in the query message. The test task card is generated based on the preset data preparation script;

[0111] Feedback the card information of the test task card to the terminal;

[0112] Obtain the card selection information and parameter setting information fed back by the terminal based on the card information, and generate a test case based on the card selection information and the parameter setting information.

[0113] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: obtaining a data preparation script; adding a business tag to the data preparation script; and generating a test task card according to the data preparation script after adding the business tag.

[0114] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: packaging the data preparation script into a JAR file; obtaining the script method and script parameters in the JAR file through binary parsing; setting the blank space of the test task card according to the script method and script parameters, adding index information to the test task card based on the task tag, and generating the test task card.

[0115] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: obtaining a card update message; and modifying a data preparation script corresponding to the test task card according to the card update message.

[0116] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: obtaining card sequence information and parameter setting information of the test task card fed back by the terminal based on the card information; generating a test case based on the card sequence information and parameter setting information.

[0117] In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: determining the test task card according to the card selection information; filling the parameters in the parameter list into the test task card in sequence, and generating test cases in batches.

[0118] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in the present application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0119] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0120] The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A test case preparation method, the method comprising: Obtaining a data preparation script, wherein the data preparation script is used to construct test preparation data for the test case; Adding a business tag to the data preparation script; Generate a test task card according to the data preparation script after adding business tags, wherein the test task card is used to abstract the data preparation process in the test case preparation process into a card, and leave the parameter setting part thereof blank to perform specific parameter setting of the test case; Get the query message for the test task card sent by the terminal; Find the test task card corresponding to the business tag in the query message; Feedback the card information of the test task card to the terminal, wherein the card information is a card list of the test task card fed back according to the service tag in the query message; Acquire card selection information and parameter setting information fed back by the terminal according to the card information, wherein the card selection information is selection information of the test task card in the card information by the user of the terminal; Generate a test case based on the card selection information and parameter setting information.

2. The method according to claim 1, characterized in that Generating a test task card according to the data preparation script after adding the business tag includes: Packaging the data preparation script into a JAR file; Obtain the script method and script parameters in the JAR file through binary parsing; The blank space of the test task card is set according to the script method and the script parameters, index information is added to the test task card based on the task tag, and the test task card is generated.

3. The method according to claim 1, characterized in that After generating the test task card according to the data preparation script after adding the business tag, it also includes: Get card update information; Modify the data preparation script corresponding to the test task card according to the card update message.

4. The method according to claim 1, characterized in that: The card selection information includes card sequence information; The obtaining of the card selection information and parameter setting information fed back by the terminal according to the card information, and generating a test case according to the card selection information and parameter setting information comprises: Acquire card sequence information and parameter setting information of the test task card fed back by the terminal according to the card information; Generate a test case according to the card sequence information and the parameter setting information.

5. The method according to claim 1, characterized in that The parameter setting information includes a parameter list; Generating a test case according to the card selection information and parameter setting information includes: Determine the test task card according to the card selection information; Fill the parameters in the parameter list into the test task card in sequence to generate test cases in batches.

6. A test case preparation device, characterized in that: The device comprises: A card generation module is used to obtain a data preparation script, which is used to construct test preparation data for a test case; add a business tag to the data preparation script; generate a test task card according to the data preparation script after adding the business tag, and the test task card is used to abstract the data preparation process in the test case preparation process into a card, and leave the parameter setting part blank to perform specific parameter settings for the test case; A message acquisition module is used to acquire the query message for the test task card sent by the terminal; A card search module, used to search for a test task card corresponding to a service tag in the query message; An information feedback module, used for feeding back card information of the test task card to the terminal, wherein the card information is a card list of the test task card fed back according to the service tag in the query message; A use case generation module is used to obtain the card selection information and parameter setting information fed back by the terminal based on the card information, and generate a test case based on the card selection information and parameter setting information. The card selection information is the selection information of the test task card in the card information by the user of the terminal.

7. The device according to claim 6, characterized in that The card generation module is specifically used to: package the data preparation script into a JAR file; obtain the script method and script parameters in the JAR file through binary parsing; set the blank space of the test task card according to the script method and the script parameters, add index information to the test task card based on the task tag, and generate a test task card.

8. The device according to claim 6, characterized in that It also includes a card update module, which is used to: obtain a card update message; and modify the data preparation script corresponding to the test task card according to the card update message.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.

10. A computer storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Generation method and device for test data of bank application

    CN107894953A

  • Test data construction method and device, equipment and storage medium

    CN109726105A