A system, method, electronic device and medium for fully automatic generation of test cases
Through the scanning and functional feature library operation combination of the system to be tested, test cases are automatically generated, which solves the problem of low efficiency in manual writing test cases and improves test efficiency and product quality.
Patent Information
- Application Number
- CN202111124369.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-24
- Publication Date
- 2024-11-12
- Estimated Expiration
- 2041-09-24
AI Technical Summary
In the prior art, manual writing test cases is inefficient, resulting in a lot of manpower, time and learning costs invested in the software testing process, and it is difficult to complete the test design efficiently.
By scanning and decomposing the program code of the system to be tested, matching and analysis is performed with the established model, and computing combination is performed using the functional feature library to automatically generate test case data sets to achieve automatic generation of test cases.
It greatly improves the efficiency of testing work, liberates the labor force for testing design and writing, and improves the quality of software products and the development level of the Internet industry.
Smart Images

Figure CN113886227B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of software testing technology, and specifically relates to a system for fully automatically generating test cases, a method for fully automatically generating test cases, an electronic device for running the method for fully automatically generating test cases, and a computer-readable storage medium for storing a computer program corresponding to the method for fully automatically generating test cases. Background Art
[0002] Nowadays, the Internet industry is developing in full swing, and various code software products produced by Internet companies are emerging in an endless stream. People's requirements for the quality of application software and user experience are getting higher and higher. It is well known in the industry that software testing is an important link in ensuring the quality of software products, and the main basis and execution criteria for software testing are test cases. In other words, good test cases can ensure the high quality of software products. For this reason, testers have invested a lot of manpower, time and learning costs in writing test cases, and the cost is even higher than that of the software development team. What kind of method can liberate the labor of test design and writing test cases has always been an eager fantasy!
[0003] In recent years, relevant technical personnel have explored the field of automatic generation of test cases. For example, the Chinese invention patent with the publication number CN103268285A and the name of the invention is Automatic generation method and device for robustness test cases for API interface, which proposes a method for automatic generation of robustness test cases for API interface, including the following steps: obtaining the source code of the API interface to be tested; performing static analysis on the source code to obtain static scanning results, and obtaining the function name, parameter name, parameter type and return value of the function in the API interface from the static scanning results; establishing a basic data set, wherein the basic data set includes multiple basic data types and related data corresponding to each basic data type; generating test data for the API interface according to the parameter type of the function in the API interface and the basic data set; generating test cases for the API interface according to the test data. Summary of the invention
[0004] The present invention aims at the inefficiency of manually writing test cases in the prior art, and provides a system and method for fully automatic generation of test cases. The present invention first scans and decomposes the program code of the system to be tested, then matches and analyzes the decomposed code with a predetermined model, and then performs calculation and combination processing in combination with a functional characteristic library to obtain a test case data set, thereby realizing automatic generation of test cases and greatly improving the work efficiency of the test.
[0005] Firstly, the present invention discloses a system for fully automatically generating test cases, including a program import module, a test class identification module, a characteristic library operation combination module, and a data storage module;
[0006] The program import module is used to import the program code of the system to be tested, and read and hierarchically process the program code of the system to be tested;
[0007] The test class identification module is used to perform test atomic positioning analysis on the layer code after layering processing, first obtain the configuration test data set and function verification data set of the system to be tested, and then retrieve the valid class model and invalid class model from the data storage module to perform abnormal analysis on the configuration test data set and function verification data set of the system to be tested, and obtain the configuration class valid data set, the configuration class invalid data set, the function class valid data set, and the function class invalid data set;
[0008] The characteristic library operation and combination module is used to store or update the function characteristic library, perform operation and combination processing on the function characteristic library and the configuration class valid data set, configuration class invalid data set, function class valid data set, and function class invalid data set retrieved from the data storage module to obtain a test case data set, and send the test case data set to the data storage module for storage;
[0009] The data storage module is used to store valid class models, invalid class models, configuration class models, function class models, and test case models.
[0010] in,
[0011] The test atoms include regularized configuration items and logicalized function points;
[0012] The functional characteristics library includes functional definitions and usage descriptions;
[0013] The configuration class valid data set and the configuration class invalid data set belong to the configuration class model;
[0014] The functional class valid data set and the functional class invalid data set belong to the functional class model;
[0015] The test case data set belongs to a test case model.
[0016] Secondly, the present invention discloses a method for fully automatically generating test cases, comprising the following steps:
[0017] Step S1: program import: the program import module imports the program code of the system to be tested;
[0018] Step S2: Layered processing: The program import module reads the program code of the system to be tested, performs layered processing on the program code, and obtains three layer codes: display layer code, data forwarding layer code, and control layer code;
[0019] Step S3: Class and test atom identification processing: The test class identification module performs class identification and test atom identification processing on the three layer codes after stratification from the outside to the inside, and divides the layer codes into configuration class, function class, valid class, and invalid class;
[0020] Step S4: Operation combination: The characteristic library operation combination module performs operation combination on the built-in or updated latest functional characteristic library with the configuration class valid data set, configuration class invalid data set, function class valid data set, and function class invalid data set retrieved from the data storage module to obtain a test case data set, and sends the test case data set to the data storage module for storage.
[0021] Furthermore, the step S1 specifically refers to: manually importing the program code of the system to be tested with one click.
[0022] Furthermore, in the step S2, the program code is layered to obtain three layers of code: display layer code, data forwarding layer code, and control layer code. Specifically, the test class identification module identifies and marks the front-end HTML code from the program code, and divides the corresponding program code into the display layer code; the test class identification module identifies and marks the front-end JS code and the back-end and front-end docking code from the program code, and divides the corresponding program code into the data forwarding layer code; the test class identification module identifies and marks the back-end logic processing code from the program code, and divides the corresponding program code into the control layer code.
[0023] Furthermore, the step S3 specifically includes the following steps:
[0024] Step S31: the test class identification module performs class identification processing on the layered layer code according to the program code characteristics to obtain a configuration class data set and a function class data set;
[0025] Step S32: the test class identification module performs test atom identification processing on the configuration class data set to obtain regularized configuration items; the test class identification module performs test atom identification processing on the function class data set to obtain logical function points;
[0026] Step S33: the test class identification module retrieves the valid class model and the invalid class model from the data storage module, compares the data in the configuration class data set with the valid class model and the invalid class model, and obtains the configuration class valid data set and the configuration class invalid data set according to the comparison results; the test class identification module compares the data in the function class data set with the valid class model and the invalid class model, and obtains the function class valid data set and the function class invalid data set according to the comparison results;
[0027] Step S34: the test class identification module sends the configuration class valid data set, the configuration class invalid data set, the function class valid data set, and the function class invalid data set to the data storage module for classified storage;
[0028] Furthermore, the step S31 specifically refers to: the test class identification module extracts HTML elements as configuration items from the identified and marked front-end HTML code, and stores the obtained multiple configuration items into the configuration class data set; the test class identification module extracts functions and function logic as functional points from the identified and marked front-end JS code, the back-end and front-end docking code, and the back-end logic processing code, and stores the obtained multiple functional points into the functional class data set.
[0029] Furthermore, in step S32, the test class identification module performs test atom identification processing on the configuration class data set to obtain regularized configuration items, specifically: first obtaining the configuration rules, then locating and marking the configuration items according to the configuration rules, and finally using the marked configuration items as regularized configuration items.
[0030] Furthermore, in step S32, the test class identification module performs test atom identification processing on the functional class data set to obtain logical function points, specifically: first obtaining the function logic, then locating and marking the function points according to the function logic, and finally marking the function points as logical function points.
[0031] Furthermore, in the step S4, before performing the calculation combination, the characteristic library calculation combination module first obtains the latest functional characteristic library;
[0032] If the latest function feature library is successfully obtained, the latest function feature library is called;
[0033] If the latest function feature library cannot be obtained successfully, the pre-built-in function feature library is retrieved;
[0034] Then, the configuration class valid data set, configuration class invalid data set, function class valid data set, function class invalid data set and each function definition and usage description in the function feature library are combined and processed to obtain a more complete test step description, and the test step description is used as the test case data.
[0035] The operation combination processing includes any one or more of one-to-one matching, keyword matching, same logic matching, and duplicate entry screening.
[0036] The specific technical means of the present invention are different from other existing technical solutions for automatically generating test cases.
[0037] The present invention also provides an electronic device, comprising a memory and a processor;
[0038] The memory is used to store computer programs;
[0039] The processor is used to execute the computer program to implement the above-mentioned method for fully automatically generating test cases.
[0040] The present invention also proposes a computer-readable storage medium for storing a computer program, wherein the computer program implements the above-mentioned method for fully automatically generating test cases when executed by a processor.
[0041] Compared with the prior art, the present invention has the following advantages and beneficial effects.
[0042] (1) The method for fully automatically generating test cases described in the present invention first scans and decomposes the program code of the system to be tested, then matches and analyzes the decomposed code with a predetermined model, and then performs calculation and combination processing in combination with a functional characteristic library to obtain a test case data set, thereby realizing automatic generation of test cases and greatly improving the work efficiency of testing.
[0043] (2) The present invention establishes a test model and its internal elements, and decomposes and analyzes the system to be tested by scanning the code of the system to be tested, thereby achieving the purpose of test design; then, combined with the description dictionary of each functional characteristic of the system to be tested, the test design is further implemented and converted into executable test cases; in this way, the labor of test case design and writing is completely liberated by automatically generated high-quality test cases, greatly improving the test production efficiency, and putting the liberated labor into higher-level test tasks, thereby improving the overall quality of Internet products and the development level of the Internet industry.
[0044] (3) When the program code of the system to be tested is imported in the present invention, a manual one-key import method is adopted, the execution cost of the operation is negligible, and the uncertainty of the automatic access code acquisition method being affected by the network, the status of the accessed device, etc. can be avoided. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Figure 1 The present invention is a flowchart of a method for fully automatically generating test cases.
[0046] Figure 2 This is a structural block diagram of a system for fully automatically generating test cases in Example 2.
[0047] Figure 3 This is a structural block diagram of a system for fully automatically generating test cases in Example 3.
[0048] Figure 4 It is a timing diagram of the system in the present invention. DETAILED DESCRIPTION
[0049] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. It should be understood that the described embodiments are only part of the embodiments of the present invention, not all of the embodiments, and therefore should not be regarded as limiting the scope of protection. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technical personnel in this field without making creative work are within the scope of protection of the present invention.
[0050] Embodiment 1:
[0051] Software testing is the confirmation of software development and the inspection of software quality. After a software product is developed or in the process of development, it is necessary to use testing means and methods to test whether the software is usable, reliable and easy to use, so that it can meet the needs of users and customers after the product is launched. Before testing, it is necessary to analyze how to test and output text solutions for use in test operations. This is test analysis and test cases. Test cases determine the scope, depth, breadth, normal and abnormal conditions, etc. of test operations.
[0052] This embodiment provides a method for automatically generating test cases. Figure 1 , Figure 4 As shown, it includes steps S1 to S4.
[0053] Step S1: Program import: import the program code of the system to be tested into the program import module.
[0054] In this embodiment, the program code of the system to be tested is manually imported with one click.
[0055] The operation of automatically obtaining system programs requires high network stability and is not flexible. Manually importing system programs has low operating costs and high efficiency. Moreover, the execution cost of manual import is negligible, and it can avoid the uncertainty of automatic access code acquisition being affected by the network, the status of the accessed device, etc.
[0056] Step S2: Layered processing: The program import module reads the program code of the system to be tested, performs layered processing on the program code, and obtains three layer codes: display layer code, data forwarding layer code, and control layer code.
[0057] In this embodiment, the test class identification module identifies and marks the front-end HTML code from the program code, and divides the corresponding program code into the display layer code; the test class identification module identifies and marks the front-end JS code and the back-end and front-end docking code from the program code, and divides the corresponding program code into the data forwarding layer code; the test class identification module identifies and marks the back-end logic processing code from the program code, and divides the corresponding program code into the control layer code.
[0058] Hierarchical name of the code Identify and label objects Presentation Layer Front-end HTML code Data forwarding layer Front-end JS code; back-end and front-end docking code Control Layer Backend logic processing code
[0059] Table 1
[0060] The objects of each layer of code are shown in Table 1.
[0061] Step S3: Class and test atom identification processing: The test class identification module performs class identification and test atom identification processing on the three layer codes after stratification from the outside to the inside, and divides the layer codes into configuration class, function class, valid class, and invalid class.
[0062] Furthermore, the step S3 specifically includes steps S31 to S34.
[0063] Step S31: the test class identification module performs class identification processing on the layered code according to the program code characteristics to obtain a configuration class data set and a function class data set.
[0064] The step S31 specifically means: the test class identification module extracts HTML elements from the marked front-end HTML code as configuration items, and stores the obtained multiple configuration items into the configuration class data set; the test class identification module extracts functions and function logic from the marked front-end JS code, the back-end and front-end docking code, and the back-end logic processing code as function points, and stores the obtained multiple function points into the function class data set.
[0065] Dataset Data Types Element Source The corresponding layer Configuration class data set Configuration items Extract HTML elements from front-end HTML code Presentation Layer Functional datasets Function Points Extract functions and function logic from front-end JS code, back-end and front-end docking code, and back-end logic processing code Data forwarding layer, control layer
[0066] Table 2
[0067] Step S32: the test class identification module performs test atom identification processing on the configuration class data set to obtain regularized configuration items; the test class identification module performs test atom identification processing on the function class data set to obtain logical function points.
[0068] Among them, the regularized configuration items and logicalized functional points are test atoms.
[0069] Dataset Data Types Test atom identification processing basis Configuration class data set Regularized configuration items Configuring rules Functional datasets Logical function points Function Logic
[0070] Table 3
[0071] In step S32, the test class identification module performs test atom identification processing on the configuration class data set to obtain regularized configuration items, which specifically means: first obtaining the configuration rules, then locating and marking the configuration items according to the configuration rules, and finally using the marked configuration items as regularized configuration items.
[0072] In step S32, the test class identification module performs test atom identification processing on the functional class data set to obtain logical function points, specifically: first obtain the function logic, then locate and mark the function points according to the function logic, and finally use the marked function points as logical function points.
[0073] Step S33: The test class identification module retrieves the valid class model and the invalid class model from the data storage module, compares the data in the configuration class data set with the valid class model and the invalid class model respectively, and obtains a configuration class valid data set and a configuration class invalid data set according to the comparison results; the test class identification module compares the data in the function class data set with the valid class model and the invalid class model respectively, and obtains a function class valid data set and a function class invalid data set according to the comparison results.
[0074] Step S34: the test class identification module sends the configuration class valid data set, the configuration class invalid data set, the function class valid data set, and the function class invalid data set to the data storage module for classified storage.
[0075] Step S4: Operation combination: The characteristic library operation combination module performs operation combination on the built-in or updated latest functional characteristic library with the configuration class valid data set, configuration class invalid data set, function class valid data set, and function class invalid data set retrieved from the data storage module to obtain a test case data set, and sends the test case data set to the data storage module for storage.
[0076] The functional characteristic library includes functional definition and usage description.
[0077] Furthermore, in the step S4, before performing the calculation combination, the characteristic library calculation combination module first obtains the latest functional characteristic library;
[0078] If the latest function feature library is successfully obtained, the latest function feature library is called;
[0079] If the latest function feature library cannot be obtained successfully, the pre-built-in function feature library is retrieved;
[0080] Then, the configuration class valid data set, configuration class invalid data set, function class valid data set, function class invalid data set and each function definition and usage description in the function feature library are combined and processed to obtain a more complete test step description, and the test step description is used as the test case data.
[0081] Furthermore, the operation combination processing includes any one or more of one-to-one matching, keyword matching, same logic matching, and duplicate entry screening.
[0082] For example: There is a piece of data in the function feature library that is a usage description of the user authentication function, which is "access the system web address, enter the user name, enter the password, and click the login button"; there is a piece of data in the function class valid data set that is "user authentication function verification test"; and it is saved in a "configuration rule" that records "if the user name and password are entered correctly, the user authentication login is successful; if the user name and password are not entered correctly, the user authentication login fails."
[0083] Compared with other solutions for automatically generating test cases, the method for fully automatically generating test cases provided in this embodiment does not need to consider the UI interface of the system under test, and does not need to distinguish and process the UI classes, interface classes, configuration code elements, etc. displayed in the code. Instead, it directly performs logical processing on the bottom-level source code. Therefore, it can avoid the instability problems of upper-level elements caused by environmental influences, so its automation efficiency will be much higher, and the performance and reliability of the system will also be much higher.
[0084] The above is relatively typical test case data. The specific operation combination method can be any one or more of one-to-one matching, keyword matching, same logic matching, and duplicate entry screening, which will not be listed one by one.
[0085] Embodiment 2:
[0086] This embodiment proposes a system for running the method described in Embodiment 1, namely, a system for fully automatically generating test cases.
[0087] At this time, if Figure 2 As shown, a system for fully automatic test case generation includes a program import module, a test class identification module, a feature library operation combination module, and a data storage module. The program import module, the test class identification module, the feature library operation combination module, and the data storage module are connected in sequence, and the test class identification module and the feature library operation combination module are also connected to the data storage module respectively.
[0088] The program import module is used to import the program code of the system to be tested, and read and hierarchically process the program code of the system to be tested;
[0089] The test class identification module is used to perform test atomic positioning analysis on the layer code after layering processing, first obtain the configuration test data set and function verification data set of the system to be tested, and then retrieve the valid class model and invalid class model from the data storage module to perform abnormal analysis on the configuration test data set and function verification data set of the system to be tested, and obtain the configuration class valid data set, the configuration class invalid data set, the function class valid data set, and the function class invalid data set;
[0090] The characteristic library operation and combination module is used to store or update the function characteristic library, perform operation and combination processing on the function characteristic library and the configuration class valid data set, configuration class invalid data set, function class valid data set, and function class invalid data set retrieved from the data storage module to obtain a test case data set, and send the test case data set to the data storage module for storage;
[0091] The data storage module is used to store valid class models, invalid class models, configuration class models, function class models, and test case models.
[0092] in,
[0093] The test atoms include regularized configuration items and logicalized function points;
[0094] The functional characteristics library includes functional definitions and usage descriptions;
[0095] The configuration class data set belongs to the configuration class model;
[0096] The functional data set belongs to a functional model;
[0097] The test case data set belongs to a test case model.
[0098] Embodiment 3:
[0099] This embodiment proposes a system for fully automatically generating test cases in another structure based on the second embodiment.
[0100] At this time, if Figure 3 As shown, a system for fully automatic test case generation includes a program import module, a test class identification module, a feature library operation combination module, and a data storage module. The program import module, the test class identification module, the feature library operation combination module, and the data storage module are connected in sequence, and the program import module, the test class identification module, and the feature library operation combination module are also respectively connected to the data storage module.
[0101] Compared with the technical solution in Example 2, the functions of the program import module, test class identification module, characteristic library operation combination module, and data storage module in this embodiment are basically the same. The difference lies in that: after the program import module imports the program code of the system to be tested, the program code of the system to be tested is first sent to the data storage module for storage, and then the program code of the system to be tested is read and layered; accordingly, the data storage module has an additional function of storing or updating the program code of the system to be tested.
[0102] Compared with the technical solution of Example 2, the technical solution of this embodiment stores the program code of the system to be tested, so that the operator can repeatedly call the program code of the system to be tested more conveniently, and also facilitates the implementation of more demanding operations such as manual intervention in test case generation.
[0103] Based on the above description, the system for fully automatically generating test cases proposed in this embodiment includes a program import module, a test class identification module, a feature library operation combination module, and a data storage module;
[0104] The program import module is used to import the program code of the system under test, send the program code of the system under test to the data storage module for storage, and read and hierarchically process the program code of the system under test;
[0105] The test class identification module is used to perform test atomic positioning analysis on the layer code after layering processing, first obtain the configuration test data set and function verification data set of the system to be tested, and then retrieve the valid class model and invalid class model from the data storage module to perform abnormal analysis on the configuration test data set and function verification data set of the system to be tested, and obtain the configuration class valid data set, the configuration class invalid data set, the function class valid data set, and the function class invalid data set;
[0106] The characteristic library operation and combination module is used to store or update the function characteristic library, perform operation and combination processing on the function characteristic library and the configuration class valid data set, configuration class invalid data set, function class valid data set, and function class invalid data set retrieved from the data storage module to obtain a test case data set, and send the test case data set to the data storage module for storage;
[0107] The data storage module is used to store valid class models, invalid class models, configuration class models, function class models, test case models, and system models to be tested.
[0108] The test atoms include regularized configuration items and logicalized function points;
[0109] The functional characteristics library includes functional definitions and usage descriptions;
[0110] The configuration class data set, configuration class valid data set, and configuration class invalid data set are data sets in the configuration class model;
[0111] The functional class data set, functional class valid data set, and functional class invalid data set are data sets in the functional class model;
[0112] The test case data set is a data set in a test case model;
[0113] The program code imported into the system under test is a data set in the model of the system under test.
[0114] Embodiment 4:
[0115] This embodiment provides an electronic device, including a memory and a processor;
[0116] The memory is used to store computer programs;
[0117] The processor is used to execute the computer program to implement the method for fully automatically generating test cases described in Example 1.
[0118] At this time, the electronic device may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device capable of loading and executing a computer program.
[0119] Embodiment 5:
[0120] This embodiment provides a computer-readable storage medium for storing a computer program. When the computer program is executed by a processor, the method for fully automatically generating test cases as described in Embodiment 1 is implemented.
[0121] The computer-readable storage medium stores a computer program for executing a specific method. The computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server or a data center that includes one or more available media integrated therein. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid state disk (SSD)).
[0122] In summary, the above are only embodiments of the present invention and are not intended to limit the protection scope of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A system for fully automatic generation of test cases, characterized in that: It includes program import module, test class identification module, characteristic library operation combination module and data storage module; The program import module is used to import the program code of the system to be tested, and read and hierarchically process the program code of the system to be tested; The test class identification module is used to perform test atomic positioning analysis on the layer code after layering processing, first obtain the configuration test data set and function verification data set of the system to be tested, and then retrieve the valid class model and invalid class model from the data storage module to perform abnormal analysis on the configuration test data set and function verification data set of the system to be tested, and obtain the configuration class valid data set, the configuration class invalid data set, the function class valid data set, and the function class invalid data set; The characteristic library operation and combination module is used to store or update the function characteristic library, perform operation and combination processing on the function characteristic library and the configuration class valid data set, configuration class invalid data set, function class valid data set, and function class invalid data set retrieved from the data storage module to obtain a test case data set, and send the test case data set to the data storage module for storage; The data storage module is used to store valid class models, invalid class models, configuration class models, function class models, and test case models; in, The test atoms include regularized configuration items and logicalized function points; The functional characteristics library includes functional definitions and usage descriptions; The configuration class valid data set and the configuration class invalid data set belong to the configuration class model; The functional class valid data set and the functional class invalid data set belong to the functional class model; The test case data set belongs to a test case model.
2. A method for fully automatically generating test cases based on the system as claimed in claim 1, characterized in that: The following steps are involved: Step S1: program import: the program import module imports the program code of the system to be tested; Step S2: Layered processing: The program import module reads the program code of the system to be tested, performs layered processing on the program code, and obtains three layer codes: display layer code, data forwarding layer code, and control layer code; Step S3: Class and test atom identification processing: The test class identification module performs class identification and test atom identification processing on the three layer codes after stratification from the outside to the inside, and divides the layer codes into configuration class, function class, valid class, and invalid class; The step S3 specifically comprises the following steps: Step S31: the test class identification module performs class identification processing on the layered layer code according to the program code characteristics to obtain a configuration class data set and a function class data set; Step S32: the test class identification module performs test atom identification processing on the configuration class data set to obtain regularized configuration items; the test class identification module performs test atom identification processing on the function class data set to obtain logical function points; Step S33: the test class identification module retrieves the valid class model and the invalid class model from the data storage module, compares the data in the configuration class data set with the valid class model and the invalid class model, and obtains the configuration class valid data set and the configuration class invalid data set according to the comparison results; the test class identification module compares the data in the function class data set with the valid class model and the invalid class model, and obtains the function class valid data set and the function class invalid data set according to the comparison results; Step S34: the test class identification module sends the configuration class valid data set, the configuration class invalid data set, the function class valid data set, and the function class invalid data set to the data storage module for classified storage; Step S4: Operation combination: The characteristic library operation combination module performs operation combination on the built-in or updated latest functional characteristic library with the configuration class valid data set, configuration class invalid data set, function class valid data set, and function class invalid data set retrieved from the data storage module to obtain a test case data set, and sends the test case data set to the data storage module for storage.
3. A method for fully automatically generating test cases as claimed in claim 2, characterized in that: The step S1 specifically refers to: manually importing the program code of the system to be tested with one click.
4. A method for fully automatically generating test cases as claimed in claim 2, characterized in that: In the step S2, the program code is layered to obtain three layers of code: display layer code, data forwarding layer code, and control layer code. Specifically, the test class identification module identifies and marks the front-end HTML code from the program code, and divides the corresponding program code into the display layer code; the test class identification module identifies and marks the front-end JS code and the back-end and front-end docking code from the program code, and divides the corresponding program code into the data forwarding layer code; the test class identification module identifies and marks the back-end logic processing code from the program code, and divides the corresponding program code into the control layer code.
5. A method for fully automatic test case generation as claimed in claim 4, characterized in that: The step S31 specifically means: the test class identification module extracts HTML elements as configuration items from the identified and marked front-end HTML code, and stores the obtained multiple configuration items into a configuration class data set; the test class identification module extracts functions and function logic as function points from the identified and marked front-end JS code, the back-end and front-end docking code, and the back-end logic processing code, and stores the obtained multiple function points into a function class data set.
6. A method for fully automatic test case generation as claimed in claim 5, characterized in that: In the step S32, the test class identification module performs test atom identification processing on the configuration class data set to obtain regularized configuration items, which specifically means: first obtain the configuration rules, then locate and mark the configuration items according to the configuration rules, and finally use the marked configuration items as regularized configuration items; in the step S32, the test class identification module performs test atom identification processing on the function class data set to obtain logicalized function points, which specifically means: first obtain the function logic, then locate and mark the function points according to the function logic, and finally use the marked function points as logicalized function points.
7. A method for fully automatically generating test cases as described in any one of claims 2 to 6, characterized in that: In the step S4, before performing the calculation combination, the characteristic library calculation combination module first obtains the latest functional characteristic library; If the latest function feature library is successfully obtained, the latest function feature library is called; If the latest function feature library cannot be obtained successfully, the pre-built-in function feature library is retrieved; Then, the configuration class valid data set, configuration class invalid data set, function class valid data set, function class invalid data set and each function definition and usage description in the function feature library are combined and processed to obtain a more complete test step description, and the test step description is used as the test case data.
8. A method for fully automatic test case generation as claimed in claim 7, characterized in that: The operation combination processing includes any one or more of one-to-one matching, keyword matching, same logic matching, and duplicate entry screening.
9. An electronic device comprising a memory and a processor; characterized in that: The memory is used to store computer programs; The processor is used to execute the computer program to implement the method for fully automatically generating test cases according to any one of claims 2 to 8.
10. A computer-readable storage medium for storing a computer program, characterized in that: When the computer program is executed by a processor, the method for fully automatically generating test cases according to any one of claims 2 to 8 is implemented.
Citation Information
Patent Citations
Method and device for automatic generation of robustness test case of API interface
CN103268285A
Method and device for generating test case, medium and electronic equipment
CN111367791A
Test case generation method and device, computer equipment and storage medium
CN112527630A
