CN111367791B - 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
CN111367791B
CN111367791B CN202010102329.4A CN202010102329A CN111367791B CN 111367791 B CN111367791 B CN 111367791B CN 202010102329 A CN202010102329 A CN 202010102329A CN 111367791 B CN111367791 B CN 111367791B
Authority
CN
China
Prior art keywords
information
test case
logic code
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.)
Active
Application number
CN202010102329.4A
Other languages
Chinese (zh)
Other versions
CN111367791A (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

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

Abstract

The disclosure provides a method, a device, a medium and electronic equipment for generating test cases. 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 acquire a corresponding operation source logic code; the operation source logic code comprises a preset operation logic code for interpretation operation; analyzing the operation source logic code according to a code coding 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 matched test case. The method and the device reduce errors and low efficiency caused by manually writing the test cases, and the generated test case data set improves 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 disclosure relates to the technical field of computers, and in particular relates to a method, a device, a medium and electronic equipment for generating test cases.
Background
Software generates test cases (Software Testing, english totality) describing a process that is used to facilitate the verification of the correctness, integrity, security, and quality of Software. In other words, software generation of test cases is an audit or comparison process between actual and expected output. The definition is as follows: and (3) operating the program under the specified conditions to find out program errors, measuring the quality of the software and evaluating whether the software can meet the design requirements.
Software generation test cases are processes that use manual operations or software automated methods to verify whether it meets specified requirements or to ascertain the difference between the expected and actual results.
Currently, the generation test cases for Web projects mainly depend on manually generated test cases and script generated test cases. The script generation test case needs professional personnel to write the generation test case script, the generation test case script needs to completely cover all branches of a software flow, a plurality of generation test case cases are generated, a generation test case mode of the generation test case script is manually written, and the generation test case 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.
The disclosure aims to provide a method, a device, a medium and electronic equipment for generating test cases, which can solve at least one technical problem. 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 to obtain a corresponding operation source logic code; the operation source logic code comprises a preset operation logic code for interpretation operation;
analyzing the operation source logic code according to a code coding 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 matched test case.
According to a second aspect of the specific embodiment of the present disclosure, the present disclosure provides an apparatus for generating a test case, including:
the operation source information acquisition unit is used for acquiring 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 for interpretation operation;
an operation source logic code analysis unit, 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;
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 matched test case.
According to a third aspect of the disclosure, there is provided a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements a method of generating test cases according to any of the first aspects.
According to a fourth aspect of the present disclosure, there is provided 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 implement a method of generating test cases as claimed in any of the first aspects.
Compared with the prior art, the scheme of the embodiment of the disclosure has at least the following beneficial effects:
the disclosure provides a method, a device, a medium and electronic equipment for generating test cases. 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 for interpretation operation; analyzing the operation source logic code according to a code coding 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 matched test case. The method and the device reduce errors and low efficiency caused by manually writing the test cases, and the generated test case data set improves the repeated utilization rate and the efficiency of generating the test cases.
Drawings
The above and other features, advantages, and aspects of embodiments of the present disclosure will become more apparent by reference to the following detailed description when taken in conjunction with the accompanying drawings. The same or similar reference numbers will be used throughout the drawings to refer to the same or like elements. It should be understood that the figures are schematic and that elements and components are not necessarily drawn to scale. In the drawings:
FIG. 1 illustrates a flow chart of a method of generating test cases according to an embodiment of the present disclosure;
FIG. 2 illustrates a block diagram of a unit of an apparatus for generating test cases according to an embodiment of the disclosure;
fig. 3 illustrates a schematic diagram of an electronic device connection structure 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 have been shown in the accompanying 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 are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustration purposes only and are not intended to limit the scope of the present 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. Furthermore, 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 "including" and variations thereof as used herein are intended to be 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. Related definitions of other terms will be given in the description below.
It should be noted that the terms "first," "second," and the like in this disclosure are merely used to distinguish between different devices, modules, or units and are not used to define an order or interdependence of functions performed by the devices, modules, or units.
It should be noted that references to "one", "a plurality" and "a plurality" in this disclosure are intended to be illustrative rather than limiting, and those of ordinary skill in the art will appreciate that "one or more" is intended to be understood as "one or more" unless the context clearly indicates otherwise.
The names of messages or information interacted between the various devices in the embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
Alternative embodiments of the present disclosure are described in detail below with reference to the drawings.
The first embodiment provided by the present disclosure is an embodiment of a method for generating test cases.
Embodiments of the present disclosure are described in detail below with reference to fig. 1, where fig. 1 is a flowchart of a method for generating test cases according to an embodiment of the present disclosure.
Step S101, operation source information of a tested process is obtained.
The operation source information is operation information obtained after the tested process 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 often intercepted through a hook function. The hook function may be provided in the process under test or in a separate daemon.
A plug-in is a program written by an application program interface that complies with certain specifications. Many software has plug-ins, which are numerous. The universal plug-in includes: flash plug-in, realPlayer plug-in, MMS plug-in, MIDI staff plug-in or ActiveX plug-in. Such as Winamp's DFX plug-in. There are also many plug-ins newly developed by programmers for specific uses.
For example, the obtaining operation source information of the tested process includes the following specific steps: and intercepting the operation source information of the tested process through an interception plug-in.
Namely, a hook function is arranged 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, the operation source information of the tested process is intercepted 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.
Step S102, retrieving an operation source logic code set based on the operation source information, and obtaining a corresponding operation source logic code.
The operation source logic code comprises preset operation logic code for interpretation operation.
For example, the operation source logic code is script code.
Script code, a plain text saved code program, is an extension of batch files, and a script is typically interpreted and not compiled. A script program is a combination of a certain series of control computers that perform arithmetic operation actions in which certain logical branches and the like can be implemented. Compared with a general program, the script program is relatively close to natural language, can be interpreted and executed without compiling, and is beneficial to quick development or some light control. For example, puppeterer language code, javaScript language code, or JSP language code. The present disclosure implements the set of operation source logic code to save operation source logic code. Comprising 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 an interpreted run associated with operation source information, i.e., a section of a program that restores the associated operation source information. For example, the operation source logic code is a script conforming to the puppeterer syntax.
Puppeterer is a node library that controls the headless Chrome browser through the development tool protocol. The application program interface provided by puppeter can directly control the Chrome browser to simulate most user operations for user interface testing or to access pages as crawlers to collect data.
Step S103, analyzing the operation source logic codes according to the code coding rules, and obtaining first operation information and one or more corresponding first operation values.
The code encoding rule is the grammar rule of the code programming language writing program. For example, puppeter grammar rules.
The first operation information is different from the operation source information, and is the operation information conforming to the code coding rule. For example, continuing the above example, the code encoding rules are rules that conform to the Puppeterer script syntax; the first operation information is operation information conforming to a rule of a purpleter script syntax in a script of the purpleer 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 is indicated that the first operation information is flow branching operation information;
step S104, the first operation information and the first operation value are matched with the operation information and the corresponding operation value in the test case data set, and a first matched test case is obtained.
A test case dataset comprising: 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 matched 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 logic relation between the first operation information and the first operation value.
For example, continuing the above example, when the first operation information has a one-to-many logical relationship with the first operation value, then determining that the first operation information is flow branching operation information; further, the generated first matching test case is a plurality of test cases covering the branching operation of the flow.
Optionally, after the generating the corresponding first matching test case according to the logical relationship between the first operation information and the first operation value, the method further includes the following specific steps:
and step S104-2-1, storing the first operation information, the first operation value and the first matched test case into the test case data set.
And saving the generated information related to the first matched test case in the test case data set, so that the judging 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 matched test case from the test case data set.
The first matched test case is directly obtained from the test case data set, so that the efficiency of generating the test case is improved.
In addition, to improve test results, embodiments of the present disclosure provide steps for statistical analysis of test jobs.
The method further comprises the following specific steps:
step S105, testing the tested process based on the first matched test case, and generating test result information.
And S106, analyzing and counting the test result information to generate a test report.
When analyzing the test result information, unreasonable result information (such as information which is greatly different from actual operation result information) in the test result information can be removed, so that the accuracy of a test report is improved.
The embodiment of the disclosure reduces errors and low efficiency caused by manually writing the test cases, and the generated test case data set 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, i.e., an apparatus for generating test cases. Since the second embodiment is substantially similar to the first embodiment, the description is relatively simple, and the relevant portions will be referred to the corresponding descriptions of the first embodiment. The device embodiments described below are merely illustrative.
Fig. 2 illustrates an embodiment of an apparatus for generating test cases provided by the present disclosure. Fig. 2 is a block diagram of a unit of an apparatus for generating test cases 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 unit 201 is acquired, an operation source logic code unit 202 is acquired, an operation source logic code unit 203 is analyzed, and a test case unit 204 is acquired.
An operation source information obtaining 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 for interpretation operation;
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;
and the test case obtaining unit 204 is configured to match the first operation information and the first operation value with operation information and a corresponding operation value in the test case data set, and obtain a first matched test case.
Optionally, in the acquiring operation source information unit 201, it includes:
and the plug-in interception subunit is used for intercepting the operation source information through the plug-in interception.
Optionally, in the test case acquisition unit 204, it 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 logic relation between the first operation information and the first operation value when the output result of the matching subunit is that the matching fails;
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 that the matching is successful.
Optionally, in the matching failure subunit, the method further includes:
and the storage information subunit is used for storing the first operation information, the first operation value and the first matching test case into the test case data set after the corresponding first matching test case is generated according to the logic relation between the first operation information and the first operation value.
Optionally, the operation source logic code is a script conforming to puppeterer syntax; the code encoding rules are rules conforming to the Puppeterer script grammar.
Optionally, the apparatus further includes:
and the test result information generating unit is used for testing the tested process based on the first matched test case and generating test result information.
Optionally, the apparatus further includes:
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 disclosure reduces errors and low efficiency caused by manually writing the test cases, and the generated test case data set improves the repeated utilization rate and the efficiency of generating the test cases.
The embodiment of the disclosure provides a third embodiment, namely an electronic device, which is used for generating a method for testing cases, and the electronic device comprises: at least one processor; and a memory communicatively coupled to the at least one processor; wherein, the liquid crystal display device comprises a liquid crystal display device,
the memory stores instructions executable by the one processor to enable the at least one processor to perform the method of generating test cases as described in the first embodiment.
The present disclosure provides a fourth embodiment, namely a computer storage medium storing computer executable instructions that can execute the method for generating test cases as described in the first embodiment.
Referring now to fig. 3, a schematic diagram of an electronic device suitable for use in implementing embodiments of the present disclosure is shown. The terminal devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and the like, and stationary terminals such as digital TVs, desktop computers, and the like. The electronic device shown in fig. 3 is merely an example and should not be construed to limit the functionality and scope of use of the disclosed embodiments.
As shown in fig. 3, the electronic device may include a processing means (e.g., a central processor, 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 means 308 into a Random Access Memory (RAM) 303. In the RAM 303, various programs and data required for the operation of the electronic device 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.
In general, the following devices may be connected to the I/O interface 305: input devices 306 including, for example, a touch screen, touchpad, 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 308 including, for example, magnetic tape, hard disk, etc.; and communication means 309. The communication means 309 may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. While fig. 3 shows an electronic device having various means, it is to be understood that not all of the illustrated means are required to be implemented or provided. More or fewer devices may be implemented or provided instead.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a non-transitory computer readable medium, the computer program comprising program code for performing the method shown in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via a communication device 309, or installed from a storage device 308, or installed from a ROM 302. The above-described functions defined in the methods of the embodiments of the present disclosure are performed when the computer program is executed by the processing means 301.
It should be noted that the computer readable medium described in the present disclosure may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any 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 context of this 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 the present disclosure, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. 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, fiber optic cables, RF (radio frequency), and the like, or any suitable combination of the foregoing.
In some implementations, 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 communication 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 networks.
The computer readable medium may be contained in the electronic device; or may exist alone without being incorporated into the electronic device.
Computer program code for carrying out operations of the present disclosure may be written in 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 kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
The flowcharts 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 involved in the embodiments of the present disclosure may be implemented by means of software, or may be implemented by means of hardware. Wherein the names of the units do not constitute a limitation of the units themselves in some cases.
The functions described above herein 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: a Field Programmable Gate Array (FPGA), an Application Specific Integrated Circuit (ASIC), an Application Specific Standard Product (ASSP), a system on a chip (SOC), a Complex Programmable Logic Device (CPLD), 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. The 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 of the preferred embodiments of the present disclosure and description of the principles of the technology being employed. It will be appreciated by persons skilled in the art that the scope of the disclosure referred to in this disclosure is not limited to the specific combinations of features described above, but also covers other embodiments which may be formed by any combination of features described above or equivalents thereof without departing from the spirit of the disclosure. Such as those described above, are mutually substituted with the technical features having similar functions disclosed in the present disclosure (but not limited thereto).
Moreover, although 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. In 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 limiting the scope of the present 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 example forms of implementing the claims.

Claims (9)

1. A method of generating test cases, comprising:
acquiring operation source information of a tested process; the operation source information is operation information obtained after the tested process is operated;
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 for interpretation operation; the operation source logic code is code for simulating an interpretation run associated with the operation source information;
analyzing the operation source logic code according to a code coding rule to acquire first operation information and one or more corresponding first operation values; the first operation information is the operation information conforming to the code coding rule in the operation source logic code;
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 matched test case;
when the first operation information is flow branch operation information, the first operation information is provided with a plurality of first operation values; the first matched test case is a test case of a plurality of overlay flow branching operations.
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 of claim 1, wherein the matching the first operation information and the first operation value with operation information and corresponding operation values in a test case data set to obtain a first matched test case comprises:
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;
when the matching fails, generating a corresponding first matching test case according to the logic relation between the first operation information and the first operation value;
and when the matching is successful, acquiring a first matched test case from the test case data set.
4. The method of claim 3, further comprising, after the generating the corresponding first matching test case according to the logical relationship between the first operation information and the first operation value:
and storing the first operation information, the first operation value and the first matched test case into the test case data set.
5. The method according to claim 1, wherein the method further comprises:
and testing the tested process based on the first matched test case, and generating test result information.
6. The method of claim 5, further comprising, after said generating test result information:
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 operation source information of the tested process; the operation source information is operation information obtained after the tested process is operated;
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 for interpretation operation; the operation source logic code is code for simulating an interpretation run associated with the operation source information;
an operation source logic code analysis unit, 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 first operation information is the operation information conforming to the code coding rule in the operation source logic code;
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 matched test case;
when the first operation information is flow branch operation information, the first operation information is provided with a plurality of first operation values; the first matched test case is a test case of a plurality of overlay flow branching operations.
8. A computer readable storage medium, on which a computer program is stored, characterized in that the program, when being executed by a processor, implements 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 implement the method of any 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 CN111367791A (en) 2020-07-03
CN111367791B true 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)

Families Citing this family (1)

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

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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
JP5998239B1 (en) * 2015-03-31 2016-09-28 エヌ・ティ・ティ・コムウェア株式会社 Software test apparatus, software test method, and software test program
CN109062780A (en) * 2018-06-25 2018-12-21 深圳市远行科技股份有限公司 The development approach and terminal device of automatic test cases
CN110764983A (en) * 2019-09-25 2020-02-07 北京字节跳动网络技术有限公司 Test method, device, medium and electronic equipment

Family Cites Families (9)

* 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
US8381184B2 (en) * 2008-09-02 2013-02-19 International Business Machines Corporation Dynamic test coverage
US8930761B2 (en) * 2012-08-30 2015-01-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
US9990272B2 (en) * 2016-08-03 2018-06-05 International Business Machines Corporation Test case generation for uncovered code paths
CN109871311B (en) * 2017-12-04 2022-12-27 北京京东尚科信息技术有限公司 Method and device for recommending test cases
CN110659197B (en) * 2018-06-28 2021-05-25 亿度慧达教育科技(北京)有限公司 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

Patent Citations (5)

* 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
CN102880546A (en) * 2012-09-03 2013-01-16 上海方正数字出版技术有限公司 Software integration testing method and system based on extensible markup language (XML) database
JP5998239B1 (en) * 2015-03-31 2016-09-28 エヌ・ティ・ティ・コムウェア株式会社 Software test apparatus, software test method, and software test program
CN109062780A (en) * 2018-06-25 2018-12-21 深圳市远行科技股份有限公司 The development approach and terminal device of automatic test cases
CN110764983A (en) * 2019-09-25 2020-02-07 北京字节跳动网络技术有限公司 Test method, device, medium and electronic equipment

Also Published As

Publication number Publication date
CN111367791A (en) 2020-07-03

Similar Documents

Publication Publication Date Title
US11487539B2 (en) Systems and methods for automating and monitoring software development operations
CN111625473B (en) Interface test case generation method and device, storage medium and electronic equipment
CN111506900B (en) Vulnerability detection method and device, electronic equipment and computer storage medium
CN113760729A (en) Code detection method and device
CN113449310A (en) Application program vulnerability detection method, device and equipment
CN111309304B (en) Method, device, medium and electronic equipment for generating IDL file
CN112596738B (en) Method and device for determining front-end page to be tested, storage medium and electronic equipment
CN111367791B (en) Method, device, medium and electronic equipment for generating test case
CN112559024A (en) Method and device for generating transaction code change list
CN111124541B (en) Configuration file generation method, device, equipment and medium
CN114328700B (en) Data checking method and device in medical data ETL task
CN116450511A (en) Information updating method, device, electronic equipment and computer readable medium
CN112817864B (en) Method, device, equipment and medium for generating test file
CN113138767B (en) Code language conversion method, device, electronic equipment and storage medium
CN113448869B (en) Method and device for generating test case, electronic equipment and computer readable medium
CN112379967B (en) Simulator detection method, device, equipment and medium
CN112286808B (en) Application program testing method and device, electronic equipment and medium
CN111399843B (en) Method, system and electronic equipment for mapping SQL running information to SQL file
CN116185805A (en) Code detection method, device, equipment and storage medium
CN111178014A (en) Method and device for processing business process
CN111581331B (en) Method, device, electronic equipment and computer readable medium for processing text
CN117609077A (en) Method and device for rechecking configuration parameters, electronic equipment and storage medium
CN117667642A (en) Code detection method, device, equipment and medium of application program
CN114443484A (en) Program testing method, device, equipment and storage medium
CN114996152A (en) Unit testing method, device, equipment and 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