CN117112402A - Efficient test case generation method, system, equipment and medium - Google Patents
Efficient test case generation method, system, equipment and medium Download PDFInfo
- Publication number
- CN117112402A CN117112402A CN202310929578.4A CN202310929578A CN117112402A CN 117112402 A CN117112402 A CN 117112402A CN 202310929578 A CN202310929578 A CN 202310929578A CN 117112402 A CN117112402 A CN 117112402A
- Authority
- CN
- China
- Prior art keywords
- test
- case
- cases
- logic
- edited
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000012360 testing method Methods 0.000 title claims abstract description 196
- 238000000034 method Methods 0.000 title claims abstract description 46
- 238000004891 communication Methods 0.000 claims description 23
- 238000004458 analytical method Methods 0.000 claims description 20
- 238000004590 computer program Methods 0.000 claims description 8
- 238000013461 design Methods 0.000 abstract description 9
- 238000012423 maintenance Methods 0.000 abstract description 6
- 230000008569 process Effects 0.000 description 7
- 238000012545 processing Methods 0.000 description 5
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 238000010586 diagram Methods 0.000 description 3
- 230000006870 function Effects 0.000 description 3
- 230000008859 change Effects 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000002093 peripheral effect Effects 0.000 description 2
- 238000003491 array Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000004422 calculation algorithm Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000000802 evaporation-induced self-assembly Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 238000010998 test method Methods 0.000 description 1
- 238000012956 testing procedure Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3684—Test management for test design, e.g. generating new test cases
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
Abstract
The application discloses a test case efficient generation method, a system, equipment and a medium, wherein the method comprises the following steps: acquiring a plurality of test cases to be edited; performing the same test logic definition operation based on a plurality of test cases to be edited to obtain case writing keywords; responding to the test case generation requirement, acquiring test data corresponding to the test case generation requirement, and writing keywords and the test data according to the case to generate a test case to be used; the application can separate the test logic from the test call, defines the same test logic as the keyword, carries out quick editing of different test cases based on the template framework of the keyword, writes the same test logic once, changes the logic in time at the later stage, and also needs to be modified once, thereby greatly improving the editing efficiency of the test cases and reducing the design and maintenance cost of the test cases.
Description
Technical Field
The present application relates to the field of testing technologies, and in particular, to a method, a system, an apparatus, and a medium for efficient generation of test cases.
Background
At present, in the process of automatic use case design, the same test logic often occurs, namely repeated test logic exists in different use cases; then, according to such circumstances, when an automation script is written, the same test case will be written multiple times, and when this business logic changes, multiple cases need to be repeatedly modified, which increases the design and maintenance costs of the test case.
Disclosure of Invention
The application aims to solve the problems in the prior art, and provides a method, a system, equipment and a medium for efficiently generating test cases, thereby solving the problems that repeated writing and modification are required and the design and maintenance cost of the test cases are increased in the prior art aiming at repeated test logic in the test cases.
In order to solve the technical problems, the specific technical scheme of the application is as follows:
in one aspect, the application provides a test case efficient generation method, which comprises the following steps:
acquiring a plurality of test cases to be edited;
performing the same test logic definition operation based on a plurality of test cases to be edited to obtain case writing keywords;
responding to a test case generation requirement, acquiring test data corresponding to the test case generation requirement, and generating a test case to be used according to the case writing keyword and the test data.
As an improved solution, the obtaining a plurality of test cases to be edited includes:
confirming a service test flow;
acquiring a plurality of manual cases corresponding to the business test flow;
and respectively taking the plurality of manual cases as a plurality of test cases to be edited.
As an improvement, the same test logic defines operations including:
carrying out commonality analysis on a plurality of test cases to be edited to obtain the same test logic content among the plurality of test cases to be edited;
and defining the same test logic content as a driving keyword, and setting the driving keyword as the use case writing keyword.
As an improved solution, the generating a test case to be used according to the keyword written by the case and the test data includes:
confirming first test logic corresponding to the test case generation requirement;
confirming a first user writing keyword corresponding to the first test logic;
and taking the first case writing keyword as a case template, and inputting the test data into the case template to form the first case writing keyword.
On the other hand, the application also provides a test case high-efficiency generation system, which comprises:
the system comprises a use case acquisition module, a use case analysis module and a use case generation module;
the case acquisition module is used for acquiring a plurality of test cases to be edited;
the case analysis module is used for carrying out the same test logic definition operation based on a plurality of test cases to be edited to obtain case writing keywords;
the case generation module is used for responding to the test case generation requirement, acquiring test data corresponding to the test case generation requirement, and generating a test case to be used according to the case writing keyword and the test data.
As an improved scheme, the use case acquisition module is further used for confirming a service test flow; the use case acquisition module acquires a plurality of manual use cases corresponding to the business test flow; and the case acquisition module takes the manual cases as the test cases to be edited.
As an improved scheme, the use case analysis module is also used for confirming the service test flow; the use case analysis module acquires a plurality of manual use cases corresponding to the business test flow; and the case analysis module takes the manual cases as the test cases to be edited.
As an improved solution, the use case generating module is further configured to confirm a first test logic corresponding to the test case generating requirement; the use case generation module confirms a first use case writing keyword corresponding to the first test logic; the use case generating module takes the first use case writing keyword as a use case template, and inputs the test data into the use case template to form the first use case writing keyword.
In another aspect, the present application also provides a computer readable storage medium, where a computer program is stored, where the computer program when executed by a processor implements the steps of the test case efficient generation method.
In another aspect, the present application further provides a computer device, where the computer device includes a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the communication bus; wherein:
the memory is used for storing a computer program;
the processor is configured to execute the step of the test case efficient generation method by running a program stored on the memory.
The technical scheme of the application has the beneficial effects that:
the high-efficiency generation method of the test cases can separate the test logic from the test call, define the same test logic as the key word, quickly edit different test cases based on the template framework of the key word, write the same test logic once, change the logic in time in the later stage, and only need to modify once, thereby greatly improving the editing efficiency of the test cases and reducing the design and maintenance cost of the test cases.
According to the efficient test case generation system, the test logic and the test call can be separated through the mutual coordination of the case acquisition module, the case analysis module and the case generation module, the same test logic is defined as a keyword, the template framework based on the keyword is used for rapidly editing different test cases, the same test logic is written once, the later logic is changed in time, the editing efficiency of the test cases is greatly improved, and the design and maintenance cost of the test cases is reduced.
The computer readable storage medium can realize the coordination of the guide case acquisition module, the case analysis module and the case generation module, so as to realize the efficient generation method of the test case, and the computer readable storage medium can also effectively improve the operability of the efficient generation method of the test case.
The computer equipment can realize the storage and execution of the computer readable storage medium, thereby realizing the high-efficiency generation method of the test case.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are needed in the description of the embodiments or the prior art will be briefly described, and it is obvious that the drawings in the description below are some embodiments of the present application, and other drawings can be obtained according to the drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a method for efficiently generating test cases according to embodiment 1 of the present application;
FIG. 2 is a schematic logic flow diagram of a method for efficient generation of test cases according to embodiment 1 of the present application;
FIG. 3 is a schematic diagram of a test case efficient generation system according to embodiment 2 of the present application;
FIG. 4 is a schematic diagram of a computer device according to embodiment 4 of the present application;
the labels in the drawings are illustrated as follows:
1501. a processor; 1502. a communication interface; 1503. a memory; 1504. a communication bus.
Detailed Description
The preferred embodiments of the present application will be described in detail below with reference to the accompanying drawings so that the advantages and features of the present application can be more easily understood by those skilled in the art, thereby making clear and defining the scope of the present application.
In the description of the present application, it should be noted that the described embodiments of the present application are some, but not all embodiments of the present application; all other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
The terms first, second and the like in the description and in the claims and in the above-described figures, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments described herein may be capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, apparatus, article, or device that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed or inherent to such process, method, article, or device.
Example 1
The embodiment provides a test case efficient generation method, as shown in fig. 1 and 2, comprising the following steps:
as one implementation mode of the application, the method is based on an automation Framework driven by RIDE and Robot Framework keywords, and the efficient generation of test cases is carried out; particularly, for some use cases with the same test logic, keyword processing is carried out when the use cases are designed, new use cases can be generated by testing keywords of input data when the use cases are written, and the method is convenient and efficient;
as an embodiment of the present application, the principle of the present method is as follows:
analyzing a business test flow needing test case design, and outputting corresponding manual cases, such as test cases 1-1N, 2-2N and 3-3N shown in FIG. 2;
carrying out commonality analysis on the output test cases, namely writing and defining the content of the same test logic in the test cases as a keyword; the keywords defined herein can be used as case templates in the writing of subsequent test cases;
when the use case is written, inquiring a keyword corresponding to the corresponding test logic, taking the keyword as a use case template, and directly inputting corresponding test data to form different test cases; the method separates the test data from the test logic, and can efficiently apply the same test logic to different test requirements.
Example 2
The present embodiment provides a test case efficient generation system based on the same inventive concept as the test case efficient generation method described in embodiment 1, as shown in fig. 3, including: the system comprises a use case acquisition module, a use case analysis module and a use case generation module;
the case acquisition module is used for acquiring a plurality of test cases to be edited;
the case analysis module is used for carrying out the same test logic definition operation based on a plurality of test cases to be edited to obtain case writing keywords;
the case generation module is used for responding to the test case generation requirement, acquiring test data corresponding to the test case generation requirement, and generating a test case to be used according to the case writing keyword and the test data.
As an implementation manner, the use case obtaining module is further configured to confirm a service testing procedure; the use case acquisition module acquires a plurality of manual use cases corresponding to the business test flow; and the case acquisition module takes the manual cases as the test cases to be edited.
As an implementation manner, the use case analysis module is further configured to confirm a service test procedure; the use case analysis module acquires a plurality of manual use cases corresponding to the business test flow; and the case analysis module takes the manual cases as the test cases to be edited.
As one implementation manner, the use case generating module is further configured to confirm a first test logic corresponding to the test case generating requirement; the use case generation module confirms a first use case writing keyword corresponding to the first test logic; the use case generating module takes the first use case writing keyword as a use case template, and inputs the test data into the use case template to form the first use case writing keyword.
Example 3
The present embodiment provides a computer-readable storage medium including:
the storage medium is used for storing computer software instructions for implementing the test case efficient generation method described in the above embodiment 1, and includes a program for executing the above program set for the test case efficient generation method; specifically, the executable program may be built in the test case efficient generation system described in embodiment 2, so that the test case efficient generation system may implement the test case efficient generation method described in embodiment 1 by executing the built-in executable program.
Further, the computer readable storage medium provided in the present embodiment may be any combination of one or more readable storage media, where the readable storage media includes an electric, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof.
Example 4
The present embodiment provides an electronic device, as shown in fig. 4, which may include: the device comprises a processor 1501, a communication interface 1502, a memory 1503 and a communication bus 1504, wherein the processor 1501, the communication interface 1502 and the memory 1503 are in communication with each other through the communication bus 1504.
A memory 1503 for storing a computer program;
the processor 1501 executes the computer program stored in the memory 1503 to implement the steps of the test case efficient generation method described in the above embodiment 1.
As an embodiment of the present application, the communication bus mentioned by the above-mentioned terminal may be a peripheral component interconnect standard (Peripheral Component Interconnect, abbreviated as PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture, abbreviated as EISA) bus, or the like. The communication bus may be classified as an address bus, a data bus, a control bus, or the like. For ease of illustration, only one thick line is shown in fig. 4, but not only one bus or one type of bus.
As an embodiment of the present application, a communication interface is used for communication between the terminal and other devices.
As an embodiment of the present application, the memory may include a random access memory (Random Access Memory, abbreviated as RAM) or may include a non-volatile memory (non-volatile memory), such as at least one disk memory. Optionally, the memory may also be at least one memory device located remotely from the aforementioned processor.
As an embodiment of the present application, the above-mentioned processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, abbreviated as CPU), a network processor (Network Processor, abbreviated as NP), and the like; but also digital signal processors (Digital Signal Processing, DSP for short), application specific integrated circuits (Application Specific Integrated Circuit, ASIC for short), field-programmable gate arrays (Field-Programmable Gate Array, FPGA for short) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
Compared with the prior art, the method, the system, the equipment and the medium for efficiently generating the test cases can separate the test logic from the test call, define the same test logic as a keyword, rapidly edit different test cases based on a template framework of the keyword, write the same test logic once, change the logic in time in the later stage, and also only need to modify once, thereby greatly improving the editing efficiency of the test cases and reducing the design and maintenance cost of the test cases.
It should be understood that, in the various embodiments herein, the sequence number of each process described above does not mean the sequence of execution, and the execution sequence of each process should be determined by its functions and internal logic, and should not constitute any limitation on the implementation process of the embodiments herein.
It should also be understood that in embodiments herein, the term "and/or" is merely one relationship that describes an associated object, meaning that three relationships may exist. For example, a and/or B may represent: a exists alone, A and B exist together, and B exists alone. In addition, the character "/" herein generally indicates that the front and rear associated objects are an "or" relationship.
Those of ordinary skill in the art will appreciate that the elements and algorithm steps described in connection with the embodiments disclosed herein may be embodied in electronic hardware, in computer software, or in a combination of the two, and that the elements and steps of the examples have been generally described in terms of function in the foregoing description to clearly illustrate the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present disclosure.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the foregoing method embodiments, and are not repeated herein.
In the several embodiments provided herein, it should be understood that the disclosed systems, devices, and methods may be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of the units is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. In addition, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices, or elements, or may be an electrical, mechanical, or other form of connection.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the elements may be selected according to actual needs to achieve the objectives of the embodiments herein.
In addition, each functional unit in the embodiments herein may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solutions herein are essentially or portions contributing to the prior art, or all or portions of the technical solutions may be embodied in the form of a software product stored in a storage medium, including several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the embodiments herein. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The foregoing description is only illustrative of the present application and is not intended to limit the scope of the application, and all equivalent structures or equivalent processes or direct or indirect application in other related technical fields are included in the scope of the present application.
Claims (10)
1. The efficient test case generation method is characterized by comprising the following steps of:
acquiring a plurality of test cases to be edited;
performing the same test logic definition operation based on a plurality of test cases to be edited to obtain case writing keywords;
responding to a test case generation requirement, acquiring test data corresponding to the test case generation requirement, and generating a test case to be used according to the case writing keyword and the test data.
2. The efficient test case generation method according to claim 1, wherein:
the obtaining a plurality of test cases to be edited includes:
confirming a service test flow;
acquiring a plurality of manual cases corresponding to the business test flow;
and respectively taking the plurality of manual cases as a plurality of test cases to be edited.
3. The efficient test case generation method according to claim 2, wherein:
the same test logic defines operations including:
carrying out commonality analysis on a plurality of test cases to be edited to obtain the same test logic content among the plurality of test cases to be edited;
and defining the same test logic content as a driving keyword, and setting the driving keyword as the use case writing keyword.
4. A test case efficient generation method as defined in claim 3, wherein:
the generating the test case to be used according to the keyword written by the case and the test data comprises the following steps:
confirming first test logic corresponding to the test case generation requirement;
confirming a first user writing keyword corresponding to the first test logic;
and taking the first case writing keyword as a case template, and inputting the test data into the case template to form the first case writing keyword.
5. A test case efficient generation system, comprising: the system comprises a use case acquisition module, a use case analysis module and a use case generation module;
the case acquisition module is used for acquiring a plurality of test cases to be edited;
the case analysis module is used for carrying out the same test logic definition operation based on a plurality of test cases to be edited to obtain case writing keywords;
the case generation module is used for responding to the test case generation requirement, acquiring test data corresponding to the test case generation requirement, and generating a test case to be used according to the case writing keyword and the test data.
6. The efficient test case generation system of claim 5, wherein:
the use case acquisition module is also used for confirming a service test flow; the use case acquisition module acquires a plurality of manual use cases corresponding to the business test flow; and the case acquisition module takes the manual cases as the test cases to be edited.
7. The efficient test case generation system of claim 6, wherein:
the use case analysis module is also used for confirming a service test flow; the use case analysis module acquires a plurality of manual use cases corresponding to the business test flow; and the case analysis module takes the manual cases as the test cases to be edited.
8. The efficient test case generation system of claim 7, wherein:
the use case generation module is further used for confirming first test logic corresponding to the test case generation requirement; the use case generation module confirms a first use case writing keyword corresponding to the first test logic; the use case generating module takes the first use case writing keyword as a use case template, and inputs the test data into the use case template to form the first use case writing keyword.
9. A computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium, and the computer program when executed by a processor implements the steps of the test case efficient generation method according to any one of claims 1 to 4.
10. A computer device comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface, the memory complete communication with each other through the communication bus; wherein:
the memory is used for storing a computer program;
the processor is configured to execute the steps of the test case efficient generation method according to any one of claims 1 to 4 by running a program stored in the memory.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310929578.4A CN117112402A (en) | 2023-07-27 | 2023-07-27 | Efficient test case generation method, system, equipment and medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310929578.4A CN117112402A (en) | 2023-07-27 | 2023-07-27 | Efficient test case generation method, system, equipment and medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN117112402A true CN117112402A (en) | 2023-11-24 |
Family
ID=88810107
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310929578.4A Pending CN117112402A (en) | 2023-07-27 | 2023-07-27 | Efficient test case generation method, system, equipment and medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117112402A (en) |
-
2023
- 2023-07-27 CN CN202310929578.4A patent/CN117112402A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109542399B (en) | Software development method and device, terminal equipment and computer readable storage medium | |
CN101957745B (en) | Method for converting ladder diagram language into structure text language | |
CN110851134A (en) | Low-code page design device and page design method | |
CN111552633A (en) | Interface abnormal call testing method and device, computer equipment and storage medium | |
CN108170425B (en) | Program code modification method and device and terminal equipment | |
CN109857910B (en) | XML file generation method and device, computer equipment and storage medium | |
CN111026604B (en) | Log file analysis method and device | |
CN117112402A (en) | Efficient test case generation method, system, equipment and medium | |
CN111309299A (en) | Industrial robot language processing method and device, storage medium and electronic equipment | |
US8954307B1 (en) | Chained programming language preprocessors for circuit simulation | |
CN110895460A (en) | Jenkins-based robot system integration method and device and terminal equipment | |
US11762363B2 (en) | Graph display device, graph display method, and recording medium | |
CN111027196A (en) | Simulation analysis task processing method and device for power equipment and storage medium | |
CN113238746A (en) | Hybrid programming control method, device, equipment and storage medium | |
CN114371866A (en) | Version reconfiguration test method, device and equipment of service system | |
CN112527631A (en) | bug positioning method, system, electronic equipment and storage medium | |
CN111401020A (en) | Interface loading method and system and computing equipment | |
EP4068141B1 (en) | Method and system to enable print functionality in high-level synthesis (hls) design platforms | |
CN110990475B (en) | Batch task inserting method and device, computer equipment and storage medium | |
CN112199428B (en) | Application management system, method and terminal equipment of functional data block | |
CN114827143B (en) | Discrete data acquisition method, system, cloud server and edge computing terminal | |
CN113377679A (en) | Code determination method and device, electronic equipment and storage medium | |
CN116820951A (en) | Automatic Web UI testing method, device, equipment and storage medium | |
CN117435638A (en) | Batch number generation method, system, equipment and medium of multi-service system | |
CN110968304A (en) | Method, device and equipment for rapidly configuring page in multi-node process and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication |