CN111367791A - Method, device, medium and electronic equipment for generating test case - Google Patents

Method, device, medium and electronic equipment for generating test case Download PDF

Info

Publication number
CN111367791A
CN111367791A CN202010102329.4A CN202010102329A CN111367791A CN 111367791 A CN111367791 A CN 111367791A CN 202010102329 A CN202010102329 A CN 202010102329A CN 111367791 A CN111367791 A CN 111367791A
Authority
CN
China
Prior art keywords
information
test case
matching
logic code
operation source
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.)
Granted
Application number
CN202010102329.4A
Other languages
Chinese (zh)
Other versions
CN111367791B (en
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.)
Beijing ByteDance Network Technology Co Ltd
Original Assignee
Beijing ByteDance Network Technology Co 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 Beijing ByteDance Network Technology Co Ltd filed Critical Beijing ByteDance Network Technology Co Ltd
Priority to CN202010102329.4A priority Critical patent/CN111367791B/en
Publication of CN111367791A publication Critical patent/CN111367791A/en
Application granted granted Critical
Publication of CN111367791B publication Critical patent/CN111367791B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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 disclosure provides a method, a device, a medium and an electronic device for generating a test case. The method comprises the following steps: acquiring operation source information of a tested process; retrieving an operation source logic code set based on the operation source information to obtain a corresponding operation source logic code; the operation source logic code comprises a preset operation logic code which is used for explaining and running; analyzing the operation source logic code according to a code encoding rule to acquire first operation information and one or more corresponding first operation values; and matching the first operation information and the first operation value with the operation information and the corresponding operation value in the test case data set to obtain a first matching test case. The method and the device reduce errors and low efficiency caused by manually compiling the test cases, generate the test case data set, and improve the repeated utilization rate and the efficiency of generating the test cases.

Description

