CN114238128A - Test case generation method and device, electronic equipment and computer readable medium - Google Patents

Test case generation method and device, electronic equipment and computer readable medium Download PDF

Info

Publication number
CN114238128A
CN114238128A CN202111572450.4A CN202111572450A CN114238128A CN 114238128 A CN114238128 A CN 114238128A CN 202111572450 A CN202111572450 A CN 202111572450A CN 114238128 A CN114238128 A CN 114238128A
Authority
CN
China
Prior art keywords
test case
target components
test
generating
unified
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
Application number
CN202111572450.4A
Other languages
Chinese (zh)
Inventor
赖世能
梅云波
董宏
李晨
李学楠
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Telecom Corp Ltd
Original Assignee
China Telecom Corp Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by China Telecom Corp Ltd filed Critical China Telecom Corp Ltd
Priority to CN202111572450.4A priority Critical patent/CN114238128A/en
Publication of CN114238128A publication Critical patent/CN114238128A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test 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 relates to a test case generation method, a test case generation device, electronic equipment and a computer readable medium. The method comprises the following steps: determining a plurality of target components according to an operation instruction of a user; filling data to be tested into corresponding positions of the target assemblies; generating test case logic for the plurality of target components; generating unified case description data according to the target components and the corresponding test case logics; and converting the unified case description data into a test case. The test case generation method, the test case generation device, the electronic equipment and the computer readable medium can reduce requirements for script capability of testers, reduce enterprise cost, reduce error probability, improve software evaluation efficiency and solve the problem of incompatibility of scripts in different test engine environments.

Description

