Test case generation method and device, computer equipment and readable storage medium
By automatically generating test case files and using preset configuration information to process test case information, the problem of missing test scenarios and repeated writing is solved, and the efficiency and accuracy of software test case generation are improved.
Patent Information
- Application Number
- CN202410729087.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-05
- Publication Date
- 2024-08-30
AI Technical Summary
In the process of generating software test cases, it is easy to omit test scenarios, and there are duplicate content in the title, preparation steps and expected results of the use cases, resulting in heavy workload and low efficiency.
By obtaining the use case information carried in the use case file generation request, reading the target variable type and factor value, using the preset configuration information to process and generate test points, the test case file is automatically generated, reducing manual writing and repetitive work.
It effectively avoids missing test scenarios, improves the efficiency and accuracy of test case generation, and reduces the workload of writing use cases.
Smart Images

Figure CN118567991A
Abstract
Description
Technical Field
[0001] The present application relates to the field of financial technology, and in particular to a test case generation method, apparatus, computer equipment and readable storage medium. Background Art
[0002] With the rapid development of data processing technology, banking institutions have higher and higher requirements for software complexity and information security. Test cases refer to the description of the test task for a specific software product, reflecting the test plan, method, technology and strategy. Its content includes test objectives, test environment, input data, test steps, expected results, test scripts, etc., and finally forms a document, such as bank payment test cases and bank transfer test cases. Simply put, a test case is a set of test inputs, execution conditions and expected results compiled for a special purpose, used to verify whether a specific software requirement is met.
[0003] In the related art, testers tend to use their own personal testing experience to design test cases at work. However, the applicant realizes that this design method is divorced from the systematic and scientific test case design concept, and some test scenarios may be omitted due to subjective reasons. In the actual software test case generation process, test scenarios may be omitted, and there may be some repeated content writing work in the title, preparation steps and expected results of the test cases. The generation of test cases involves a lot of workload, which not only causes a waste of manpower and material resources, but also the test case generation efficiency is low. Summary of the invention
[0004] In view of this, the present application provides a test case generation method, apparatus, computer equipment and readable storage medium, the main purpose of which is to solve the problem that in the actual software test case generation process, test scenarios are missed, and there is some repetitive content writing work in the title, preparation steps and expected results of the test case. The generation of test cases involves a lot of workload, which not only causes a waste of manpower and material resources, but also the problem of low efficiency in test case generation.
[0005] According to the first aspect of the present application, a method for generating a test case is provided, the method comprising:
[0006] In response to a use case file generation request, obtaining use case information carried in the use case file generation request;
[0007] Reading multiple target variable types in the use case information, and reading the target variable factor value corresponding to each target variable type in the use case information, to obtain multiple target variable factor values;
[0008] Acquire preset configuration information, and process the multiple target variable factor values according to the type attribute information corresponding to each target variable type in the preset configuration information and the factor attribute information corresponding to each target variable factor value in the preset configuration information to generate multiple target test points;
[0009] The multiple target test points and the use case information are sorted to generate a test case file.
[0010] Optionally, before obtaining the use case information carried in the use case file generation request in response to the use case file generation request, the method further includes:
[0011] In response to a use case information creation request, obtaining at least one use case name input by a user based on a terminal held by the user and an expected result of the use case corresponding to each use case name, wherein each use case name includes at least one test number;
[0012] Reading the variable selection information marked with each of the test numbers, and generating a corresponding test step for each of the test numbers according to the variable selection information marked with each of the test numbers, wherein the variable selection information is used to indicate whether there is a variable in the test step to be generated for the test number;
[0013] Arrange the at least one use case name, the expected result of each use case name, the at least one test number corresponding to each use case name, the test steps corresponding to each test number, and the variable selection information corresponding to each test number to generate the use case information;
[0014] When it is detected that the user confirms the use case information based on the terminal held by the user, it is determined that the use case file generation request carrying the use case information is received.
[0015] Optionally, the reading of the variable selection information marked with each of the test numbers, and generating a corresponding test step for each of the test numbers according to the variable selection information marked with each of the test numbers, includes:
[0016] For each of the test numbers, identifying variable selection information corresponding to the test number;
[0017] If it is determined that the variable selection information indicates that the test step does not have a variable, obtaining first text information input by the user for the test number based on the terminal held by the user, and using the first text information as the test step corresponding to the test number;
[0018] If it is identified that the variable selection information indicates that there are variables in the test step, the target variable type selected by the user based on the terminal held is determined among the multiple target variable types, the variable factor input type uploaded by the user based on the terminal held is obtained, the target variable factor value is determined using the variable factor input type, and the target variable type and the target variable factor value are sorted to generate a test step corresponding to the test number.
[0019] Optionally, determining the target variable factor value by using the variable factor input type includes:
[0020] Performing format detection on the variable factor input type to determine the input format indicated by the variable factor input type;
[0021] When the input format is no input format, reading at least one variable factor value corresponding to the target variable type in the preset configuration information, sending the at least one variable factor value to the terminal held by the user, and obtaining the variable factor value selected by the user from the at least one variable factor value based on the terminal held as the target variable factor value;
[0022] When the input format is a double text input format, obtaining the variable factor field name and the variable factor field value fed back by the user based on the terminal held by the user, and using the variable factor field name and the variable factor field value as the target variable factor value;
[0023] When the input format is a Boolean value input format, at least one variable factor value corresponding to the target variable type is read from the preset configuration information, the at least one variable factor value is sent to the terminal held by the user, and the variable factor value selected by the user from the at least one variable factor value based on the terminal held is obtained as the designated variable factor value, the target Boolean value corresponding to the designated variable factor value fed back by the user based on the terminal held is obtained, and the designated variable factor value and the target Boolean value are used as the target variable factor value;
[0024] When the input format is a text input format, second text information fed back by the user based on the terminal held by the user is obtained, and the second text information is used as the target variable factor value.
[0025] Optionally, the processing of the multiple target variable factor values according to the type attribute information corresponding to each target variable type in the preset configuration information and the factor attribute information corresponding to each target variable factor value in the preset configuration information to generate multiple target test points includes:
[0026] Determine a target test scenario corresponding to each target variable type according to type attribute information corresponding to each target variable type in the preset configuration information, wherein the type attribute information is used to indicate that the target variable type includes a recommended type scenario or an optional type scenario;
[0027] According to the factor attribute information corresponding to each of the target variable factor values in the preset configuration information and the target test scenario corresponding to each of the target variable types, the multiple target variable factor values are processed to generate the multiple target test points, and the factor attribute information is used to indicate whether the target variable factor value participates in the scenario generation.
[0028] Optionally, determining a target test scenario corresponding to each target variable type according to type attribute information corresponding to each target variable type in the preset configuration information includes:
[0029] For each of the target variable types, identifying type attribute information corresponding to the target variable type;
[0030] If it is determined that the type attribute information indicates that the target variable type includes a recommended type scenario, then reading a recommended test point corresponding to the target variable type in the preset configuration information, and using the recommended test point as a target test scenario corresponding to the target variable type;
[0031] If it is identified that the type attribute information indicates that the target variable type includes optional type scenarios, multiple optional type scenarios corresponding to the target variable type are read in the preset configuration information, the multiple optional type scenarios are sent to the terminal held by the user, and the target type scenario selected by the user from the multiple optional type scenarios based on the terminal held is determined, and the target type scenario is used as the target test scenario corresponding to the target variable type.
[0032] Optionally, the processing of the multiple target variable factor values according to the factor attribute information corresponding to each target variable factor value in the preset configuration information and the target test scenario corresponding to each target variable type to generate the multiple target test points includes:
[0033] Extracting at least one target factor attribute information from the multiple factor attribute information, determining a target test scenario corresponding to each target factor attribute information based on a target variable type corresponding to each target factor attribute information, and generating a first test point corresponding to each target factor attribute information by using a target variable factor value corresponding to each target factor attribute information and a target test scenario corresponding to each target factor attribute information, to obtain at least one first test point, wherein the target factor attribute information indicates that the target variable factor value participates in scenario generation;
[0034] Extracting at least one designated factor attribute information from the plurality of factor attribute information, determining a target test scenario corresponding to each designated factor attribute information based on a target variable type corresponding to each designated factor attribute information, and generating a second test point corresponding to each designated factor attribute information using the target test scenario corresponding to each designated factor attribute information to obtain at least one second test point, wherein the designated factor attribute information indicates that the target variable factor value does not participate in scenario generation;
[0035] The at least one first test point and the at least one second test point are used as the plurality of target test points.
[0036] According to a second aspect of the present application, a test case generation device is provided, the device comprising:
[0037] An acquisition module, configured to, in response to a use case file generation request, acquire the use case information carried in the use case file generation request;
[0038] A reading module, used for reading a plurality of target variable types in the use case information, and reading a target variable factor value corresponding to each target variable type in the use case information, to obtain a plurality of target variable factor values;
[0039] a processing module, configured to obtain preset configuration information, and process the multiple target variable factor values according to type attribute information corresponding to each target variable type in the preset configuration information and factor attribute information corresponding to each target variable factor value in the preset configuration information to generate multiple target test points;
[0040] The sorting module is used to sort the multiple target test points and the use case information to generate a test case file.
[0041] Optionally, the processing module is used to determine the target test scenario corresponding to each target variable type according to the type attribute information corresponding to each target variable type in the preset configuration information, and the type attribute information is used to indicate that the target variable type includes a recommended type scenario or an optional type scenario; according to the factor attribute information corresponding to each target variable factor value in the preset configuration information and the target test scenario corresponding to each target variable type, the multiple target variable factor values are processed to generate the multiple target test points, and the factor attribute information is used to indicate whether the target variable factor value participates in the scenario generation.
[0042] Optionally, the processing module is used to identify, for each of the target variable types, type attribute information corresponding to the target variable type; if it is determined that the type attribute information indicates that the target variable type includes a recommended type scenario, then read the recommended test point corresponding to the target variable type in the preset configuration information, and use the recommended test point as the target test scenario corresponding to the target variable type; if it is determined that the type attribute information indicates that the target variable type includes an optional type scenario, then read multiple optional type scenarios corresponding to the target variable type in the preset configuration information, send the multiple optional type scenarios to a terminal held by a user, determine the target type scenario selected by the user from the multiple optional type scenarios based on the terminal held, and use the target type scenario as the target test scenario corresponding to the target variable type.
[0043] Optionally, the processing module is used to extract at least one target factor attribute information from the multiple factor attribute information, determine the target test scenario corresponding to each target factor attribute information based on the target variable type corresponding to each target factor attribute information, and generate a first test point corresponding to each target factor attribute information using the target variable factor value corresponding to each target factor attribute information and the target test scenario corresponding to each target factor attribute information, so as to obtain at least one first test point, wherein the target factor attribute information indicates that the target variable factor value participates in scenario generation; extract at least one designated factor attribute information from the multiple factor attribute information, determine the target test scenario corresponding to each designated factor attribute information based on the target variable type corresponding to each designated factor attribute information, and generate a second test point corresponding to each designated factor attribute information using the target test scenario corresponding to each designated factor attribute information, so as to obtain at least one second test point, wherein the designated factor attribute information indicates that the target variable factor value does not participate in scenario generation; and use the at least one first test point and the at least one second test point as the multiple target test points.
[0044] Optionally, the device further comprises:
[0045] A creation module, used to respond to a use case information creation request, obtain at least one use case name input by a user based on a held terminal, and an expected result of the use case corresponding to each of the use case names, wherein each of the use case names includes at least one test number; read variable selection information marked with each of the test numbers, and generate a corresponding test step for each of the test numbers according to the variable selection information marked with each of the test numbers, wherein the variable selection information is used to indicate whether there are variables in the test steps to be generated for the test number; organize the at least one use case name, the expected result of the use case corresponding to each of the use case names, the at least one test number corresponding to each of the use case names, the test steps corresponding to each of the test numbers, and the variable selection information corresponding to each of the test numbers to generate the use case information; and determine that the use case file generation request carrying the use case information is received when it is detected that the user confirms the use case information based on the held terminal.
[0046] Optionally, the creation module is used to identify, for each of the test numbers, variable selection information corresponding to the test number; if it is determined that the variable selection information indicates that the test step does not have a variable, obtain the first text information input by the user for the test number based on the terminal held, and use the first text information as the test step corresponding to the test number; if it is determined that the variable selection information indicates that the test step does have a variable, determine the target variable type selected by the user based on the terminal held from among the multiple target variable types, obtain the variable factor input type uploaded by the user based on the terminal held, use the variable factor input type to determine the target variable factor value, and organize the target variable type and the target variable factor value to generate the test step corresponding to the test number.
[0047] Optionally, the creation module is further used to perform format detection on the variable factor input type to determine the input format indicated by the variable factor input type; when the input format is no input format, read at least one variable factor value corresponding to the target variable type in the preset configuration information, send the at least one variable factor value to the terminal held by the user, and obtain the variable factor value selected by the user from the at least one variable factor value based on the terminal held as the target variable factor value; when the input format is a double text input format, obtain the variable factor field name and variable factor field value fed back by the user based on the terminal held, and use the variable factor field name and the variable factor field value as the target variable factor value; when the input format is a Boolean input format, at least one variable factor value corresponding to the target variable type is read in the preset configuration information, the at least one variable factor value is sent to the terminal held by the user, and the variable factor value selected by the user based on the at least one variable factor value held by the terminal is obtained as the designated variable factor value, the target Boolean value corresponding to the designated variable factor value fed back by the user based on the terminal held is obtained, and the designated variable factor value and the target Boolean value are used as the target variable factor value; when the input format is a text input format, the second text information fed back by the user based on the terminal held is obtained, and the second text information is used as the target variable factor value.
[0048] According to a third aspect of the present application, a computer device is provided, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of any one of the methods described in the first aspect when executing the computer program.
[0049] According to a fourth aspect of the present application, a readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of any one of the methods described in the first aspect are implemented.
[0050] By means of the above technical scheme, the present application provides a method, device, computer equipment and readable storage medium for generating a test case. The present application responds to a use case file generation request, obtains the use case information carried by the use case file generation request, reads multiple target variable types in the use case information, and reads the target variable factor value corresponding to each target variable type in the use case information to obtain multiple target variable factor values, obtains preset configuration information, processes the multiple target variable factor values according to the type attribute information corresponding to each target variable type in the preset configuration information and the factor attribute information corresponding to each target variable factor value in the preset configuration information, generates multiple target test points, processes the multiple target test points and use case information, generates a test case file, processes the variable types and variable factor values in the use case information through the preset configuration information, generates recommended test points, and then automatically generates the use case file using the test points, which can not only avoid omission of test scenarios by using the computer's exhaustive ability, but also reduce the workload of test case writing and improve the efficiency of test case generation.
[0051] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present application. Also, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:
[0053] Figure 1 A schematic diagram of a test case generation method provided in an embodiment of the present application is shown;
[0054] Figure 2A A schematic diagram of a test case generation method provided in an embodiment of the present application is shown;
[0055] Figure 2B A schematic diagram of the architecture of preset configuration information provided by an embodiment of the present application is shown;
[0056] Figure 2C A schematic diagram showing a type of attribute information and factor attribute information provided by an embodiment of the present application;
[0057] Figure 2D A schematic diagram of generating use case information provided by an embodiment of the present application is shown;
[0058] Figure 2E A schematic diagram of a use case file provided in an embodiment of the present application is shown;
[0059] Figure 3A A schematic diagram showing a structure of a method for generating a test case provided in an embodiment of the present application is shown;
[0060] Figure 3B A schematic diagram showing a structure of a method for generating a test case provided in an embodiment of the present application is shown;
[0061] Figure 4 A schematic diagram of the device structure of a computer device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0062] The exemplary embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present application and to fully convey the scope of the present application to those skilled in the art.
[0063] The present application embodiment provides a method for generating a test case, such as Figure 1 As shown, the method includes:
[0064] 101. In response to a use case file generation request, obtain use case information carried in the use case file generation request.
[0065] At present, in the process of writing software test cases, the use case writers tend to use their own personal testing experience to design test cases, and often miss some test scenarios due to subjective reasons. For example, for online bank transfer test cases, the writers may design test scenarios for the same bank transfer and inter-bank transfer, but there are also test scenarios such as over-amount transfer and illegal account transfer. In addition, in the actual use case writing process, there are often some repeated content writing work in the use case title, test preparation steps, expected results, etc., which makes the use case writing work heavy. For example, "1. Enter the receiving account; 2. Enter the transfer amount; 3. Enter the correct payment password", "1. Enter the receiving account; 2. Enter the transfer amount; 3. Enter the wrong payment password", which will not only cause a huge workload for the use case writers, but also affect the efficiency of test case generation.
[0066] To solve this problem, the present application proposes a method for generating a test case. After the user inputs the test case information and clicks a button to request the generation of a test case file, the test case generation system reads multiple variable types and corresponding multiple variable factor values in the test case information, processes it using preset configuration information, and automatically generates multiple recommended test points. The user does not need to write test scenarios and test points by themselves, nor does the user need to perform repeated writing work. In this way, the generation efficiency of the test case can be improved, and the accuracy of the test case generation can be improved. The execution subject of the present application can be a test case generation system, and the test case generation system provides a front-end application to the user, that is, provides a client. The user (such as a case writer) can generate a test case based on the front-end application request, so that the test case generation relies on the computing power of the server to provide services to the user. The server can be an independent server, or it can provide cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content distribution networks (Content Delivery Network, CDN) and servers of basic cloud computing such as big data and artificial intelligence platforms, so that the test case generation system can quickly and efficiently complete the generation operation of the test case.
[0067] In an embodiment of the present application, after the user enters the test information of the online banking transfer and clicks the "use case file generation" button to request the generation of the transfer use case file, the test case generation system will respond to the use case file generation request and obtain the use case information carried by the use case file generation request, that is, the test information of the online banking transfer, so that the test case generation system can use the use case information to quickly generate a use case file.
[0068] 102. Read multiple target variable types in the use case information, and read the target variable factor value corresponding to each target variable type in the use case information to obtain multiple target variable factor values.
[0069] In an embodiment of the present application, the test case generation system reads multiple target variable types in the use case information. Then, the test case generation system reads the target variable factor value corresponding to each target variable type in the use case information to obtain multiple target variable factor values. For example, to test transfer information verification, including 1. Enter the correct receiving account; 2. Enter the correct transfer amount; 3. Information verification, then the test case generation system reads multiple target variable types as text data type, text data type, message queue, and the target variable factor value corresponding to each target variable type is 123456789, 2000, account number 123456789 amount 2000. In this way, the test case generation system can quickly obtain key information in the use case information, and process it to generate a use case file.
[0070] 103. Obtain preset configuration information, and process multiple target variable factor values according to type attribute information corresponding to each target variable type in the preset configuration information and factor attribute information corresponding to each target variable factor value in the preset configuration information to generate multiple target test points.
[0071] In an embodiment of the present application, the test case generation system obtains preset configuration information, which includes attribute information corresponding to the variable type and variable factor value preset by the user, so that the test case generation system can quickly generate recommended test points according to the preset configuration information. Then, the test case generation system processes multiple target variable factor values according to the type attribute information corresponding to each target variable type in the preset configuration information and the factor attribute information corresponding to each target variable factor value in the preset configuration information, and generates multiple target test points. By using the preset configuration information, not only can the omission of test case scenarios be reduced, but also the efficiency of test case generation can be improved.
[0072] 104. Organize multiple target test points and use case information to generate test case files.
[0073] In the embodiment of the present application, the test case generation system organizes multiple target test points and use case information to generate a test case file. In this way, the test case generation system processes the variable type and variable factor value in the use case information through preset configuration information, generates recommended test points, and after arranging multiple target test points and use case information, generates a test case file for user reference, which can not only reduce the omission of test scenarios, but also reduce the workload of test case writing, thereby quickly and accurately generating test cases.
[0074] The method provided in the embodiment of the present application responds to a use case file generation request, obtains use case information carried in the use case file generation request, reads multiple target variable types in the use case information, and reads the target variable factor value corresponding to each target variable type in the use case information to obtain multiple target variable factor values, obtains preset configuration information, processes the multiple target variable factor values according to the type attribute information corresponding to each target variable type in the preset configuration information and the factor attribute information corresponding to each target variable factor value in the preset configuration information, generates multiple target test points, processes the multiple target test points and use case information, generates a test case file, processes the variable types and variable factor values in the use case information through the preset configuration information, generates recommended test points, and then automatically generates the use case file using the test points, which can not only avoid omission of test scenarios by using the computer's exhaustive ability, but also reduce the workload of test case writing and improve the efficiency of test case generation.
[0075] Further, as a refinement and extension of the specific implementation of the above embodiment, in order to fully illustrate the specific implementation process of this embodiment, the embodiment of the present application provides another method for generating test cases, such as Figure 2A As shown, the method includes:
[0076] 201. In response to a use case file generation request, obtain use case information carried in the use case file generation request.
[0077] The writing of existing test cases mostly depends on the professional level and experience of the case writers, resulting in incomplete test scenarios and large differences in test points. Moreover, most traditional test cases are written by manual input, and the data input process is repetitive and time-consuming, prone to input errors, and even unable to generate complete test cases. In addition, software such as online bank transfer systems and bank financial management systems need to be designed and adjusted in a diversified manner to meet the needs of different consumers. However, this is also a problem for traditional test cases.
[0078] Therefore, in order to improve the efficiency of test case generation, the present application proposes a test case generation method. The test case generation system is provided with preset configuration information. The following describes a preset configuration information:
[0079] like Figure 2B As shown, the preset configuration information includes at least one variable information, and the user can add, delete and modify the variable information through the system. Among them, the variable information includes variable type, type attribute information, recommended test points, at least one variable factor value, and factor attribute information of each variable factor value. The variable type can be OPS (Open Pluggable Specification, a computing module plug-in format) configuration, scheduling, interface, amount, text, database value, message queue, etc., which are displayed to the user through a drop-down box display for user selection, and each variable type can set multiple variable factor values, making the test points of the test case richer and more comprehensive.
[0080] For example, for OPS configuration, you can set the variable factor value to value 1, value 2, value 3, etc.; for interface, you can set the variable factor value to key interface parameter 1, key interface parameter 2, key interface parameter 3, etc.; for amount, you can set the variable factor value to unit, precision, currency, etc.; for text, you can set the variable factor value to value 1, value 2, value 3, etc.; for database value, you can set the variable factor value to table name + field name; for message queue, you can set the variable factor value to message name + message body. In this way, users can select the pre-set variable type and variable factor value, and the test case generation system can quickly generate test case files. Users can also supplement variable types and variable factor values at any time to enrich test scenarios. Recommended test points are variable configurations set in advance. For example, test scenarios such as transfer information verification and transfer password verification all require checking the input data format. Then you can set a recommended test point for the OPS variable type, that is, to check the scenarios of configuration omissions and configuration format errors. Therefore, when the test case generation system generates the test case file, it will directly read this recommended checkpoint to improve the test case generation rate.
[0081] Furthermore, a type of attribute information and factor attribute information included in the preset configuration information are described:
[0082] like Figure 2C As shown, the type attribute information includes variable type, variable type name, whether to provide type business name for user filling, whether to include optional type scenarios, whether to include recommended type scenarios, type recommendation output, etc. The factor attribute information includes associated factors, variable name, variable factor value, whether the variable attribute type is a user-selected scenario type or a system-recommended scenario type, variable input type, whether to participate in scenario generation, factor scenario recommendation output, etc. By setting the type attribute information and factor attribute information, the test case generation system can quickly generate test points, which not only reduces the workload and time consumption of case writers, but also makes the generated test cases more complete and accurate.
[0083] In this way, through the above-mentioned preset configuration information, the user can quickly and conveniently input and select test-related information, and then the test case generation system can quickly and accurately generate a test case file based on the test-related information, without the need for manual input by the user, thereby improving the accuracy of the test case. In an embodiment of the present application, in response to a use case file generation request, the test case generation system obtains the use case information carried by the use case file generation request.
[0084] In an optional implementation scheme, in response to a use case information creation request, the test case generation system obtains at least one use case name input by the user based on the terminal held, and the use case expected result corresponding to each use case name, wherein each use case name includes at least one test number. For example, the user enters two use case names, one is a payment account verification use case, and the expected result is that the account format is correct, and the other is a transfer password verification use case, and the expected result is that the password format is correct. Then, the test case generation system reads the variable selection information marked by each test number, and generates corresponding test steps for each test number according to the variable selection information marked by each test number. For example, the transfer information verification use case has 3 steps, namely, inputting the payment account, inputting the transfer amount, and account format verification, then the payment account verification use case includes 3 test numbers, namely, test number 1, test number 2, and test number 3. And for each test number, there is a single choice for the user to select whether there is a variable. When the user selects no, the test step can be added by definition; when the user selects yes, the user selects the variable type pre-added in the preset configuration information through the drop-down box, and selects the corresponding variable factor value.
[0085] Specifically, for each test number, the test case generation system identifies variable selection information corresponding to the test number, wherein the variable selection information is used to indicate whether there is a variable in the test step to be generated for the test number.
[0086] If the variable selection information indicates that the test step does not have a variable, the test case generation system obtains the first text information input by the user for the test number based on the terminal held, and uses the first text information as the test step corresponding to the test number. For example, the receiving account verification case is to test whether the receiving account is correct. The receiving account should be used as a variable for multiple tests. Then the transfer amount, that is, the test number 2 does not have a variable, and the user enters the transfer amount 2000 as the test step corresponding to the test number 2.
[0087] If the variable selection information is identified and determined to indicate that there are variables in the test step, the test case generation system determines the target variable type selected by the user based on the terminal held by the user from multiple target variable types, and obtains the variable factor input type uploaded by the user based on the terminal held. The test case generation system uses the variable factor input type to determine the target variable factor value, and organizes the target variable type and target variable factor value to generate the test step corresponding to the test number. For example, if the payment account verification use case needs to change the payment account, the user selects the text type in the variable type, and selects one from the multiple preset payment accounts corresponding to the text type as the test step corresponding to the test number 1, avoiding repeated operations when the user manually enters, and improving the test case generation rate.
[0088] Among them, since the formats of variable factor values corresponding to different variable types are different, the test case generation system will determine the target variable factor value according to the attributes of different formats. The specific process of the test case generation system using the variable factor input type to determine the target variable factor value is as follows: the test case generation system performs format detection on the variable factor input type and determines the input format indicated by the variable factor input type.
[0089] When the input format is no input format, the test case generation system reads at least one variable factor value corresponding to the target variable type in the preset configuration information, sends at least one variable factor value to the terminal held by the user, and obtains the variable factor value selected by the user based on the at least one variable factor value held by the terminal as the target variable factor value. For example, if the target variable type is a scheduling type, then the corresponding variable factor value is the type automatically recommended by the system. The test case generation system will read multiple variable factor values corresponding to the scheduling type set in advance in the preset configuration information for the user to choose, including business window 1, business window 2, and special window 3, so the target variable factor value is business window 2.
[0090] When the input format is a double text input format, the target variable type can be an interface, database value, text, etc. The test case generation system obtains the variable factor field name and variable factor field value based on the user's feedback from the terminal held, and uses the variable factor field name and variable factor field value as the target variable factor value. For example, if the target variable type is a text type, and the system detects that the attribute information corresponding to the text type indicates that the text type provides a type business name for the user to fill in, then the user-entered collection account number and 123456789 are obtained, and the target variable factor value is the collection account number: 123456789. For another example, if the target variable type is an interface type, if the corresponding attribute information indicates that a type business name is provided for the user to fill in, then the interface field name and interface field value entered by the user are obtained, and the target variable factor value is the interface field name: interface field value.
[0091] When the input format is the boolean input format, the test case generation system reads at least one variable factor value corresponding to the target variable type from the preset configuration information, sends the at least one variable factor value to the user's terminal, and obtains the variable factor value selected by the user based on the terminal from the at least one variable factor value as the specified variable factor value. The system obtains the target boolean value corresponding to the specified variable factor value fed back by the user based on the terminal, and takes the specified variable factor value and the target boolean value as the target variable factor value. For example, if the target variable type is the amount type, the test case generation system will read the unit, precision, and currency in the preset configuration information for the user to select. After the user selects the unit as the variable factor value, the user still needs to continue to select the boolean value corresponding to this variable factor value to indicate whether this variable factor value participates in test case generation. If the user selects yes, the test case generation system will generate relevant test points for the amount unit; if the user selects no, the test case generation system will not generate relevant test points for the amount unit. Therefore, the target variable factor value can be amount unit: yes.
[0092] When the input format is the text input format, the target variable type can be OPS configuration, message queue. The test case generation system obtains the second text information fed back by the user based on the terminal, and takes the second text information as the target variable factor value. For example, if the target variable type is the message queue, the system obtains that the user inputs the message name as bank account registration and the message body as 123456789Zhang San111111. Therefore, the target variable factor value is bank account registration: 123456789Zhang San111111.
[0093] Subsequently, the test case generation system sorts out at least one use case name, the use case expected result corresponding to each use case name, at least one test number corresponding to each use case name, the test steps corresponding to each test number, and the variable selection information corresponding to each test number to generate use case information. To sum up, the following describes a process for generating use case information:
[0094] Such as Figure 2DAs shown, the user manually enters the test case subject name, that is, case A, and then sets the test case pre-steps according to the actual steps to obtain pre-step 1, pre-step 2, and pre-step 3. For pre-step 1, the user selects no variables and enters the event A; for pre-step 2, the user selects variables, and determines a variable type and a corresponding variable factor value in the preset configuration information through the drop-down box as factor 1; for pre-step 3, the user selects variables, and selects a variable type and a corresponding variable factor value in the preset configuration information through the drop-down box as factor 3. Subsequently, the user enters the expected result of the test case. Since the test case generation system will automatically generate recommended test points based on the variable factor value and the corresponding variable type, but the correlation with the actual business is weak, the expected result entered by the user will be simply copied to each case for the user's reference. Finally, the user clicks the Generate Case File button, and the test case generation system will organize the test case subject name, test case pre-steps, and test case expected results to obtain the case information.
[0095] In this way, after the test case generation system obtains the use case information, when it detects that the user confirms the use case information based on the terminal held, it determines that a use case file generation request carrying the use case information has been received, so that the test case generation system can subsequently quickly determine the recommended test points based on the preset configuration information, thereby generating a use case file.
[0096] 202. Read multiple target variable types in the use case information, and read the target variable factor value corresponding to each target variable type in the use case information to obtain multiple target variable factor values.
[0097] In an embodiment of the present application, the test case generation system reads multiple target variable types in the use case information. For example, the use case name is a transfer information verification use case, and the target variable types are text type, text type, and OPS configuration type. Then, the test case generation system reads the target variable factor value corresponding to each target variable type in the use case information to obtain multiple target variable factor values. For example, the target variable factor values corresponding to text type, text type, and OPS configuration type are 123456789, 2000, and A, respectively.
[0098] 203. Obtain preset configuration information, and determine a target test scenario corresponding to each target variable type according to type attribute information corresponding to each target variable type in the preset configuration information.
[0099] In order to quickly generate the target test point, the test case generation system can set the attribute information of the variable type in advance. Therefore, in an embodiment of the present application, for each target variable type, the test case generation system identifies the type attribute information corresponding to the target variable type, wherein the type attribute information is used to indicate that the target variable type includes a recommended type scenario or an optional type scenario. If the identification determines that the type attribute information indicates that the target variable type includes a recommended type scenario, the test case generation system reads the recommended test point corresponding to the target variable type in the preset configuration information, and uses the recommended test point as the target test scenario corresponding to the target variable type. That is, as long as the user selects and configures the variable type containing the automatic recommended configuration, the test case generation system can automatically generate the target test scenario. If the identification determines that the type attribute information indicates that the target variable type includes an optional type scenario, the test case generation system reads multiple optional type scenarios corresponding to the target variable type in the preset configuration information, sends multiple optional type scenarios to the terminal held by the user, and determines the target type scenario selected by the user based on the terminal held in multiple optional type scenarios, and uses the target type scenario as the target test scenario corresponding to the target variable type. For example, OPS configuration types include multiple optional scenarios such as checking for configuration omissions and checking for illegal configuration content. Users can choose to ensure comprehensive coverage of test scenarios.
[0100] 204. Process multiple target variable factor values according to factor attribute information corresponding to each target variable factor value in the preset configuration information and a target test scenario corresponding to each target variable type to generate multiple target test points.
[0101] In the embodiment of the present application, the target test point is a special checkpoint generated according to each variable factor value and its corresponding variable type, so that the generated test case is more accurate. The test case generation system extracts at least one target factor attribute information from multiple factor attribute information, wherein the factor attribute information is used to indicate whether the target variable factor value participates in the scenario generation, and the target factor attribute information indicates that the target variable factor value participates in the scenario generation. For example, the target variable factor value is 123456789, 2000, and A, and the factor attribute information read in the preset configuration information is participation, non-participation, and participation, respectively, then the target factor attribute information is the factor attribute information corresponding to 123456789 and A. Then, based on the target variable type corresponding to each target factor attribute information, the target test scenario corresponding to each target factor attribute information is determined. Subsequently, the test case generation system generates the first test point corresponding to each target factor attribute information using the target variable factor value corresponding to each target factor attribute information and the target test scenario corresponding to each target factor attribute information, and obtains at least one first test point. For example, for the target variable factor value of 123456789, the generated first test point is the correct collection account.
[0102] Then, the test case generation system extracts at least one designated factor attribute information from the multiple factor attribute information, wherein the designated factor attribute information indicates that the target variable factor value does not participate in the scenario generation, such as the factor attribute information corresponding to the target variable factor value 2000. Based on the target variable type corresponding to each designated factor attribute information, the target test scenario corresponding to each designated factor attribute information is determined. Then, the test case generation system generates a second test point corresponding to each designated factor attribute information using the target test scenario corresponding to each designated factor attribute information, and obtains at least one second test point.
[0103] Finally, the test case generation system uses at least one first test point and at least one second test point as multiple target test points. In this way, by processing each target variable factor value, a corresponding target test point is generated for each test step. For example, when generating a test case for an online bank transfer system, after the user sets the preset configuration information, the test case generation system can generate target test points including functional testing, interface testing, performance testing, security testing, usability testing, compatibility testing, etc., which can provide users with a more comprehensive reference.
[0104] 205. Organize multiple target test points and use case information to generate a test case file.
[0105] In the embodiment of the present application, the test case generation system organizes multiple target test points and case information to generate a test case file. The following describes a case file:
[0106] like Figure 2EAs shown, for test case 1, the use case pre-steps and the corresponding use case expected effects include: 1. Do event A, test case expected effect; 2. Factor 1: value 1 / type 1, recommended checkpoint 1; 3. Factor 2: value 1 / type 1, recommended checkpoint 2; 4. Do event B, recommended checkpoint 3; 5. Factor 3: value 1 / type 1. For test case 2, the use case pre-steps and the corresponding use case expected effects include: 1. Do event A, test case expected effect; 2. Factor 1: value 1 / type 1, recommended checkpoint 1; 3. Factor 2: value 1 / type 1, recommended checkpoint 2; 4. Do event B, recommended checkpoint 3; 5. Factor 3: value 2 / type 2. Similarly, the pre-steps of the test case 3 and the corresponding expected effects of the test case include: 1. Do event A, and the expected effect of the test case; 2. Factor 1: value 1 / type 1, and checkpoint 1 is recommended; 3. Factor 2: value 2 / type 2, and checkpoint 2 is recommended; 4. Do event B, and checkpoint 3 is recommended; 5. Factor 3: value 1 / type 1. Among them, the factors are mainly automatically generated according to the variable factor values and corresponding variable types filled in by the user, such as OPS value A, OPS value B, OPS not configured, OPS configuration content is illegal, etc., and the recommended checkpoints are generated according to the variable factor values and their variable types respectively, such as OPS type, then pay attention to the running results of each value and the configuration degradation verification point. If it is a message queue, then pay attention to data duplication, disorder, loss, etc. It should be noted that the test case generation system synthesizes each variable factor into a combined scenario through the Cartesian product algorithm, because the use of the Cartesian product algorithm can make the test case scenario coverage rate reach 100% based on the variable factor values created by the user. In addition, according to actual business needs, users can selectively exclude some scenarios to make the generated test cases more referenceable.
[0107] The method provided in the embodiment of the present application responds to a use case file generation request, obtains use case information carried in the use case file generation request, reads multiple target variable types in the use case information, and reads the target variable factor value corresponding to each target variable type in the use case information to obtain multiple target variable factor values, obtains preset configuration information, processes the multiple target variable factor values according to the type attribute information corresponding to each target variable type in the preset configuration information and the factor attribute information corresponding to each target variable factor value in the preset configuration information, generates multiple target test points, processes the multiple target test points and use case information, generates a test case file, processes the variable types and variable factor values in the use case information through the preset configuration information, generates recommended test points, and then automatically generates the use case file using the test points, which can not only avoid omission of test scenarios by using the computer's exhaustive ability, but also reduce the workload of test case writing and improve the efficiency of test case generation.
[0108] Further, as Figure 1The specific implementation of the method, the embodiment of the present application provides a test case generation device, such as Figure 3A As shown, the device includes: an acquisition module 301, a reading module 302, a processing module 303 and a sorting module 304.
[0109] The acquisition module 301 is used to respond to a use case file generation request and acquire the use case information carried in the use case file generation request;
[0110] A reading module 302 is used to read multiple target variable types in the use case information, and read the target variable factor value corresponding to each target variable type in the use case information to obtain multiple target variable factor values;
[0111] The processing module 303 is used to obtain preset configuration information, and process the multiple target variable factor values according to the type attribute information corresponding to each target variable type in the preset configuration information and the factor attribute information corresponding to each target variable factor value in the preset configuration information to generate multiple target test points;
[0112] The sorting module 304 is used to sort the multiple target test points and the use case information to generate a test case file.
[0113] In a specific application scenario, the processing module 303 is used to determine the target test scenario corresponding to each target variable type according to the type attribute information corresponding to each target variable type in the preset configuration information, and the type attribute information is used to indicate that the target variable type includes a recommended type scenario or an optional type scenario; according to the factor attribute information corresponding to each target variable factor value in the preset configuration information and the target test scenario corresponding to each target variable type, the multiple target variable factor values are processed to generate the multiple target test points, and the factor attribute information is used to indicate whether the target variable factor value participates in the scenario generation.
[0114] In a specific application scenario, the processing module 303 is used to identify the type attribute information corresponding to the target variable type for each target variable type; if it is determined that the type attribute information indicates that the target variable type includes a recommended type scenario, the recommended test point corresponding to the target variable type is read in the preset configuration information, and the recommended test point is used as the target test scenario corresponding to the target variable type; if it is determined that the type attribute information indicates that the target variable type includes an optional type scenario, multiple optional type scenarios corresponding to the target variable type are read in the preset configuration information, the multiple optional type scenarios are sent to the terminal held by the user, and the target type scenario selected by the user from the multiple optional type scenarios based on the terminal held is determined, and the target type scenario is used as the target test scenario corresponding to the target variable type.
[0115] In a specific application scenario, the processing module 303 is used to extract at least one target factor attribute information from the multiple factor attribute information, determine the target test scenario corresponding to each target factor attribute information based on the target variable type corresponding to each target factor attribute information, and generate a first test point corresponding to each target factor attribute information using the target variable factor value corresponding to each target factor attribute information and the target test scenario corresponding to each target factor attribute information, to obtain at least one first test point, wherein the target factor attribute information indicates that the target variable factor value participates in the scenario generation; extract at least one designated factor attribute information from the multiple factor attribute information, determine the target test scenario corresponding to each designated factor attribute information based on the target variable type corresponding to each designated factor attribute information, and generate a second test point corresponding to each designated factor attribute information using the target test scenario corresponding to each designated factor attribute information, to obtain at least one second test point, wherein the designated factor attribute information indicates that the target variable factor value does not participate in the scenario generation; and use the at least one first test point and the at least one second test point as the multiple target test points.
[0116] In specific application scenarios, such as Figure 3B As shown, the device also includes: a creation module 305.
[0117] A creation module 305 is used to respond to a use case information creation request, obtain at least one use case name input by the user based on the terminal held, and the expected result of the use case corresponding to each of the use case names, wherein each of the use case names includes at least one test number; read the variable selection information marked with each of the test numbers, and generate a corresponding test step for each of the test numbers according to the variable selection information marked with each of the test numbers, wherein the variable selection information is used to indicate whether there are variables in the test steps to be generated for the test number; organize the at least one use case name, the expected result of the use case corresponding to each of the use case names, the at least one test number corresponding to each of the use case names, the test steps corresponding to each of the test numbers, and the variable selection information corresponding to each of the test numbers to generate the use case information; and when it is detected that the user confirms the use case information based on the terminal held, determine that the use case file generation request carrying the use case information is received.
[0118] In a specific application scenario, the creation module 305 is used to identify the variable selection information corresponding to each test number; if it is determined that the variable selection information indicates that the test step does not have a variable, the first text information input by the user for the test number based on the terminal held is obtained, and the first text information is used as the test step corresponding to the test number; if it is determined that the variable selection information indicates that the test step has a variable, the target variable type selected by the user based on the terminal held is determined from the multiple target variable types, the variable factor input type uploaded by the user based on the terminal held is obtained, the target variable factor value is determined using the variable factor input type, and the target variable type and the target variable factor value are sorted to generate the test step corresponding to the test number.
[0119] In a specific application scenario, the creation module 305 is also used to perform format detection on the variable factor input type to determine the input format indicated by the variable factor input type; when the input format is no input format, read at least one variable factor value corresponding to the target variable type in the preset configuration information, send the at least one variable factor value to the terminal held by the user, and obtain the variable factor value selected by the user from the at least one variable factor value based on the terminal held as the target variable factor value; when the input format is a double text input format, obtain the variable factor field name and variable factor field value based on the user's feedback from the terminal held, and use the variable factor field name and the variable factor field value as the target variable factor value. the target variable factor value; when the input format is a Boolean value input format, at least one variable factor value corresponding to the target variable type is read in the preset configuration information, the at least one variable factor value is sent to the terminal held by the user, and the variable factor value selected by the user from the at least one variable factor value based on the terminal held is obtained as the designated variable factor value, the target Boolean value corresponding to the designated variable factor value fed back by the user based on the terminal held is obtained, and the designated variable factor value and the target Boolean value are used as the target variable factor value; when the input format is a text input format, the second text information fed back by the user based on the terminal held is obtained, and the second text information is used as the target variable factor value.
[0120] The device provided in the embodiment of the present application responds to a use case file generation request, obtains the use case information carried by the use case file generation request, reads multiple target variable types in the use case information, and reads the target variable factor value corresponding to each target variable type in the use case information to obtain multiple target variable factor values, obtains preset configuration information, processes the multiple target variable factor values according to the type attribute information corresponding to each target variable type in the preset configuration information and the factor attribute information corresponding to each target variable factor value in the preset configuration information, generates multiple target test points, processes the multiple target test points and use case information, generates a test case file, processes the variable types and variable factor values in the use case information through the preset configuration information, generates recommended test points, and then automatically generates the use case file using the test points, which can not only use the computer's exhaustive ability to avoid missing test scenarios, but also reduce the workload of test case writing and improve the efficiency of test case generation.
[0121] It should be noted that for other corresponding descriptions of the functional units involved in the test case generation device provided in the embodiment of the present application, reference can be made to Figure 1 and FIG. 2A to FIG. 2E The corresponding description in will not be repeated here.
[0122] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0123] 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.
[0124] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be construed as limiting the scope of the present application. It should be noted that, for a person of ordinary skill in the art, several modifications 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 present application shall be subject to the attached claims.
[0125] In an exemplary embodiment, see Figure 4 , and also provides a computer device, which includes a bus, a processor, a memory and a communication interface, and may also include an input and output interface and a display device, wherein each functional unit can communicate with each other through the bus. The memory stores a computer program, and the processor is used to execute the program stored in the memory and execute the test case generation method in the above embodiment.
[0126] A readable storage medium stores a computer program, which implements the steps of the test case generation method when executed by a processor.
[0127] Through the description of the above implementation methods, those skilled in the art can clearly understand that the present application can be implemented by hardware, or by means of software plus a necessary general hardware platform. Based on such an understanding, the technical solution of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.), including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each implementation scenario of the present application.
[0128] Those skilled in the art will appreciate that the accompanying drawings are merely schematic diagrams of a preferred implementation scenario, and the modules or processes in the accompanying drawings are not necessarily required for implementing the present application.
[0129] Those skilled in the art will appreciate that the modules in the device in the implementation scenario can be distributed in the device in the implementation scenario according to the implementation scenario description, or can be changed accordingly and located in one or more devices different from the implementation scenario. The modules in the above implementation scenario can be combined into one module, or can be further split into multiple sub-modules.
[0130] The above application serial numbers are for description only and do not represent the advantages or disadvantages of the implementation scenarios.
[0131] The above disclosure only discloses several specific implementation scenarios of the present application. However, the present application is not limited thereto, and any changes that can be conceived by technicians in this field should fall within the scope of protection of the present application.
Claims
1. A method for generating a test case, characterized in that: include: In response to a use case file generation request, obtaining use case information carried in the use case file generation request; Reading multiple target variable types in the use case information, and reading the target variable factor value corresponding to each target variable type in the use case information, to obtain multiple target variable factor values; Acquire preset configuration information, and process the multiple target variable factor values according to the type attribute information corresponding to each target variable type in the preset configuration information and the factor attribute information corresponding to each target variable factor value in the preset configuration information to generate multiple target test points; The multiple target test points and the use case information are sorted to generate a test case file.
2. The method according to claim 1, characterized in that Before obtaining the use case information carried in the use case file generation request in response to the use case file generation request, the method further includes: In response to a use case information creation request, obtaining at least one use case name input by a user based on a terminal held by the user and an expected result of the use case corresponding to each use case name, wherein each use case name includes at least one test number; Reading the variable selection information marked with each of the test numbers, and generating a corresponding test step for each of the test numbers according to the variable selection information marked with each of the test numbers, wherein the variable selection information is used to indicate whether there is a variable in the test step to be generated for the test number; The at least one use case name, the expected result of each use case name, the at least one test number corresponding to each use case name, the test steps corresponding to each test number, and the variable selection information corresponding to each test number are sorted to generate the use case information; When it is detected that the user confirms the use case information based on the terminal held by the user, it is determined that the use case file generation request carrying the use case information is received.
3. The method according to claim 2, characterized in that The step of reading the variable selection information marked on each test number, and generating a corresponding test step for each test number according to the variable selection information marked on each test number, includes: For each of the test numbers, identifying variable selection information corresponding to the test number; If it is determined that the variable selection information indicates that the test step does not have a variable, obtaining first text information input by the user for the test number based on the terminal held by the user, and using the first text information as the test step corresponding to the test number; If it is identified that the variable selection information indicates that there are variables in the test step, the target variable type selected by the user based on the terminal held is determined among the multiple target variable types, the variable factor input type uploaded by the user based on the terminal held is obtained, the target variable factor value is determined using the variable factor input type, and the target variable type and the target variable factor value are sorted to generate a test step corresponding to the test number.
4. The method according to claim 3, characterized in that The step of determining the target variable factor value by using the variable factor input type includes: Performing format detection on the variable factor input type to determine the input format indicated by the variable factor input type; When the input format is no input format, reading at least one variable factor value corresponding to the target variable type in the preset configuration information, sending the at least one variable factor value to the terminal held by the user, and obtaining the variable factor value selected by the user from the at least one variable factor value based on the terminal held as the target variable factor value; When the input format is a double text input format, obtaining the variable factor field name and the variable factor field value fed back by the user based on the terminal held by the user, and using the variable factor field name and the variable factor field value as the target variable factor value; When the input format is a Boolean value input format, at least one variable factor value corresponding to the target variable type is read from the preset configuration information, the at least one variable factor value is sent to the terminal held by the user, and the variable factor value selected by the user from the at least one variable factor value based on the terminal held is obtained as the designated variable factor value, the target Boolean value corresponding to the designated variable factor value fed back by the user based on the terminal held is obtained, and the designated variable factor value and the target Boolean value are used as the target variable factor value; When the input format is a text input format, second text information fed back by the user based on the terminal held by the user is obtained, and the second text information is used as the target variable factor value.
5. The method according to claim 1, characterized in that The step of processing the multiple target variable factor values according to the type attribute information corresponding to each target variable type in the preset configuration information and the factor attribute information corresponding to each target variable factor value in the preset configuration information to generate multiple target test points includes: Determine a target test scenario corresponding to each target variable type according to type attribute information corresponding to each target variable type in the preset configuration information, wherein the type attribute information is used to indicate that the target variable type includes a recommended type scenario or an optional type scenario; According to the factor attribute information corresponding to each of the target variable factor values in the preset configuration information and the target test scenario corresponding to each of the target variable types, the multiple target variable factor values are processed to generate the multiple target test points, and the factor attribute information is used to indicate whether the target variable factor value participates in the scenario generation.
6. The method according to claim 5, characterized in that The determining, according to the type attribute information corresponding to each target variable type in the preset configuration information, a target test scenario corresponding to each target variable type, comprises: For each of the target variable types, identifying type attribute information corresponding to the target variable type; If it is determined that the type attribute information indicates that the target variable type includes a recommended type scenario, then reading a recommended test point corresponding to the target variable type in the preset configuration information, and using the recommended test point as a target test scenario corresponding to the target variable type; If it is identified that the type attribute information indicates that the target variable type includes optional type scenarios, multiple optional type scenarios corresponding to the target variable type are read in the preset configuration information, the multiple optional type scenarios are sent to the terminal held by the user, and the target type scenario selected by the user from the multiple optional type scenarios based on the terminal held is determined, and the target type scenario is used as the target test scenario corresponding to the target variable type.
7. The method according to claim 5, characterized in that The step of processing the multiple target variable factor values according to the factor attribute information corresponding to each target variable factor value in the preset configuration information and the target test scenario corresponding to each target variable type to generate the multiple target test points includes: Extracting at least one target factor attribute information from the multiple factor attribute information, determining a target test scenario corresponding to each target factor attribute information based on a target variable type corresponding to each target factor attribute information, and generating a first test point corresponding to each target factor attribute information by using a target variable factor value corresponding to each target factor attribute information and a target test scenario corresponding to each target factor attribute information, to obtain at least one first test point, wherein the target factor attribute information indicates that the target variable factor value participates in scenario generation; Extracting at least one designated factor attribute information from the plurality of factor attribute information, determining a target test scenario corresponding to each designated factor attribute information based on a target variable type corresponding to each designated factor attribute information, and generating a second test point corresponding to each designated factor attribute information using the target test scenario corresponding to each designated factor attribute information to obtain at least one second test point, wherein the designated factor attribute information indicates that the target variable factor value does not participate in scenario generation; The at least one first test point and the at least one second test point are used as the plurality of target test points.
8. A test case generation device, characterized in that: include: An acquisition module, configured to, in response to a use case file generation request, acquire the use case information carried in the use case file generation request; A reading module, used for reading a plurality of target variable types in the use case information, and reading a target variable factor value corresponding to each target variable type in the use case information, to obtain a plurality of target variable factor values; a processing module, configured to obtain preset configuration information, and process the multiple target variable factor values according to the type attribute information corresponding to each target variable type in the preset configuration information and the factor attribute information corresponding to each target variable factor value in the preset configuration information, so as to generate multiple target test points; The sorting module is used to sort the multiple target test points and the use case information to generate a test case file.
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 7 are implemented.
10. A readable 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 7 are implemented.