Method, device, medium and electronic equipment for generating test case
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method, an apparatus, a medium, and an electronic device for generating a test case.
Background
Software generates test cases (Software Testing), which describe a process used to facilitate the verification of the correctness, integrity, security, and quality of Software. In other words, a software-generated test case is a process of auditing or comparing between actual output and expected output. Is defined as: the process of operating a program under specified conditions to discover program errors, to measure software quality, and to evaluate whether it meets design requirements.
Software generates test cases is the process of using manual operations or software auto-runs to verify that it meets specified requirements or to figure out differences between expected results and actual results.
Currently, the generation of test cases for Web projects mainly depends on the manual generation of test cases and the script generation of test cases. The method comprises the steps that a script generates a test case script, a professional needs to compile the test case script, the test case script needs to completely cover all branches of a software flow, a plurality of test case generating cases are generated, a test case generating mode for generating the test case script is manually compiled, and test case generating efficiency is low.
Disclosure of Invention
This summary is provided to introduce a selection of concepts in a simplified form that are further described below in the detailed description. This summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
An object of the present disclosure is to provide a method, an apparatus, a medium, and an electronic device for generating a test case, which can solve at least one of the above-mentioned technical problems. The specific scheme is as follows:
according to a specific embodiment of the present disclosure, in a first aspect, the present disclosure provides a method for generating a test case, including:
acquiring operation source information of a tested process;
retrieving an operation source logic code set based on the operation source information, and acquiring a corresponding operation source logic code; the operation source logic code comprises a preset operation logic code which is used for explaining and running;
analyzing the operation source logic code according to a code encoding rule to acquire first operation information and one or more corresponding first operation values;
and matching the first operation information and the first operation value with the operation information and the corresponding operation value in the test case data set to obtain a first matching test case.
According to a second aspect, the present disclosure provides an apparatus for generating a test case, including:
the operation source information acquisition unit is used for acquiring the operation source information of the tested process;
an operation source logic code obtaining unit, configured to retrieve an operation source logic code set based on the operation source information, and obtain a corresponding operation source logic code; the operation source logic code comprises a preset operation logic code which is used for explaining and running;
the analysis operation source logic code unit is used for analyzing the operation source logic code according to a code coding rule and acquiring first operation information and one or more corresponding first operation values;
and the test case obtaining unit is used for matching the first operation information and the first operation value with the operation information and the corresponding operation value in the test case data set to obtain a first matching test case.
According to a third aspect, there is provided a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the method of generating test cases according to any of the first aspects.
According to a fourth aspect thereof, the present disclosure provides an electronic device, comprising: one or more processors; a storage device, configured to store one or more programs, which when executed by the one or more processors, cause the one or more processors to implement the method for generating test cases according to any one of the first aspect.
Compared with the prior art, the scheme of the embodiment of the disclosure at least has the following beneficial effects:
the disclosure provides a method, a device, a medium and an electronic device for generating a test case. The method comprises the following steps: acquiring operation source information of a tested process; retrieving an operation source logic code set based on the operation source information, and acquiring a corresponding operation source logic code; the operation source logic code comprises a preset operation logic code which is used for explaining and running; analyzing the operation source logic code according to a code encoding rule to acquire first operation information and one or more corresponding first operation values; and matching the first operation information and the first operation value with the operation information and the corresponding operation value in the test case data set to obtain a first matching test case. The method and the device reduce errors and low efficiency caused by manually compiling the test cases, generate the test case data set, and improve the repeated utilization rate and the efficiency of generating the test cases.
Drawings
The above and other features, advantages and aspects of various embodiments of the present disclosure will become more apparent by referring to the following detailed description when taken in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numbers refer to the same or similar elements. It should be understood that the drawings are schematic and that elements and features are not necessarily drawn to scale. In the drawings:
FIG. 1 shows a flow diagram of a method of generating test cases according to an embodiment of the present disclosure;
FIG. 2 shows a block diagram of elements of an apparatus for generating test cases according to an embodiment of the present disclosure;
fig. 3 shows an electronic device connection structure schematic according to an embodiment of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but rather are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order, and/or performed in parallel. Moreover, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "include" and variations thereof as used herein are open-ended, i.e., "including but not limited to". The term "based on" is "based, at least in part, on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions for other terms will be given in the following description.
It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.
It is noted that references to "a", "an", and "the" modifications in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.
The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
Alternative embodiments of the present disclosure are described in detail below with reference to the accompanying drawings.
The first embodiment provided by the present disclosure, namely, an embodiment of a method for generating a test case.
The following describes an embodiment of the present disclosure in detail with reference to fig. 1, where fig. 1 is a flowchart of a method for generating a test case provided by the embodiment of the present disclosure.
Step S101, obtaining the operation source information of the tested process.
The operation source information is operation information obtained after the process to be tested is operated. For example, the activated page of the tested process includes a confirmation key, and when the confirmation key is clicked, the action information generated by the confirmation key is the operation source information.
The operation source information of the tested process is obtained, and the operation message is usually intercepted through a hook function. The hook function can be set in the tested process or in an independent daemon process.
A plug-in is a program written in an application program interface that conforms to a specification. Many software has plug-ins, and there are numerous types of plug-ins. The universal plug-in includes: flash plug-ins, RealPlayer plug-ins, MMS plug-ins, MIDI staff plug-ins or ActiveX plug-ins. Such as Winamp's DFX plug-in. There are also many plug-ins newly developed by programmers for specific purposes.
For example, the obtaining of the operation source information of the tested process includes the following specific steps: and intercepting the operation source information of the tested process through the interception plug-in.
Namely, a hook function is set in the interception plug-in, and when the tested process runs, the interception plug-in is called to intercept the operation source information; when the tested process runs in the browser, intercepting the operation source information of the tested process through an interception plug-in installed in the browser.
In order to enable the operation source information to be recognized, the operation source information conforms to a preset format.
And step S102, retrieving an operation source logic code set based on the operation source information, and acquiring a corresponding operation source logic code.
Wherein the operation source logic code comprises a preset operation logic code which is used for explaining and running.
For example, the operation source logic code is script code.
Script code, a code program stored in plain text, is an extension of batch files, and a script is usually run by interpretation rather than compilation. The script program is a combination of a certain series of operations for controlling the computer to perform arithmetic operations, and can realize a certain logical branch or the like. Compared with a common program, the script program is relatively close to a natural language, can be interpreted and executed without compiling, and is beneficial to quick development or some light-weight control. For example, Puppeteer language code, JavaScript language code, or JSP language code. The present disclosure implements the set of operation source logic code for saving operation source logic code. The method comprises the following steps: a data table, a spreadsheet, a text file, or a configuration file of a database.
Operating a source logical code set, comprising: operation source information and corresponding operation source logic code. The operation source logic code is code for simulating interpreted execution associated with the operation source information, i.e., a piece of program for restoring the operation source information. For example, the operation source logical code is a script conforming to the Puppeteer syntax.
Puppeteer is a library of nodes that control the thread Chrome browser via the development tool protocol. The Chrome browser can be directly controlled by the application program interface provided by Puppeneer to simulate most user operations so as to perform user interface tests or collect data as a crawler accesses a page.
Step S103, analyzing the operation source logic code according to the code encoding rule, and acquiring first operation information and one or more corresponding first operation values.
The code encoding rule is a grammar rule of a code programming language writing program. E.g., Puppeteer syntax rules.
The first operation information is different from the operation source information, and the first operation information is operation information conforming to a code encoding rule. For example, continuing the above example, the code encoding rule is a rule that conforms to the Puppeneer script syntax; the first operation information is operation information complying with the syntax rule of the Puppeteer script in the script of the Puppeteer syntax.
The first operation information has one or more first operation values. For example, when the first operation information has a plurality of first operation values, it indicates that the first operation information is flow branch operation information;
and step S104, matching the first operation information and the first operation value with the operation information and the corresponding operation value in the test case data set to obtain a first matching test case.
A test case dataset comprising: the test system comprises operation information, corresponding operation values and test cases corresponding to the operation information and the operation values.
The step of matching the first operation information and the first operation value with the operation information and the corresponding operation value in the test case data set to obtain a first matching test case comprises the following specific steps:
and step S104-1, matching the first operation information and the first operation value with the operation information and the corresponding operation value in the test case data set.
And step S104-2, when the matching fails, generating a corresponding first matching test case according to the logical relationship between the first operation information and the first operation value.
For example, continuing with the above example, when the first operation information has a one-to-many logical relationship with the first operation value, then it is determined that the first operation information is flow branch operation information; further, the generated first matching test case is a plurality of test cases covering flow branch operations.
Optionally, after the corresponding first matching test case is generated according to the logical relationship between the first operation information and the first operation value, the method further includes the following specific steps:
step S104-2-1, storing the first operation information, the first operation value and the first matching test case into the test case data set.
And the generated information associated with the first matching test case is stored in the test case data set, so that the judgment process of the same information is reduced, and the efficiency of generating the test case is improved.
And step S104-3, when the matching is successful, acquiring a first matching test case from the test case data set.
The first matching test case is directly obtained from the test case data set, and the efficiency of generating the test case is improved.
In addition, in order to improve the testing effect, the embodiment of the disclosure provides a step of statistical analysis of the testing work.
The method also comprises the following specific steps:
step S105, testing the tested process based on the first matching test case, and generating test result information.
And step S106, analyzing and counting the test result information to generate a test report.
When the test result information is analyzed, unreasonable result information (for example, information greatly different from actual operation result information) in the test result information can be eliminated, so that the accuracy of a test report is improved.
The embodiment of the invention reduces errors and low efficiency caused by manually compiling the test cases, generates the test case data set, and improves the repeated utilization rate and the efficiency of generating the test cases.
Corresponding to the first embodiment provided by the present disclosure, the present disclosure also provides a second embodiment, that is, an apparatus for generating a test case. Since the second embodiment is basically similar to the first embodiment, the description is simple, and the relevant portions should be referred to the corresponding description of the first embodiment. The device embodiments described below are merely illustrative.
FIG. 2 illustrates an embodiment of an apparatus for generating a test case provided by the present disclosure. Fig. 2 is a block diagram of units of an apparatus for generating a test case according to an embodiment of the present disclosure.
Referring to fig. 2, the present disclosure provides an apparatus for generating a test case, including: an operation source information acquiring unit 201, an operation source logic code acquiring unit 202, an operation source logic code analyzing unit 203 and a test case acquiring unit 204.
An obtaining operation source information unit 201, configured to obtain operation source information of a process under test;
an operation source logic code obtaining unit 202, configured to retrieve an operation source logic code set based on the operation source information, and obtain a corresponding operation source logic code; the operation source logic code comprises a preset operation logic code which is used for explaining and running;
an analysis operation source logic code unit 203, configured to analyze the operation source logic code according to a code encoding rule, and obtain first operation information and one or more corresponding first operation values;
the get test case unit 204 is configured to match the first operation information and the first operation value with the operation information and the corresponding operation value in the test case data set, and get a first matching test case.
Optionally, the obtaining operation source information unit 201 includes:
and the plug-in interception subunit is used for intercepting the operation source information by intercepting the plug-in.
Optionally, the obtaining test case unit 204 includes:
the matching subunit is used for matching the first operation information and the first operation value with the operation information and the corresponding operation value in the test case data set;
the matching failure subunit is used for generating a corresponding first matching test case according to the logical relationship between the first operation information and the first operation value when the output result of the matching subunit is matching failure;
and the matching success subunit is used for acquiring a first matching test case from the test case data set when the output result of the matching subunit is matching success.
Optionally, in the matching failure subunit, the method further includes:
and the information saving subunit is configured to save the first operation information, the first operation value, and the first matching test case into the test case dataset after the corresponding first matching test case is generated according to the logical relationship between the first operation information and the first operation value.
Optionally, the operation source logic code is a script conforming to Puppeteer syntax; the code encoding rules are rules that conform to the Puppeneer script syntax.
Optionally, the apparatus further comprises:
and the test result information generating unit is used for testing the tested process based on the first matching test case and generating test result information.
Optionally, the apparatus further comprises:
and the test report generating unit is used for analyzing and counting the test result information after the test result information is generated, and generating a test report.
The embodiment of the invention reduces errors and low efficiency caused by manually compiling the test cases, generates the test case data set, and improves the repeated utilization rate and the efficiency of generating the test cases.
The embodiment of the present disclosure provides a third embodiment, that is, an electronic device, where the electronic device is used in a method for generating a test case, and the electronic device includes: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the one processor to cause the at least one processor to perform the method of generating test cases as described in the first embodiment.
The fourth embodiment provides a computer storage medium for generating test cases, where the computer storage medium stores computer-executable instructions that can execute the method for generating test cases as described in the first embodiment.
Referring now to FIG. 3, shown is a schematic diagram of an electronic device suitable for use in implementing embodiments of the present disclosure. The terminal device in the embodiments of the present disclosure may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle terminal (e.g., a car navigation terminal), and the like, and a stationary terminal such as a digital TV, a desktop computer, and the like. The electronic device shown in fig. 3 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 3, the electronic device may include a processing device (e.g., a central processing unit, a graphics processor, etc.) 301 that may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)302 or a program loaded from a storage device 308 into a Random Access Memory (RAM) 303. In the RAM 303, various programs and data necessary for the operation of the electronic apparatus are also stored. The processing device 301, the ROM 302, and the RAM 303 are connected to each other via a bus 304. An input/output (I/O) interface 305 is also connected to bus 304.
Generally, the following devices may be connected to the I/O interface 305: input devices 306 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 307 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage devices 308 including, for example, magnetic tape, hard disk, etc.; and a communication device 309. The communication means 309 may allow the electronic device to communicate wirelessly or by wire with other devices to exchange data. While fig. 3 illustrates an electronic device having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a non-transitory computer readable medium, the computer program containing program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication means 309, or installed from the storage means 308, or installed from the ROM 302. The computer program, when executed by the processing device 301, performs the above-described functions defined in the methods of the embodiments of the present disclosure.
It should be noted that the computer readable medium in the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer 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 of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, 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. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, either 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 computer readable signal medium may also be any computer readable medium that is not a computer 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 computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
In some embodiments, the clients, servers may communicate using any currently known or future developed network protocol, such as HTTP (HyperText transfer protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communications network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device.
Computer program code for carrying out operations for the present disclosure may be written in any combination of one or more programming languages, including but not limited to an object oriented programming language such as Java, Smalltalk, C + +, 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 computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present disclosure may be implemented by software or hardware. Where the name of an element does not in some cases constitute a limitation on the element itself.
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), systems on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, 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 foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the disclosure herein is not limited to the particular combination of features described above, but also encompasses other embodiments in which any combination of the features described above or their equivalents does not depart from the spirit of the disclosure. For example, the above features and (but not limited to) the features disclosed in this disclosure having similar functions are replaced with each other to form the technical solution.
Further, while operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limitations on the scope of the disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims.