Test case generation method and device, electronic equipment and computer readable medium
Technical Field
The application relates to the field of software testing, in particular to a test case generation method, a test case generation device, electronic equipment and a computer readable medium.
Background
An API is an Application Programming Interface (API) that describes the characteristics of a class library or how to use it. REST (Representational State Transfer) is used to describe the standard method of creating an HTTP API.
At present, most online systems are developed according to the Rest API specification, adopt a front-end and back-end separation architecture, and exchange data through a json format. Therefore, most conventional test case writing needs to know the access format of a specific Rest API request and then generate a test case by using a syntax or tool specific to an automated test framework, and when writing the test case, the following problems exist: using a test framework requires a certain learning threshold; the time cost for knowing the access format of the Rest API request is high; when the test case is complex, the logic is difficult to understand and the debugging is difficult.
Therefore, a new test case generation method, device, electronic device and computer readable medium are needed.
The above information disclosed in this background section is only for enhancement of understanding of the background of the application and therefore it may contain information that does not constitute prior art that is already known to a person of ordinary skill in the art.
Disclosure of Invention
In view of this, the application provides a test case generation method, a test case generation device, an electronic device, and a computer readable medium, which can reduce requirements for script capability of testers, reduce enterprise cost, reduce error probability, improve software evaluation efficiency, and solve the problem of script incompatibility of different test engine environments.
Other features and advantages of the present application will be apparent from the following detailed description, or may be learned by practice of the application.
According to an aspect of the present application, a method for generating a test case is provided, where the method includes: determining a plurality of target components according to an operation instruction of a user; filling data to be tested into corresponding positions of the target assemblies; generating test case logic for the plurality of target components; generating unified case description data according to the target components and the corresponding test case logics; and converting the unified case description data into a test case.
In an exemplary embodiment of the present application, further comprising: obtaining a Rest API definition document of the component; extracting a Rest API definition, a request path, a request mode, header information and an access parameter format based on the Rest API definition document; and generating an auxiliary template of the component based on the Rest API definition, the request path, the request mode, the header information and the access parameter format.
In an exemplary embodiment of the present application, determining a plurality of target components according to an operation instruction of a user includes: determining a plurality of target components from the component area according to the operation instruction of the user; dragging the plurality of target components from the component area to an editing area; and receiving an operation instruction of a target component by a user in the editing area so as to display the auxiliary template.
In an exemplary embodiment of the present application, filling data to be tested into corresponding positions of the plurality of target components includes: and sequentially filling the data to be tested into corresponding positions in the auxiliary templates of the target assemblies.
In an exemplary embodiment of the present application, generating test case logic for the plurality of target components includes: obtaining the connection operation of a user among the target components; and generating the test case logic based on the connecting line logic among the target components.
In an exemplary embodiment of the present application, generating unified case description data according to the target components and their corresponding test case logics includes: converting the test case logic into test step data; generating the unified use case description data based on the test step data and the plurality of target components.
In an exemplary embodiment of the present application, converting the unified case description data into a test case includes: and converting the unified use case description data into a test script based on a plurality of programming languages.
According to an aspect of the present application, a test case generation apparatus is provided, the apparatus including: the instruction module is used for determining a plurality of target components according to the operation instructions of the user; the filling module is used for filling the data to be tested into the corresponding positions of the target assemblies; the logic module is used for generating test case logic of the target components; the description module is used for generating unified case description data according to the target components and the corresponding test case logics; and the conversion module is used for converting the unified case description data into a test case.
According to an aspect of the present application, an electronic device is provided, the electronic device including: one or more processors; storage means for storing one or more programs; when executed by one or more processors, cause the one or more processors to implement a method as above.
According to an aspect of the application, a computer-readable medium is proposed, on which a computer program is stored, which program, when being executed by a processor, carries out the method as above.
According to the test case generation method, the test case generation device, the electronic equipment and the computer readable medium, a plurality of target assemblies are determined according to the operation instruction of a user; filling data to be tested into corresponding positions of the target assemblies; generating test case logic for the plurality of target components; generating unified case description data according to the target components and the corresponding test case logics; the mode of converting the unified case description data into the test case can reduce the script capability requirement on testers, reduce the enterprise cost, reduce the error probability, improve the software evaluation efficiency and solve the problem of incompatible scripts in different test engine environments.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
Drawings
The above and other objects, features and advantages of the present application will become more apparent by describing in detail exemplary embodiments thereof with reference to the attached drawings. The drawings described below are only some embodiments of the present application, and other drawings may be derived from those drawings by those skilled in the art without inventive effort.
FIG. 1 is a flow diagram illustrating a method for test case generation in accordance with an exemplary embodiment.
FIG. 2 is a diagram illustrating a test case generation method according to an example embodiment.
FIG. 3 is a flowchart illustrating a test case generation method according to another example embodiment.
FIG. 4 is a diagram illustrating a test case generation method according to an example embodiment.
FIG. 5 is a diagram illustrating a test case generation method according to an example embodiment.
Fig. 6 is a block diagram illustrating a test case generation apparatus according to an example embodiment.
FIG. 7 is a block diagram illustrating an electronic device in accordance with an example embodiment.
FIG. 8 is a block diagram illustrating a computer-readable medium in accordance with an example embodiment.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art. The same reference numerals denote the same or similar parts in the drawings, and thus, a repetitive description thereof will be omitted.
Furthermore, the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the application. One skilled in the relevant art will recognize, however, that the subject matter of the present application can be practiced without one or more of the specific details, or with other methods, components, devices, steps, and so forth. In other instances, well-known methods, devices, implementations, or operations have not been shown or described in detail to avoid obscuring aspects of the application.
The block diagrams shown in the figures are functional entities only and do not necessarily correspond to physically separate entities. I.e. these functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor means and/or microcontroller means.
The flow charts shown in the drawings are merely illustrative and do not necessarily include all of the contents and operations/steps, nor do they necessarily have to be performed in the order described. For example, some operations/steps may be decomposed, and some operations/steps may be combined or partially combined, so that the actual execution sequence may be changed according to the actual situation.
It will be understood that, although the terms first, second, third, etc. may be used herein to describe various components, these components should not be limited by these terms. These terms are used to distinguish one element from another. Thus, a first component discussed below may be termed a second component without departing from the teachings of the present concepts. As used herein, the term "and/or" includes any and all combinations of one or more of the associated listed items.
It will be appreciated by those skilled in the art that the drawings are merely schematic representations of exemplary embodiments, and that the blocks or processes shown in the drawings are not necessarily required to practice the present application and are, therefore, not intended to limit the scope of the present application.
The test case compiling is used as the main work of the software evaluating flow, and the efficiency, the quality and the accuracy of the test case compiling are not only related to the self-ability of a tester, but also have great relation to a tester. When the existing tool writes a test case, such as a jmeter, a robotframe and the like, whether a path, a mode and parameters of a request are correct or not cannot be verified when a Rest API is called; and an intuitive way is lacked to describe the relationship among all elements in the test case; in addition, the test tool needs to be installed locally before it can be used. Aiming at the series of problems, the patent provides a test case generation method, a Rest API test case is generated on line through a graphic stream, the test case can be compiled on a page only in a networking environment, so that testers can conveniently know the logic structure of the whole test case, and the efficiency, the quality and the accuracy of compiling the test case are improved.
FIG. 1 is a flow diagram illustrating a method for test case generation in accordance with an exemplary embodiment. The test case generating method 10 at least includes steps S102 to S110.
As shown in fig. 1, in S102, a plurality of target components are determined according to an operation instruction of a user. And receiving the selection of the user on the components, and determining a plurality of target components according to the click of the user.
In one embodiment, further comprising: obtaining a Rest API definition document of the component; extracting a Rest API definition, a request path, a request mode, header information and an access parameter format based on the Rest API definition document; and generating an auxiliary template of the component based on the Rest API definition, the request path, the request mode, the header information and the access parameter format.
In one embodiment, a plurality of target components can be determined by the component area according to the operation instruction of the user; dragging the plurality of target components from the component area to an editing area; and receiving an operation instruction of a target component by a user in the editing area so as to display the auxiliary template.
In S104, filling the data to be tested into the corresponding positions of the target components. And sequentially filling the data to be tested into corresponding positions in the auxiliary templates of the target assemblies.
In S106, test case logic of the plurality of target components is generated. Obtaining the connection operation of a user among the target components; and generating the test case logic based on the connecting line logic among the target components.
In S108, unified case description data is generated according to the target components and the corresponding test case logics thereof. Converting the test case logic into test step data; generating the unified use case description data based on the test step data and the plurality of target components.
In one embodiment, the graphics stream data generated in the above step is converted into a unified use case description by a unified use case description conversion module. The unified case description mainly comprises test steps (namely, steps array fields), wherein the test steps comprise key word calling, branching, cycle control and the like. Meanwhile, keywords can be built in, such as sending requests, assertions, assignments, extracting request results and the like.
More specifically, a custom function can be created in the unified use case description, and repeated test steps are packaged into the function. For example, in a jmeter conversion plug-in, a custom function can be encapsulated using a Test Fragment element. The unified case description reserves certain expandability, and for testers with strong coding capability, complex test logic can be realized by creating custom keywords. For example, a tester can implement a jmeter custom Java Request element through Java code and then reference it in the unified use case description.
In S110, the unified case description data is converted into a test case. And converting the unified use case description data into a test script based on a plurality of programming languages.
The application can use Java, python, golang, and other languages to develop the engine adaptation and conversion module, so as to implement that the unified case description is converted into a test engine format file (executable script) after being traversed by the bottom layer engine adaptation module in cooperation with the plug-in, for example, the unified case description data is converted into a jmeter script format or other script formats, which is not limited in this application.
The test case generation method has the following advantages:
compiling a test case in a graphic stream mode, and visually displaying the logic of the test case;
by introducing the Rest API definition to assist in editing the test case, human errors are reduced;
the test case compiling is isolated from the bottom layer test engine by using the unified case description, and then the test case can be flexibly converted into formats of different test engines by a plug-in mode.
FIG. 2 is a diagram illustrating a test case generation method according to an example embodiment. In a specific application scenario, the test case generation method in the application can be divided into a plurality of functional modules. As shown in fig. 2, the main functional modules include: the system comprises a Rest API analysis module, a front-end graphics stream editing module, a unified use case description conversion module and a bottom engine adaptation and conversion module.
The Rest API analysis module provides an interface for importing a Rest API definition document, analyzes the correctness of the imported Rest API definition document and stores the document in the system, and also provides an access interface for the front-end graphics stream editing module to enable the graphics stream editing page to display corresponding parameters in editing Rest API elements.
The front-end graphic stream editing module provides a front-end graphic stream editing page, the page provides elements such as a Rest API, assertions and branches, and testers edit the elements and combine the elements in the page in a connection mode, so that a test case is formed. When editing the original result API element, the page displays the imported result API, and different parameters are displayed by the page to be filled in by a tester by selecting different result APIs.
The unified use case description conversion module provides the capability of converting the front-end graphics stream editing data into unified use case description. The unified case description is defined by a format specification for describing test cases, and various elements, attributes and inclusion relations of the elements, such as the test cases, test steps, branch assertions and the like, are defined in the specification.
The bottom layer engine adaptation and conversion module provides the capability of accessing and traversing the unified case description, defines a conversion interface and realizes the conversion from the unified case description to a specific test engine format file through the conversion interface. For example, a person familiar with robotframe format scripts may implement the above-described translation interface, providing a robotframe translation plug-in.
According to the test case generation method, a plurality of target assemblies are determined according to the operation instruction of a user; filling data to be tested into corresponding positions of the target assemblies; generating test case logic for the plurality of target components; generating unified case description data according to the target components and the corresponding test case logics; the mode of converting the unified case description data into the test case can reduce the script capability requirement on testers, reduce the enterprise cost, reduce the error probability, improve the software evaluation efficiency and solve the problem of incompatible scripts in different test engine environments.
It should be clearly understood that this application describes how to make and use particular examples, but the principles of this application are not limited to any details of these examples. Rather, these principles can be applied to many other embodiments based on the teachings of the present disclosure.
FIG. 3 is a flowchart illustrating a test case generation method according to another example embodiment. The flow 30 shown in FIG. 3 is a detailed description of the "test case logic for generating the plurality of target components" of S106 in the flow shown in FIG. 2.
As shown in fig. 3, in S302, a plurality of target components are determined from the component area according to an operation instruction of the user. A component area and an edit area may be exposed in the user interface, where the component area provides components such as HTTP requests, response assertions, branches, and the like.
In S304, the plurality of target components are dragged from the component area to the editing area. And dragging the selected components in the component area to the editing area by the tester in a dragging mode.
In S306, an operation instruction of the target component by the user is received in the editing area to display the auxiliary template.
In S308, the data to be tested is sequentially filled into corresponding positions in the auxiliary templates of the target assemblies. The tester can enter the component editing page by double-clicking the component to complete test data filling.
FIG. 4 is a diagram illustrating a test case generation method according to another example embodiment. As shown in fig. 4, a result API list of the imported module a is shown on the component editing page, the tester selects a result API request to be tested and fills in the parameter data, edits the assertion information to assert the status code, and selects to end or initiate another result API request according to the assertion result. The text in fig. 4 is only used as an exemplary description and is not the basis of the present technology.
In S310, the test case logic is generated based on the connection logic between the target components. As shown in FIG. 5, the test case logic may be plotted by wires. And parameters such as logic judgment criteria and the like can be added on the connecting line.
According to the test case generation method, the test cases are edited graphically, so that the method is simple and visual, is convenient and fast to operate, greatly reduces the requirements on the script capability of testers, and reduces the enterprise cost; the fact that access parameters are specified by using the Rest API definition reduces the error rate and improves the software evaluation efficiency; by unifying the case description, the test case compiling is decoupled from the specific test engine, and the problem of incompatible scripts in different test engine environments is solved.
Those skilled in the art will appreciate that all or part of the steps implementing the above embodiments are implemented as computer programs executed by a CPU. When executed by the CPU, performs the functions defined by the methods provided herein. The program may be stored in a computer readable storage medium, which may be a read-only memory, a magnetic or optical disk, or the like.
Furthermore, it should be noted that the above-mentioned figures are only schematic illustrations of the processes involved in the method according to exemplary embodiments of the present application, and are not intended to be limiting. It will be readily understood that the processes shown in the above figures are not intended to indicate or limit the chronological order of the processes. In addition, it is also readily understood that these processes may be performed synchronously or asynchronously, e.g., in multiple modules.
The following are embodiments of the apparatus of the present application that may be used to perform embodiments of the method of the present application. For details which are not disclosed in the embodiments of the apparatus of the present application, reference is made to the embodiments of the method of the present application.
Fig. 6 is a block diagram illustrating a test case generation apparatus according to another exemplary embodiment. As shown in fig. 6, the test case generation apparatus 60 includes: instruction module 602, fill module 604, logic module 606, description module 608, and translation module 610.
The instruction module 602 is configured to determine a plurality of target components according to an operation instruction of a user; the instruction module 602 is further configured to determine a plurality of target components from the component area according to the operation instruction of the user; dragging the plurality of target components from the component area to an editing area; and receiving an operation instruction of a target component by a user in the editing area so as to display the auxiliary template.
The filling module 604 is configured to fill the data to be tested into the corresponding positions of the target components; the filling module 604 is further configured to sequentially fill the data to be tested into corresponding positions in the auxiliary templates of the target assemblies.
The logic module 606 is configured to generate test case logic of the target components; the logic module 606 is further configured to obtain a connection operation between the target components by the user; and generating the test case logic based on the connecting line logic among the target components.
The description module 608 is configured to generate unified case description data according to the multiple target components and the test case logics corresponding to the target components; the description module 608 is further configured to convert the test case logic into test step data; generating the unified use case description data based on the test step data and the plurality of target components.
The converting module 610 is configured to convert the unified case description data into a test case. The conversion module 610 is further configured to convert the unified use case description data into a test script based on a plurality of programming languages.
According to the test case generation device, a plurality of target components are determined according to the operation instruction of a user; filling data to be tested into corresponding positions of the target assemblies; generating test case logic for the plurality of target components; generating unified case description data according to the target components and the corresponding test case logics; the mode of converting the unified case description data into the test case can reduce the script capability requirement on testers, reduce the enterprise cost, reduce the error probability, improve the software evaluation efficiency and solve the problem of incompatible scripts in different test engine environments.
FIG. 7 is a block diagram illustrating an electronic device in accordance with an example embodiment.
An electronic device 700 according to this embodiment of the present application is described below with reference to fig. 7. The electronic device 700 shown in fig. 7 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 7, electronic device 700 is embodied in the form of a general purpose computing device. The components of the electronic device 700 may include, but are not limited to: at least one processing unit 710, at least one memory unit 720, a bus 730 that connects the various system components (including the memory unit 720 and the processing unit 710), a display unit 740, and the like.
Wherein the storage unit stores program code that can be executed by the processing unit 710 such that the processing unit 710 performs the steps according to various exemplary embodiments of the present application described in the present specification. For example, the processing unit 710 may perform the steps as shown in fig. 2 and 3.
The memory unit 720 may include readable media in the form of volatile memory units, such as a random access memory unit (RAM)7201 and/or a cache memory unit 7202, and may further include a read only memory unit (ROM) 7203.
The memory unit 720 may also include a program/utility 7204 having a set (at least one) of program modules 7205, such program modules 7205 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
Bus 730 may be any representation of one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
The electronic device 700 may also communicate with one or more external devices 700' (e.g., keyboard, pointing device, bluetooth device, etc.), such that a user can communicate with devices with which the electronic device 700 interacts, and/or any devices (e.g., router, modem, etc.) with which the electronic device 700 can communicate with one or more other computing devices. Such communication may occur via an input/output (I/O) interface 750. Also, the electronic device 700 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network such as the internet) via the network adapter 760. The network adapter 760 may communicate with other modules of the electronic device 700 via the bus 730. It should be appreciated that although not shown in the figures, other hardware and/or software modules may be used in conjunction with the electronic device 700, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, as shown in fig. 8, the technical solution according to the embodiment of the present application may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which may be a personal computer, a server, or a network device, etc.) to execute the above method according to the embodiment of the present application.
The software product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The computer readable storage medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable storage medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
The computer readable medium carries one or more programs which, when executed by a device, cause the computer readable medium to perform the functions of: determining a plurality of target components according to an operation instruction of a user; filling data to be tested into corresponding positions of the target assemblies; generating test case logic for the plurality of target components; generating unified case description data according to the target components and the corresponding test case logics; and converting the unified case description data into a test case. The computer readable medium may also implement the following functions: obtaining a Rest API definition document of the component; extracting a Rest API definition, a request path, a request mode, header information and an access parameter format based on the Rest API definition document; and generating an auxiliary template of the component based on the Rest API definition, the request path, the request mode, the header information and the access parameter format.
Those skilled in the art will appreciate that the modules described above may be distributed in the apparatus according to the description of the embodiments, or may be modified accordingly in one or more apparatuses unique from the embodiments. The modules of the above embodiments may be combined into one module, or further split into multiple sub-modules.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiment of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the embodiment of the present application.
Exemplary embodiments of the present application are specifically illustrated and described above. It is to be understood that the application is not limited to the details of construction, arrangement, or method of implementation described herein; on the contrary, the intention is to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims.

