Test methods, apparatus, devices, and storage media based on automatically generated test cases
Automatically generate test cases by parsing template rules, solving the problem of test case differences caused by manual writing, achieving more efficient test data preparation and execution, and improving the uniformity and efficiency of test coverage.
Patent Information
- Application Number
- CN201911341687.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-12-24
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2039-12-24
AI Technical Summary
Manually writing test cases results in large differences in content and coverage, and cannot achieve 100% coverage, resulting in heavy workload for testers and inconsistent test results.
By parsing the rules in the template, test cases and corresponding test data are automatically generated. Using the preset test list, requirement template and rule template, test cases are generated and saved to optimize the test data generation and execution process.
Significantly reduces the difference rate of use case content and coverage, reduces use case writing and data preparation time, and improves test efficiency and result consistency.
Smart Images

Figure 00000000_0000
Abstract
Description
Technical Field
[0001] The present invention relates to the field of test case generation, and in particular to a test method, device, equipment and storage medium based on automatic test case generation. Background Art
[0002] In the process of application service development, the completed code needs to be tested to timely troubleshoot potential problems before the application goes online and improve the stability of the system. This requires generating test cases to complete code testing.
[0003] In traditional software testing, test case writing is a necessary and core task in the testing process. Testers need to spend a lot of time and energy to write test cases. Test case writing takes up a large part of the testers' daily work time, and the content of test case writing varies from person to person.
[0004] Therefore, the current manual test case writing process places a heavy workload on testers, and different testers' different understandings of requirements lead to large differences in the content and coverage of test cases, making it impossible to achieve 100% coverage. Summary of the invention
[0005] The technical problem to be solved by the present invention is to overcome the problem in the prior art that manually writing test cases will lead to large differences in the content and coverage of the test cases and cannot achieve 100% coverage. A testing method, device, equipment and storage medium based on automatic generation of test cases are proposed. By parsing the rules of several templates, test cases and corresponding test data are automatically generated to greatly reduce the difference rate of the content and coverage of the test cases.
[0006] The present invention solves the above technical problems through the following technical solutions:
[0007] A test method based on automatically generating use cases comprises the following steps:
[0008] In response to a list selection operation by a user, taking out a test list selected by the user from a plurality of preset test lists;
[0009] In response to a user selecting an item in the selected test list, obtaining a requirement template number corresponding to the item selected by the user from the test list;
[0010] Obtaining a corresponding requirement template from a plurality of preset requirement templates according to the requirement template number, and obtaining configuration information of the data item and a rule template number corresponding to the data item from the corresponding requirement template;
[0011] Obtaining a corresponding rule template from a plurality of preset rule templates according to the rule template number, and obtaining a data rule from the corresponding rule template;
[0012] A test case is generated and saved according to the configuration information of the data item and the data rule.
[0013] Preferably, the test method based on automatically generating use cases further comprises the following steps:
[0014] Generate test data according to the test case;
[0015] The test data is input to execute the test, and the test results are generated and output after the test is completed.
[0016] Preferably, the requirement template and the rule template are saved with the requirement template number and the rule template number as file names respectively.
[0017] Preferably, the file name of the test case includes a case number prefix and a case number suffix, the case number prefix is generated by the case number prefix of the test list selected by the user, the case number suffix consists of a number of digits, and the number of digits increases sequentially according to the generation order of the test cases.
[0018] Preferably, when a fixed value is set in the requirement template, the test data is the fixed value; when a fixed value is not set in the requirement template, the test data is randomly generated according to the data rule.
[0019] Preferably, the test results include the total number of statistical use cases, the number of passed use cases and the number of failed use cases.
[0020] The present invention also discloses a test device based on automatically generating use cases, comprising:
[0021] A test list acquisition module, used for taking out the test list selected by the user from a plurality of preset test lists in response to a list selection operation by the user;
[0022] A requirement template locating module, configured to obtain a requirement template number corresponding to the data item selected by the user from the test list in response to a user selecting the data item in the selected test list;
[0023] A rule template locating module, used to obtain a corresponding requirement template from a plurality of preset requirement templates according to the requirement template number, and obtain configuration information of a data item and a rule template number corresponding to the data item from the corresponding requirement template;
[0024] A data rule acquisition module, used to acquire a corresponding rule template from a plurality of preset rule templates according to the rule template number, and acquire a data rule from the corresponding rule template;
[0025] The test case generation module is used to generate and save test cases according to the configuration information of the data item and the data rules.
[0026] Preferably, the test device based on automatically generating use cases further comprises:
[0027] A data generation module, used to generate test data according to the test case;
[0028] The test execution module is used to execute the test according to the input test data, generate and output the test results after the test is completed.
[0029] The present invention also discloses a computer device, comprising a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the following steps are implemented:
[0030] In response to a list selection operation by a user, taking out a test list selected by the user from a plurality of preset test lists;
[0031] In response to a user selecting an item in the selected test list, obtaining a requirement template number corresponding to the item selected by the user from the test list;
[0032] Obtaining a corresponding requirement template from a plurality of preset requirement templates according to the requirement template number, and obtaining configuration information of the data item and a rule template number corresponding to the data item from the corresponding requirement template;
[0033] Obtaining a corresponding rule template from a plurality of preset rule templates according to the rule template number, and obtaining a data rule from the corresponding rule template;
[0034] A test case is generated and saved according to the configuration information of the data item and the data rule.
[0035] The present invention also discloses a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program can be executed by at least one processor to implement the following steps:
[0036] In response to a list selection operation by a user, taking out a test list selected by the user from a plurality of preset test lists;
[0037] In response to a user selecting an item in the selected test list, obtaining a requirement template number corresponding to the item selected by the user from the test list;
[0038] Obtaining a corresponding requirement template from a plurality of preset requirement templates according to the requirement template number, and obtaining configuration information of the data item and a rule template number corresponding to the data item from the corresponding requirement template;
[0039] Obtaining a corresponding rule template from a plurality of preset rule templates according to the rule template number, and obtaining a data rule from the corresponding rule template;
[0040] A test case is generated and saved according to the configuration information of the data item and the data rule.
[0041] The positive and progressive effect of the present invention is that test cases and corresponding test data are automatically generated by utilizing the rules in the parsing template, thereby reducing the time for writing the test cases and the time for preparing the test data. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 A flow chart of a first embodiment of a test method based on automatic generation of use cases of the present invention is shown;
[0043] Figure 2 A flow chart of a second embodiment of a test method based on automatic generation of use cases of the present invention is shown;
[0044] Figure 3 A structural diagram of a first embodiment of a test device based on automatic generation of use cases according to the present invention is shown;
[0045] Figure 4 A structural diagram of a second embodiment of a test device based on automatic generation of use cases according to the present invention is shown;
[0046] Figure 5 A schematic diagram of the hardware architecture of a computer device according to an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0047] The present invention is further described below by way of examples, but the present invention is not limited to the scope of the examples.
[0048] Firstly, the present invention proposes a testing method based on automatically generating use cases.
[0049] In the first embodiment, Figure 1 As shown, the test method based on automatically generating use cases includes the following steps:
[0050] Step 01: In response to a list selection operation by a user, a test list selected by the user is retrieved from a plurality of preset test lists.
[0051] The test list is preset in the system, and each test point is listed in the list, and the user can select it by clicking the mouse.
[0052] A test point refers to a business parameter in the test function requirement.
[0053] The test list corresponds to the requirements one by one. Each test list corresponds to a requirement number. A test list contains multiple test points. The test points are contained in the test list, and the test list corresponds to the requirement number one by one.
[0054] Step 02: In response to a user's selection operation on a data item in the selected test list, a requirement template number corresponding to the data item selected by the user is obtained from the test list.
[0055] After selecting the test list, you need to select a specific test point from the test list, that is, the data item selection operation. The number of data items can be one or more, depending on actual needs. Each test item will correspond to a requirement template number.
[0056] Step 03: Obtain a corresponding requirement template from a plurality of preset requirement templates according to the requirement template number, and obtain configuration information of the data item and the rule template number corresponding to the data item from the corresponding requirement template.
[0057] The requirement template is also preset in the system. The corresponding requirement template is obtained from the preset requirement template according to the requirement template number. The requirement template here is saved with the rule template number as the file name. Therefore, after obtaining the requirement template number, the corresponding requirement template can be directly found according to this code.
[0058] The requirement template is provided with configuration information of the data item, including data type, length, etc. In addition, the requirement template defines the data item and also provides a rule template number corresponding to the data item, so as to match the applicable rule template through the rule template number.
[0059] Step 04: Obtain a corresponding rule template from a plurality of preset rule templates according to the rule template number, and obtain a data rule from the corresponding rule template.
[0060] A rule template is a pre-configured template that contains specific validation rules. Each rule template has a unique rule template number, and each rule template is saved with the rule template number as the file name. Therefore, knowing the rule template number makes it easy to obtain the corresponding rule template.
[0061] Step 05: Generate and save test cases based on the configuration information of the data item and the data rules.
[0062] After selecting the data item, the configuration information and data rules are automatically obtained, and then the generation of the test case is triggered. The test case is saved according to a specific naming rule, including a use case number prefix and a use case number suffix. The use case number prefix is generated by the use case number prefix of the test list selected by the user, and the use case number suffix consists of a number of digits, and the number of digits increases sequentially according to the generation order of the test case. For example, the use case number is suffixed with 3 digits, the starting value can be 001, and then increases sequentially.
[0063] According to this embodiment, the following data length verification use case can be generated:
[0064] 1. Parameter is fixed length;
[0065] Test content: Parameter length is equal to X;
[0066] Test steps: Parameter in the request message is X bits;
[0067] Expected results: 1) Parameter length check passed: Parameter format check passed;
[0068] Test content: Parameter length is not equal to X;
[0069] Test steps: The Parameter in the request message is X bits (greater than X or less than X);
[0070] Expected results: 1) Parameter length check failed: respCode:, respMsg: Parameter, format check failed.
[0071] 2. Parameter is of indefinite length, and X is the boundary value;
[0072] Test content: Parameter length is greater than X (X is the maximum boundary value);
[0073] Test steps: Parameter in the request message is X bits;
[0074] Expected results: 1) Parameter length check passed: Parameter format check passed;
[0075] 2) Parameter length check failed: respCode:, respMsg: Parameter, format check failed;
[0076] Test content: Parameter length is greater than X (X is the boundary value);
[0077] Test steps: Parameter in the request message is X bits;
[0078] Expected results: 1) Parameter length check passed: Parameter format check passed;
[0079] 2) Parameter length check failed: respCode:, respMsg: Parameter, format check failed
[0080] Test content: Parameter length is greater than X (X is the minimum boundary value);
[0081] Test steps: Parameter in the request message is X bits;
[0082] Expected results: 1) Parameter length check passed: Parameter format check passed;
[0083] 2) Parameter length check failed: respCode:, respMsg: Parameter, format check failed;
[0084] Parameter value is xy (x is the lower boundary, y is the upper boundary);
[0085] X is an open interval:
[0086] The lower boundary invalid equivalence class test case is: P = X;
[0087] The lower boundary valid equivalence class test case is: P = X + 1;
[0088] X is a closed interval:
[0089] The lower boundary invalid equivalence class test case is: P = X;
[0090] The lower boundary valid equivalence class test case is: P = X-1;
[0091] Y is an open interval:
[0092] The lower boundary invalid equivalence class test case is: P = Y;
[0093] The lower boundary valid equivalence class test case is: P = Y-1;
[0094] Y is a closed interval:
[0095] The lower boundary invalid equivalence class test case is: P = Y;
[0096] The lower boundary valid equivalence class test case is: P=Y+1.
[0097] In the second embodiment, based on the first embodiment, as Figure 2 As shown, the test method based on automatically generating use cases includes the following steps:
[0098] Step 01 to step 05 are the same as in the first embodiment and will not be described again here.
[0099] Step 06: Generate test data according to the test case.
[0100] Specifically, when there is a fixed value in the requirement template, the fixed value is used as one of the test data, and when there is no fixed value in the requirement template, the test data is randomly generated according to the data rule.
[0101] The test data are all in the form of messages.
[0102] Step 07: Input the test data to execute the test, generate and output the test results after the test is completed.
[0103] The obtained test data is input into the application to be tested to execute the test. After the execution is completed, each data return result is synchronously written to the corresponding execution return result. After all data execution is completed, the test results are automatically generated and output. The test results include the total number of statistical use cases, the number of passed use cases, the number of failed use cases, etc.
[0104] Secondly, the present invention proposes a test device based on automatically generated use cases, and the device 20 can be divided into one or more modules.
[0105] For example, Figure 3 The structure diagram of the first embodiment of the test device 20 based on automatic generation of test cases is shown. In this embodiment, the device 20 can be divided into a test list acquisition module 201, a requirement template location module 202, a rule template location module 203, a data rule acquisition module 204 and a test case generation module 205. The following description will specifically introduce the specific functions of the modules 201-205.
[0106] The test list acquisition module 201 is used for taking out the test list selected by the user from a plurality of preset test lists in response to a list selection operation of the user.
[0107] The test list is preset in the system, and each test point is listed in the list, and the user can select it by clicking the mouse.
[0108] A test point refers to a business parameter in the test function requirement.
[0109] The test list corresponds to the requirements one by one. Each test list corresponds to a requirement number. A test list contains multiple test points. The test points are contained in the test list, and the test list corresponds to the requirement number one by one.
[0110] The requirement template locating module 202 is used for obtaining the requirement template number corresponding to the data item selected by the user from the test list in response to the user's selection operation on the data item selected in the test list.
[0111] After selecting the test list, you need to select a specific test point from the test list, that is, the data item selection operation. The number of data items can be one or more, depending on actual needs. Each test item will correspond to a requirement template number.
[0112] The rule template locating module 203 is used to obtain a corresponding requirement template from a plurality of preset requirement templates according to the requirement template number, and obtain configuration information of a data item and a rule template number corresponding to the data item from the corresponding requirement template.
[0113] The requirement template is also preset in the system. The corresponding requirement template is obtained from the preset requirement template according to the requirement template number. The requirement template here is saved with the rule template number as the file name. Therefore, after obtaining the requirement template number, the corresponding requirement template can be directly found according to this code.
[0114] The requirement template is provided with configuration information of the data item, including data type, length, etc. In addition, the requirement template defines the data item and also provides a rule template number corresponding to the data item, so as to match the applicable rule template through the rule template number.
[0115] The data rule acquisition module 204 is used to acquire a corresponding rule template from a plurality of preset rule templates according to the rule template number, and acquire a data rule from the corresponding rule template.
[0116] A rule template is a pre-configured template that contains specific validation rules. Each rule template has a unique rule template number, and each rule template is saved with the rule template number as the file name. Therefore, knowing the rule template number makes it easy to obtain the corresponding rule template.
[0117] The test case generation module 205 is used to generate and save test cases according to the configuration information of the data items and the data rules.
[0118] After selecting the data item, the configuration information and data rules are automatically obtained, and then the generation of the test case is triggered. The test case is saved according to a specific naming rule, including a use case number prefix and a use case number suffix. The use case number prefix is generated by the use case number prefix of the test list selected by the user, and the use case number suffix consists of a number of digits, and the number of digits increases sequentially according to the generation order of the test case. For example, the use case number is suffixed with 3 digits, the starting value can be 001, and then increases sequentially.
[0119] For example, Figure 4 A structural diagram of the second embodiment of the test device 20 based on automatic generation of use cases is shown. In this embodiment, the test device 20 based on automatic generation of use cases can also be divided into a test list acquisition module 201, a requirement template positioning module 202, a rule template positioning module 203, a data rule acquisition module 204, a test case generation module 205, a data generation module 206 and a test execution module 207.
[0120] Among them, modules 201-205 are the same as those in the first embodiment and will not be described again here.
[0121] The data generation module 206 is used to generate test data according to the test case.
[0122] Specifically, when there is a fixed value in the requirement template, the fixed value is used as one of the test data, and when there is no fixed value in the requirement template, the test data is randomly generated according to the data rule.
[0123] The test data are all in the form of messages.
[0124] The test execution module 207 is used to execute the test according to the input test data, and generate and output the test results after the test is completed.
[0125] The obtained test data is input into the application to be tested to execute the test. After the execution is completed, each data return result is synchronously written to the corresponding execution return result. After all data execution is completed, the test results are automatically generated and output. The test results include the total number of statistical use cases, the number of passed use cases, the number of failed use cases, etc.
[0126] Thirdly, the present invention also proposes a computer device.
[0127] See also Figure 5, is a schematic diagram of the hardware architecture of an embodiment of a computer device of the present invention. In this embodiment, the computer device 2 is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions. For example, it can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a rack server, a blade server, a tower server or a cabinet server (including an independent server, or a server cluster composed of multiple servers), etc. As shown in the figure, the computer device 2 at least includes, but is not limited to, a memory 21, a processor 22 and a network interface 23 that can communicate with each other through a system bus. Wherein:
[0128] The memory 21 includes at least one type of computer-readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 21 can be an internal storage unit of the computer device 2, such as a hard disk or memory of the computer device 2. In other embodiments, the memory 21 can also be an external storage device of the computer device 2, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the computer device 2. Of course, the memory 21 can also include both the internal storage unit of the computer device 2 and its external storage device. In this embodiment, the memory 21 is generally used to store the operating system and various application software installed on the computer device 2, such as a computer program for implementing the test method based on automatic generation of use cases, etc. In addition, the memory 21 can also be used to temporarily store various types of data that have been output or are to be output.
[0129] The processor 22 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chips in some embodiments. The processor 22 is generally used to control the overall operation of the computer device 2, such as executing control and processing related to data interaction or communication with the computer device 2. In this embodiment, the processor 22 is used to run the program code stored in the memory 21 or process data, such as running a computer program for implementing the test method based on the automatic generation of use cases.
[0130] The network interface 23 may include a wireless network interface or a wired network interface, and the network interface 23 is generally used to establish a communication connection between the computer device 2 and other computer devices. For example, the network interface 23 is used to connect the computer device 2 to an external terminal through a network, and to establish a data transmission channel and a communication connection between the computer device 2 and the external terminal. The network may be a wireless or wired network such as an Intranet, the Internet, the Global System of Mobile communication (GSM), Wideband Code Division Multiple Access (WCDMA), a 4G network, a 5G network, Bluetooth, or Wi-Fi.
[0131] It should be pointed out that Figure 5 Only a computer device 2 having components 21 - 23 is shown, but it should be understood that implementation of all of the components shown is not a requirement, and more or fewer components may alternatively be implemented.
[0132] In this embodiment, the computer program for implementing the test method based on automatically generating use cases stored in the memory 21 can be executed by one or more processors (processor 22 in this embodiment) to complete the following steps:
[0133] Step 01: In response to a list selection operation by a user, a test list selected by the user is retrieved from a plurality of preset test lists;
[0134] Step 02: in response to a user selecting an item in the selected test list, obtaining a requirement template number corresponding to the item selected by the user from the test list;
[0135] Step 03: Obtain a corresponding requirement template from a plurality of preset requirement templates according to the requirement template number, and obtain configuration information of the data item and the rule template number corresponding to the data item from the corresponding requirement template;
[0136] Step 04: Obtain a corresponding rule template from a plurality of preset rule templates according to the rule template number, and obtain a data rule from the corresponding rule template;
[0137] Step 05: Generate and save test cases based on the configuration information of the data item and the data rules.
[0138] Furthermore, the steps may also include:
[0139] Step 06: Generate test data according to the test case;
[0140] Step 07: Input the test data to execute the test, generate and output the test results after the test is completed.
[0141] In addition, the present invention provides a computer-readable storage medium, which is a non-volatile readable storage medium, storing a computer program therein, and the computer program can be executed by at least one processor to implement the operation of the above-mentioned test method or device based on automatically generated use cases.
[0142] Among them, the computer-readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the computer-readable storage medium can be an internal storage unit of a computer device, such as a hard disk or memory of the computer device. In other embodiments, the computer-readable storage medium can also be an external storage device of a computer device, such as a plug-in hard disk equipped on the computer device, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. Of course, the computer-readable storage medium can also include both the internal storage unit of the computer device and its external storage device. In this embodiment, the computer-readable storage medium is generally used to store an operating system and various application software installed on the computer device, such as the aforementioned computer program for implementing the test method based on the automatic generation of use cases, etc. In addition, the computer-readable storage medium can also be used to temporarily store various types of data that have been output or are to be output.
[0143] Although the specific embodiments of the present invention are described above, it should be understood by those skilled in the art that this is only for illustration and the protection scope of the present invention is defined by the appended claims. Those skilled in the art may make various changes or modifications to these embodiments without departing from the principles and essence of the present invention, but these changes and modifications all fall within the protection scope of the present invention.
Claims
1. A testing method based on automatically generated use cases, It is characterized in that The following steps are involved: In response to the user's list selection operation, the test list selected by the user is taken out from a plurality of preset test lists; wherein the test list includes a plurality of test points; a test point refers to a certain service parameter in the test function requirement; the test list corresponds to the requirement one by one, and each test list corresponds to a requirement number; In response to a user selecting an item in the selected test list, obtaining a requirement template number corresponding to the item selected by the user from the test list; According to the requirement template number, a corresponding requirement template is obtained from a plurality of preset requirement templates, and configuration information of the data item and a rule template number corresponding to the data item are obtained from the corresponding requirement template; wherein the configuration information includes a data type and a length; the requirement template is also used to define the data item, and a rule template number corresponding to the data item is set; the rule template number is used to match the rule template; Obtaining a corresponding rule template from a plurality of preset rule templates according to the rule template number, and obtaining a data rule from the corresponding rule template; wherein the rule template includes a verification rule; Generate and save test cases according to the configuration information of the data item and the data rule; wherein the naming rule of the test case includes a test case number prefix and a test case number suffix, the test case number prefix is generated by the test case number prefix of the test list selected by the user, and the test case number suffix consists of a number of digits, and the number of digits increases in sequence according to the generation order of the test case; Generate test data according to the test case; wherein, when a fixed value is set in the requirement template, the test data is the fixed value; when no fixed value is set in the requirement template, the test data is randomly generated according to the data rule; The test data is input to execute the test, and the test results are generated and output after the test is completed.
2. The test method based on automatically generated use cases according to claim 1, It is characterized in that The requirement template and the rule template are saved with the requirement template number and the rule template number as file names respectively.
3. The test method based on automatically generated use cases according to claim 1, It is characterized in that The test results include the total number of statistical use cases, the number of passed use cases, and the number of failed use cases.
4. A test device based on automatically generated use cases, It is characterized in that include: A test list acquisition module is used to respond to the user's list selection operation and retrieve the test list selected by the user from a plurality of preset test lists; wherein the test list includes multiple test points; a test point refers to a business parameter in a test function requirement; a test list corresponds to a requirement one by one, and each test list corresponds to a requirement number; A requirement template locating module, configured to obtain a requirement template number corresponding to the data item selected by the user from the test list in response to a user selecting the data item in the selected test list; A rule template locating module is used to obtain a corresponding requirement template from a plurality of preset requirement templates according to the requirement template number, and obtain configuration information of the data item and the rule template number corresponding to the data item from the corresponding requirement template; wherein the configuration information includes data type and length; the requirement template is also used to define the data item, and is provided with a rule template number corresponding to the data item; the rule template number is used to match the rule template; A data rule acquisition module, used to acquire a corresponding rule template from a plurality of preset rule templates according to the rule template number, and acquire a data rule from the corresponding rule template; wherein the rule template includes a verification rule; A test case generation module, used to generate and save test cases according to the configuration information of the data item and the data rule; wherein the naming rule of the test case includes a test case number prefix and a test case number suffix, the test case number prefix is generated by the test case number prefix of the test list selected by the user, and the test case number suffix consists of a number of digits, and the number of digits increases in sequence according to the generation order of the test case; A data generation module, used to generate test data according to the test case; wherein, when a fixed value is set in the requirement template, the test data is the fixed value; when a fixed value is not set in the requirement template, the test data is randomly generated according to the data rule; The test execution module is used to execute the test according to the input test data, generate and output the test results after the test is completed.
5. A computer device comprising a memory and a processor, It is characterized in that The memory stores a computer program, which, when executed by the processor, implements the steps of the test method based on automatic generation of use cases as described in any one of claims 1 to 3.
6. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a computer program, which can be executed by at least one processor to implement the steps of the test method based on automatic generation of use cases as described in any one of claims 1 to 3.