Claims (9)

1. A method for generating test cases, comprising:
acquiring operation source information of a tested process;
retrieving an operation source logic code set based on the operation source information, and acquiring a corresponding operation source logic code; the operation source logic code comprises a preset operation logic code which is used for explaining and running;
analyzing the operation source logic code according to a code encoding rule to acquire first operation information and one or more corresponding first operation values;
and matching the first operation information and the first operation value with the operation information and the corresponding operation value in the test case data set to obtain a first matching test case.
2. The method of claim 1, wherein the obtaining operation source information of the process under test comprises:
and intercepting the operation source information through an interception plug-in.
3. The method according to claim 1, wherein the matching the first operation information and the first operation value with the operation information and the corresponding operation value in the test case dataset to obtain a first matching test case comprises:
matching the first operation information and the first operation value with operation information and corresponding operation values in a test case data set;
when the matching fails, generating a corresponding first matching test case according to the logical relation between the first operation information and the first operation value;
and when the matching is successful, acquiring a first matching test case from the test case data set.
4. The method according to claim 3, wherein after the generating a corresponding first matching test case according to the logical relationship between the first operation information and the first operation value, further comprising:
and storing the first operation information, the first operation value and the first matching test case into the test case data set.
5. The method of claim 1, further comprising:
and testing the tested process based on the first matching test case to generate test result information.
6. The method of claim 5, after the generating test result information, further comprising:
and analyzing and counting the test result information to generate a test report.
7. An apparatus for generating test cases, comprising:
the operation source information acquisition unit is used for acquiring the operation source information of the tested process;
an operation source logic code obtaining unit, configured to retrieve an operation source logic code set based on the operation source information, and obtain a corresponding operation source logic code; the operation source logic code comprises a preset operation logic code which is used for explaining and running;
the analysis operation source logic code unit is used for analyzing the operation source logic code according to a code coding rule and acquiring first operation information and one or more corresponding first operation values;
and the test case obtaining unit is used for matching the first operation information and the first operation value with the operation information and the corresponding operation value in the test case data set to obtain a first matching test case.
8. A computer-readable storage medium, on which a computer program is stored, which program, when being executed by a processor, carries out the method according to any one of claims 1 to 6.
9. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to carry out the method of any one of claims 1 to 6.
CN202010102329.4A 2020-02-19 2020-02-19 Method, device, medium and electronic equipment for generating test case Active CN111367791B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010102329.4A CN111367791B (en) 2020-02-19 2020-02-19 Method, device, medium and electronic equipment for generating test case

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010102329.4A CN111367791B (en) 2020-02-19 2020-02-19 Method, device, medium and electronic equipment for generating test case