Claims (10)

1. A test case generation method is characterized by comprising the following steps:
determining a plurality of target components according to an operation instruction of a user;
filling data to be tested into corresponding positions of the target assemblies;
generating test case logic for the plurality of target components;
generating unified case description data according to the target components and the corresponding test case logics;
and converting the unified case description data into a test case.
2. The method of claim 1, further comprising:
obtaining a Rest API definition document of the component;
extracting a Rest API definition, a request path, a request mode, header information and an access parameter format based on the Rest API definition document;
and generating an auxiliary template of the component based on the Rest API definition, the request path, the request mode, the header information and the access parameter format.
3. The method of claim 2, wherein determining the plurality of target components according to the user's operation instructions comprises:
determining a plurality of target components from the component area according to the operation instruction of the user;
dragging the plurality of target components from the component area to an editing area;
and receiving an operation instruction of a target component by a user in the editing area so as to display the auxiliary template.
4. The method of claim 3, wherein populating corresponding locations of the plurality of target components with data to be tested comprises:
and filling data to be tested into corresponding positions of the auxiliary templates of the target assemblies.
5. The method of claim 1, wherein generating the test case logic for the plurality of target components comprises:
obtaining the connection operation of a user among the target components;
and generating the test case logic based on the connecting line logic among the target components.
6. The method of claim 1, wherein generating unified case description data from the plurality of target components and their corresponding test case logic comprises:
converting the test case logic into test step data;
generating the unified use case description data based on the test step data and the plurality of target components.
7. The method of claim 1, wherein converting the unified case description data into test cases comprises:
and converting the unified use case description data into a test script based on a plurality of programming languages.
8. A test case generation apparatus, comprising:
the instruction module is used for determining a plurality of target components according to the operation instructions of the user;
the filling module is used for filling the data to be tested into the corresponding positions of the target assemblies;
the logic module is used for generating test case logic of the target components;
the description module is used for generating unified case description data according to the target components and the corresponding test case logics;
and the conversion module is used for converting the unified case description data into a test case.
9. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-7.
10. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-7.
CN202111572450.4A 2021-12-21 2021-12-21 Test case generation method and device, electronic equipment and computer readable medium Pending CN114238128A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111572450.4A CN114238128A (en) 2021-12-21 2021-12-21 Test case generation method and device, electronic equipment and computer readable medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111572450.4A CN114238128A (en) 2021-12-21 2021-12-21 Test case generation method and device, electronic equipment and computer readable medium