Publications (2)

Publication Number Publication Date
CN111367791A true CN111367791A (en) 2020-07-03
CN111367791B CN111367791B (en) 2023-08-01

Family

ID=71208140

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010102329.4A Active CN111367791B (en) 2020-02-19 2020-02-19 Method, device, medium and electronic equipment for generating test case

Country Status (1)

Country Link
CN (1) CN111367791B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111858379A (en) * 2020-07-30 2020-10-30 中国工商银行股份有限公司 Application testing method and device

Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101060372A (en) * 2007-06-26 2007-10-24 华为技术有限公司 A method and system for rapid creating the automation test script
US20100058295A1 (en) * 2008-09-02 2010-03-04 International Business Machines Corporation Dynamic Test Coverage
CN102880546A (en) * 2012-09-03 2013-01-16 上海方正数字出版技术有限公司 Software integration testing method and system based on extensible markup language (XML) database
US8561036B1 (en) * 2006-02-23 2013-10-15 Google Inc. Software test case management
US20140068325A1 (en) * 2012-08-30 2014-03-06 International Business Machines Corporation Test case result processing
US20140245264A1 (en) * 2013-02-28 2014-08-28 International Business Machines Corporation Identifying Test Cases Based on Changed Test Code
CN105204992A (en) * 2015-08-28 2015-12-30 努比亚技术有限公司 Test script generating device and method
JP5998239B1 (en) * 2015-03-31 2016-09-28 エヌ・ティ・ティ・コムウェア株式会社 Software test apparatus, software test method, and software test program
US20180039569A1 (en) * 2016-08-03 2018-02-08 International Business Machines Corporation Test case generation for uncovered code paths
CN109062780A (en) * 2018-06-25 2018-12-21 深圳市远行科技股份有限公司 The development approach and terminal device of automatic test cases
CN109726113A (en) * 2018-08-17 2019-05-07 平安普惠企业管理有限公司 Method for generating test case, unit and computer readable storage medium
CN109871311A (en) * 2017-12-04 2019-06-11 北京京东尚科信息技术有限公司 A kind of method and apparatus for recommending test case
CN110659197A (en) * 2018-06-28 2020-01-07 亿度慧达教育科技(北京)有限公司 Application test case generation method and device and software test system
CN110764983A (en) * 2019-09-25 2020-02-07 北京字节跳动网络技术有限公司 Test method, device, medium and electronic equipment

Patent Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8561036B1 (en) * 2006-02-23 2013-10-15 Google Inc. Software test case management
CN101060372A (en) * 2007-06-26 2007-10-24 华为技术有限公司 A method and system for rapid creating the automation test script
US20100058295A1 (en) * 2008-09-02 2010-03-04 International Business Machines Corporation Dynamic Test Coverage
US20140068325A1 (en) * 2012-08-30 2014-03-06 International Business Machines Corporation Test case result processing
CN102880546A (en) * 2012-09-03 2013-01-16 上海方正数字出版技术有限公司 Software integration testing method and system based on extensible markup language (XML) database
US20140245264A1 (en) * 2013-02-28 2014-08-28 International Business Machines Corporation Identifying Test Cases Based on Changed Test Code
JP5998239B1 (en) * 2015-03-31 2016-09-28 エヌ・ティ・ティ・コムウェア株式会社 Software test apparatus, software test method, and software test program
CN105204992A (en) * 2015-08-28 2015-12-30 努比亚技术有限公司 Test script generating device and method
US20180039569A1 (en) * 2016-08-03 2018-02-08 International Business Machines Corporation Test case generation for uncovered code paths
CN109871311A (en) * 2017-12-04 2019-06-11 北京京东尚科信息技术有限公司 A kind of method and apparatus for recommending test case
CN109062780A (en) * 2018-06-25 2018-12-21 深圳市远行科技股份有限公司 The development approach and terminal device of automatic test cases
CN110659197A (en) * 2018-06-28 2020-01-07 亿度慧达教育科技(北京)有限公司 Application test case generation method and device and software test system
CN109726113A (en) * 2018-08-17 2019-05-07 平安普惠企业管理有限公司 Method for generating test case, unit and computer readable storage medium
CN110764983A (en) * 2019-09-25 2020-02-07 北京字节跳动网络技术有限公司 Test method, device, medium and electronic equipment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111858379A (en) * 2020-07-30 2020-10-30 中国工商银行股份有限公司 Application testing method and device
CN111858379B (en) * 2020-07-30 2024-03-29 中国工商银行股份有限公司 Application testing method and device

Also Published As

Publication number Publication date
CN111367791B (en) 2023-08-01

Similar Documents

Publication Publication Date Title
CN111625473B (en) Interface test case generation method and device, storage medium and electronic equipment
CN112104709B (en) Intelligent contract processing method, device, medium and electronic equipment
CN110543297B (en) Method and apparatus for generating source code
CN112395253B (en) Index file generation method, terminal device, electronic device and medium
CN109947431B (en) Code generation method, device, equipment and storage medium
CN111309304B (en) Method, device, medium and electronic equipment for generating IDL file
CN113238739A (en) Plug-in development and data acquisition method, device, electronic equipment and medium
CN111367791B (en) Method, device, medium and electronic equipment for generating test case
CN111124541B (en) Configuration file generation method, device, equipment and medium
CN112559024A (en) Method and device for generating transaction code change list
CN112817864B (en) Method, device, equipment and medium for generating test file
CN110689285A (en) Test method, test device, electronic equipment and computer readable storage medium
CN113138767B (en) Code language conversion method, device, electronic equipment and storage medium
CN114996152A (en) Unit testing method, device, equipment and medium
CN111414161B (en) Method, device, medium and electronic equipment for generating IDL file
CN111399843B (en) Method, system and electronic equipment for mapping SQL running information to SQL file
CN111539200B (en) Method, device, medium and electronic equipment for generating rich text
CN112667119A (en) Measuring point batch correlation method and device, electronic equipment and computer readable medium
CN117271301A (en) Test method, test device, electronic equipment and medium
CN116701159A (en) Test case generation method and device, electronic equipment and storage medium
CN115329164A (en) Data display template generation method, device, equipment and computer readable medium
CN115617691A (en) System testing method and device
CN113934639A (en) Data processing method and device, readable medium and electronic equipment
CN116107908A (en) Unit test code generation method and device
CN114443484A (en) Program testing method, device, equipment and storage medium

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
GR01 Patent grant
GR01 Patent grant