Publications (1)

Publication Number Publication Date
CN114238128A true CN114238128A (en) 2022-03-25

Family

ID=80760389

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111572450.4A Pending CN114238128A (en) 2021-12-21 2021-12-21 Test case generation method and device, electronic equipment and computer readable medium

Country Status (1)

Country Link
CN (1) CN114238128A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117472787A (en) * 2023-12-27 2024-01-30 山东泽鹿安全技术有限公司 Test case generation method, device, medium and equipment for vehicle-mounted computer fuzzy test

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117472787A (en) * 2023-12-27 2024-01-30 山东泽鹿安全技术有限公司 Test case generation method, device, medium and equipment for vehicle-mounted computer fuzzy test
CN117472787B (en) * 2023-12-27 2024-03-15 山东泽鹿安全技术有限公司 Test case generation method, device, medium and equipment for vehicle-mounted computer fuzzy test

Similar Documents

Publication Publication Date Title
US20230367559A1 (en) Development environment for real-time dataflow programming language
US10642721B2 (en) Generation of automated testing scripts by converting manual test cases
CN107506300B (en) User interface testing method, device, server and storage medium
CN113900958A (en) Test case script generation method, system, medium and electronic device
US20090019427A1 (en) Method and Apparatus for Providing Requirement Driven Static Analysis of Test Coverage for Web-Based, Distributed Processes
US7890536B2 (en) Generating templates of nodes to structure content objects and steps to process the content objects
US9626432B2 (en) Defect record classification
US8856749B2 (en) Multi-path brokered test automation execution
JP2022039973A (en) Method and apparatus for quality control, electronic device, storage medium, and computer program
CN112732576B (en) Automatic testing method, device and equipment based on user interface
KR20140116438A (en) Graphical representation of an order of operations
CN111309621A (en) Interface test method, system, equipment and storage medium
CN114238128A (en) Test case generation method and device, electronic equipment and computer readable medium
US11119892B2 (en) Method, device and computer-readable storage medium for guiding symbolic execution
McInnes et al. Formalizing functional flow block diagrams using process algebra and metamodels
CN109684207B (en) Method and device for packaging operation sequence, electronic equipment and storage medium
CN115495362A (en) Method, device, storage medium and computer equipment for generating test code
CN113885841A (en) Script generation method and device, electronic equipment and readable medium
CN111414330B (en) Data editing method and system, data processing device and storage medium
CN110348127B (en) Method, device, equipment and storage medium for generating test cases
Pradhan User interface test automation and its challenges in an industrial scenario
CN118377722A (en) Page test method, device, equipment, medium and program product
CN114490330A (en) Method and device for generating test case
CN114416571A (en) Interface testing method, device, equipment and storage medium
CN112817852A (en) Interface test method and device and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination