CN117632726A - Test case validity detection method and device, electronic equipment and storage medium - Google Patents

Test case validity detection method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN117632726A
CN117632726A CN202311630790.7A CN202311630790A CN117632726A CN 117632726 A CN117632726 A CN 117632726A CN 202311630790 A CN202311630790 A CN 202311630790A CN 117632726 A CN117632726 A CN 117632726A
Authority
CN
China
Prior art keywords
program
mutation
test case
case set
validity
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311630790.7A
Other languages
Chinese (zh)
Inventor
宋怡
王成
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Agricultural Bank of China
Original Assignee
Agricultural Bank of China
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 Agricultural Bank of China filed Critical Agricultural Bank of China
Priority to CN202311630790.7A priority Critical patent/CN117632726A/en
Publication of CN117632726A publication Critical patent/CN117632726A/en
Pending legal-status Critical Current

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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3409Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment for performance assessment
    • 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
    • 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/3688Test management for test execution, e.g. scheduling of test suites
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application discloses a test case effectiveness detection method, a test case effectiveness detection device, electronic equipment and a storage medium, and relates to the technical field of automatic test. Wherein the method comprises the following steps: acquiring a source program and a test case set of an application system, and generating a plurality of variant programs corresponding to the source program; running a test case set under each mutation program of a plurality of mutation programs to obtain a program mutation type of each mutation program relative to a source program; and determining the validity of the test case set based on the program mutation type corresponding to each mutation program. According to the technical scheme, the defect detection capability of the test case can be determined, the test personnel can be helped to improve and optimize the test case set, and then the quality of the test case can be improved.

Description

Test case validity detection method and device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of automated testing technologies, and in particular, to a method and apparatus for detecting validity of a test case, an electronic device, and a storage medium.
Background
In the process of testing functions and performances of an application system, a large number of test cases are usually required to comprehensively test the application system, the number of the test cases can even reach thousands, and a large amount of time and resources are required to be spent for running by the test cases. But, do these test cases really find all defects in the application? Will a defect not be found if a portion of the test case is deleted? Thus, the validity of the test cases is very important.
In the process of function and performance test, a group of test case sets can trigger various branches of tested codes and can perform result verification; when a problem occurs in the service code, the test case can find the problem, and then the test case group is considered to be effective; conversely, if the test case fails to find this problem, then the set of test cases is deemed invalid. In the prior art, the sufficiency of the software test is judged by adopting a logic coverage test method and a path coverage test method, and the sufficiency of the software test is evaluated from the angles of program entity coverage and path coverage respectively, however, the methods cannot intuitively reflect the defect detection capability of the test case. Therefore, how to determine test case validity becomes a problem to be solved.
Disclosure of Invention
The application provides a test case validity detection method, a device, electronic equipment and a storage medium, which can determine the defect detection capability of the test case, help test personnel to improve and optimize the test case set, and further improve the quality of the test case.
In a first aspect, the present application provides a method for detecting validity of a test case, where the method includes:
acquiring a source program and a test case set of an application system, and generating a plurality of variant programs corresponding to the source program;
running the test case set under each mutation program of the plurality of mutation programs to obtain a program mutation type of each mutation program relative to the source program;
and determining the validity of the test case set based on the program mutation type corresponding to each mutation program.
Further, the running the test case set under each mutation program of the plurality of mutation programs obtains a program mutation type of each mutation program relative to the source program, including: aiming at a current mutation program, determining whether any at least one test case exists in the test case set to cause the operation failure of the current mutation program; if so, determining the program variation type of the current variation program as a non-equivalent variant; if not, determining the program variation type of the current variation program as an equivalent variant; traversing the plurality of mutation programs to obtain the program mutation type corresponding to each mutation program.
Further, the determining the validity of the test case set based on the program mutation type corresponding to each mutation program includes: determining a first number of said non-equivalent variants in said plurality of variant programs; determining a ratio of the first number to the total number of the plurality of variant procedures; and if the ratio is equal to 1, determining the validity of the test case set to be all valid.
Further, the method further comprises: and supplementing the set of test cases based on the equivalent variants in the plurality of variant programs when the validity is not all valid.
Further, the supplementing the test case set based on the equivalent variants in the plurality of variant programs includes: determining a mutation code module with mutation between the source program and the equivalent variant to instruct a user to write a corresponding first test case based on the mutation code module; and receiving a supplementing operation for the test case set, and supplementing the first test case to the test case set.
Further, the source program and the set of test cases are determined by: acquiring an initial program and an initial use case set of the application system; running each initial use case in the initial use case set under the initial program to determine whether any at least one initial use case exists in the initial use case set to cause the failure of the initial program operation; if yes, determining an operation failure reason to indicate a user to modify the initial program or the initial use case based on the operation failure reason; and receiving a modification operation of the initial program or the initial use cases, and repeatedly executing the operation of running each initial use case in the initial use case set under the initial program until each initial use case makes the initial program run successfully, so as to obtain the source program and the test use case set.
Further, the generating a plurality of mutation programs corresponding to the source program includes: determining a program type of the source program, wherein the program type comprises a process-oriented program and an object-oriented program; determining a mutation operator corresponding to the program type; and carrying out mutation processing on the source program based on the mutation operator to obtain a plurality of mutation programs.
In a second aspect, the present application provides a test case validity detection apparatus, the apparatus comprising:
the system comprises a mutation program generation module, a test case set generation module and a program analysis module, wherein the mutation program generation module is used for acquiring a source program and the test case set of an application system and generating a plurality of mutation programs corresponding to the source program;
a mutation type determining module, configured to run the test case set under each mutation program of the plurality of mutation programs to obtain a program mutation type of each mutation program relative to the source program;
and the validity detection module is used for determining the validity of the test case set based on the program mutation type corresponding to each mutation program.
In a third aspect, the present application provides an electronic device, comprising: at least one processor; and a memory communicatively coupled to the at least one processor; the memory stores a computer program executable by the at least one processor, so that the at least one processor can execute the test case validity detection method according to any embodiment of the present application.
In a fourth aspect, the present application provides a computer readable storage medium storing computer instructions for implementing a method for detecting validity of a test case according to any embodiment of the present application when executed by a processor.
In order to solve the defects of the prior art in the background technology, the embodiment of the application provides a method for detecting the validity of a test case, and the execution of the method can bring the following beneficial effects: the utility model provides a system level test case defect detection capability measuring method, which comprises the steps of generating a mutation program corresponding to a source program through a mutation operator, deploying the mutation program, running a test case set for the mutation program, and determining the test case validity by counting the test case set execution condition of the mutation program. The defect detection capability of the test case is evaluated through the test case validity, so that a tester can be helped to improve and optimize the test case set, and the quality of the test case can be improved.
It should be noted that the above-mentioned computer instructions may be stored in whole or in part on a computer-readable storage medium. The computer readable storage medium may be packaged together with the processor of the test case validity detection apparatus, or may be packaged separately from the processor of the test case validity detection apparatus, which is not limited in this application.
The description of the second, third and fourth aspects of the present application may refer to the detailed description of the first aspect; moreover, the advantages described in the second aspect, the third aspect and the fourth aspect may refer to the analysis of the advantages of the first aspect, and are not described herein.
It should be understood that the description of this section is not intended to identify key or critical features of the embodiments of the application or to delineate the scope of the application. Other features of the present application will become apparent from the description that follows.
It can be appreciated that before using the technical solutions disclosed in the embodiments of the present application, the user should be informed and authorized by appropriate means of the type, the usage range, the usage scenario, etc. of the personal information related to the present application according to the relevant laws and regulations.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a method for detecting validity of a test case according to an embodiment of the present application;
FIG. 2 is a schematic structural diagram of a device for detecting validity of a test case according to an embodiment of the present application;
FIG. 3 is a block diagram of an electronic device for implementing a test case validity detection method according to an embodiment of the present application.
Detailed Description
For the purposes of making the objects, technical solutions and advantages of the embodiments of the present application more clear, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, shall fall within the scope of the present application.
It should be noted that the terms "first," "second," "target," and "original," etc. in the description and claims of the present application and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the present application described herein may be capable of executing sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed or inherent to such process, method, article, or apparatus.
Fig. 1 is a flow chart of a method for detecting validity of a test case according to an embodiment of the present application, where the embodiment is applicable to a situation where validity detection is performed on a test case set before performing function and performance tests on an application system. The method for detecting the validity of the test case provided by the embodiment of the invention can be executed by the device for detecting the validity of the test case provided by the embodiment of the invention, and the device can be realized in a mode of software and/or hardware and is integrated in the electronic equipment for executing the method.
Referring to fig. 1, the method of the present embodiment includes, but is not limited to, the following steps:
s110, acquiring a source program and a test case set of an application system, and generating a plurality of variant programs corresponding to the source program.
The application system is application software which needs comprehensive test; the source program is the computer code of the application system written in a certain programming language; the test case set is a plurality of test cases for testing functions and performances of the application system; the mutation program is a program after the source program performs mutation processing by a mutation operator.
Optionally, the source program and the test case set are determined by: acquiring an initial program and an initial use case set of an application system; firstly, deploying an initial program of the application system, executing an initial use case set of the application system after starting program service, and running each initial use case in the initial use case set under the initial program to determine whether any at least one initial use case in the initial use case set causes failure in running the initial program; if so, determining whether the operation failure cause is caused by the defect of the initial program or the defect of the initial use case so as to indicate the user to modify the initial program or the initial use case based on the operation failure cause; and receiving a modification operation of the initial program or the initial use cases, repeatedly executing the operation of running each initial use case in the modified initial use case set under the modified initial program until each initial use case enables the modified initial program to run successfully, taking the modified initial program as a source program, and taking the modified initial use case set as a test use case set, thereby obtaining the source program and the test use case set.
It should be noted that, the initial program is a program written for the application system by a programmer, the source program may be obtained by performing defect modification on the initial program, and the test case set in this step may be obtained by performing defect modification on the initial case set. In this embodiment, the source program is a defect-free application program, and the test case set is a test case that runs successfully under the source program, that is, each test case in the test case set runs successfully under the source program.
Specifically, generating a plurality of mutation programs corresponding to the source program includes: determining a program type of a source program, wherein the program type comprises a process-oriented program and an object-oriented program; determining a mutation operator corresponding to the program type; and carrying out mutation processing on the source program based on the mutation operator to obtain a plurality of mutation programs. Optionally, for the process-oriented program, the mutation operator at least comprises operator mutation, numerical mutation, method return value mutation and the like; for object-oriented programs, mutation operators include inheritance mutation, polymorphism mutation, reload mutation, and the like in addition to the above operators.
S120, running the test case set under each mutation program of the mutation programs to obtain the program mutation type of each mutation program relative to the source program.
And deploying the plurality of variant programs one by one in sequence, and running each test case in the test case set under one variant program to obtain the running result of each test case so as to determine whether all the running is successful or at least one running failure exists. The above procedure was repeated for each mutation procedure.
Specifically, running the test case set under each mutation program of the plurality of mutation programs to obtain a program mutation type of each mutation program relative to the source program includes: aiming at the current mutation program, determining whether any at least one test case exists in the test case set to cause the operation failure of the current mutation program; if the current mutation program exists, indicating that the current mutation program and the source program generate different running states or different running results, and determining that the program mutation type of the current mutation program is a non-equivalent variant if the current mutation program is killed; if the current variant program does not exist, indicating that the current variant program and the source program generate the same running state and the same running result, and determining that the program variant type of the current variant program is an equivalent variant if the current variant program is 'survived'; traversing a plurality of mutation programs to obtain the program mutation type corresponding to each mutation program.
After all the mutation programs are run once, if a survived mutation program exists in the mutation programs, namely, a mutation program of an equivalent variant exists in the mutation programs, the current test case set is not fully designed.
S130, determining the validity of the test case set based on the program mutation type corresponding to each mutation program.
Specifically, determining the validity of the test case set based on the program mutation type corresponding to each mutation program includes: determining a first number of non-equivalent variants in a plurality of variant procedures; determining a ratio of the first number to the total number of the plurality of variant procedures; if the ratio is equal to 1, the validity of the test case set is determined to be all valid.
The ratio of the number of non-equivalent variants to the total number of the plurality of variant programs is calculated by the following equation (1):
wherein num is killed A first number representing non-equivalent variants, i.e., the number of variant programs that are "killed"; num (num) total Representing the number of all variant procedures; score represents a ratio, which is a measure index for evaluating the error detection effectiveness of a test case set, wherein the score has a value between 0 and 1, and the higher the ratio is, the more variant programs are killed, the stronger the detection capability of the test case set is; the lower the ratio, the fewer variant programs that are "killed", and the lower the detectability of the test case set. When the score value is 0, it indicates that the test case set does not "kill" any variant program, and when the score value is 1, it indicates that the test case set "kills" all non-equivalent variant programs.
The test case validity detection method can be applied to unit test and integrated test processes, and is also applicable to system test cases. The test results show that the test effectiveness evaluation of an application system can be completed in only a few hours. The method can support java and other multiple programming languages, can enable the test cases to become more capable of finding problems, enables invalid test cases to be identified and cleaned, and enables testers to really think about how to write the test cases. The method can help testers find out the defects in the test work, write more effective test case sets, locate the weaknesses of test data or the weaknesses of codes which are rarely used in execution.
According to the technical scheme provided by the embodiment, a plurality of variant programs corresponding to the source program are generated by acquiring the source program and the test case set of the application system; running a test case set under each mutation program of a plurality of mutation programs to obtain a program mutation type of each mutation program relative to a source program; and determining the validity of the test case set based on the program mutation type corresponding to each mutation program. The utility model provides a system level test case defect detection capability measuring method, which comprises the steps of generating a mutation program corresponding to a source program through a mutation operator, deploying the mutation program, running a test case set for the mutation program, and determining the test case validity by counting the test case set execution condition of the mutation program. The defect detection capability of the test case is evaluated through the test case validity, so that a tester can be helped to improve and optimize the test case set, and the quality of the test case can be improved.
In an alternative embodiment, the optimization is performed on the basis of the above embodiments, specifically: and when the validity is not all valid (namely the ratio is smaller than 1), supplementing the test case set based on the equivalent variants in the variant programs, thereby improving the error detection capability of the test case set. And then removing the equivalent variant from the multiple variant programs to obtain a new multiple variant program, repeatedly executing the test case set after the new multiple variant program is operated and supplemented, and determining the validity of the test case set after the supplementation until the validity of the test case is all valid.
Specifically, supplementing the test case set based on equivalent variants in the plurality of variant programs includes: determining a mutation code module with mutation between the source program and the equivalent variant to instruct a user to write a corresponding first test case based on the mutation code module; and receiving a supplementing operation for the test case set, and supplementing the first test case to the test case set. The defect detection capability of the test case can be determined, and the test case set can be improved and optimized by a tester, so that the test case set is more perfect and sufficient.
Fig. 2 is a schematic structural diagram of a device for detecting validity of a test case according to an embodiment of the present application, and as shown in fig. 2, the device 200 may include:
a mutation program generating module 210, configured to obtain a source program and a test case set of an application system, and generate a plurality of mutation programs corresponding to the source program;
a mutation type determining module 220, configured to run the test case set under each mutation program of the plurality of mutation programs to obtain a program mutation type of each mutation program relative to the source program;
the validity detection module 230 is configured to determine validity of the test case set based on a program mutation type corresponding to each mutation program.
Further, the mutation type determining module 220 may be specifically configured to: aiming at a current mutation program, determining whether any at least one test case exists in the test case set to cause the operation failure of the current mutation program; if so, determining the program variation type of the current variation program as a non-equivalent variant; if not, determining the program variation type of the current variation program as an equivalent variant; traversing the plurality of mutation programs to obtain the program mutation type corresponding to each mutation program.
Further, the validity detection module 230 may be specifically configured to: determining a first number of said non-equivalent variants in said plurality of variant programs; determining a ratio of the first number to the total number of the plurality of variant procedures; and if the ratio is equal to 1, determining the validity of the test case set to be all valid.
Further, the device for detecting the validity of the test case may further include: the test case supplementing module;
the test case supplementing module is used for supplementing the test case set based on the equivalent variants in the variant programs when the validity is not all valid.
Further, the test case supplementing module may be specifically configured to: determining a mutation code module with mutation between the source program and the equivalent variant to instruct a user to write a corresponding first test case based on the mutation code module; and receiving a supplementing operation for the test case set, and supplementing the first test case to the test case set.
Optionally, the source program and the test case set are determined by: acquiring an initial program and an initial use case set of the application system; running each initial use case in the initial use case set under the initial program to determine whether any at least one initial use case exists in the initial use case set to cause the failure of the initial program operation; if yes, determining an operation failure reason to indicate a user to modify the initial program or the initial use case based on the operation failure reason; and receiving a modification operation of the initial program or the initial use cases, and repeatedly executing the operation of running each initial use case in the initial use case set under the initial program until each initial use case makes the initial program run successfully, so as to obtain the source program and the test use case set.
Further, the mutation program generating module 210 may be specifically configured to: determining a program type of the source program, wherein the program type comprises a process-oriented program and an object-oriented program; determining a mutation operator corresponding to the program type; and carrying out mutation processing on the source program based on the mutation operator to obtain a plurality of mutation programs.
The test case validity detection device provided by the embodiment can be applied to the test case validity detection method provided by any embodiment, and has corresponding functions and beneficial effects.
FIG. 3 is a block diagram of an electronic device for implementing a test case validity detection method according to an embodiment of the present application. The electronic device 10 is intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. Electronic equipment may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the applications described and/or claimed herein.
As shown in fig. 3, the electronic device 10 includes at least one processor 11, and a memory, such as a Read Only Memory (ROM) 12, a Random Access Memory (RAM) 13, etc., communicatively connected to the at least one processor 11, in which the memory stores a computer program executable by the at least one processor, and the processor 11 may perform various appropriate actions and processes according to the computer program stored in the Read Only Memory (ROM) 12 or the computer program loaded from the storage unit 18 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 may also be stored. The processor 11, the ROM 12 and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to bus 14.
Various components in the electronic device 10 are connected to the I/O interface 15, including: an input unit 16 such as a keyboard, a mouse, etc.; an output unit 17 such as various types of displays, speakers, and the like; a storage unit 18 such as a magnetic disk, an optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
The processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, digital Signal Processors (DSPs), and any suitable processor, controller, microcontroller, etc. The processor 11 performs the various methods and processes described above, such as the test case validity detection method.
In some embodiments, the method of detecting test case validity may be implemented as a computer program tangibly embodied on a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 10 via the ROM 12 and/or the communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the test case validity detection method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the test case validity detection method in any other suitable manner (e.g., by means of firmware).
Various implementations of the systems and techniques described here above can be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for carrying out the methods of the present application may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be implemented. The computer program may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this application, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer readable storage 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. Alternatively, the computer readable storage medium may be a machine readable signal medium. 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.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) through which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server) or that includes a middleware component (e.g., an application server) or that includes a front-end component through which a user can interact with an implementation of the systems and techniques described here, or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical hosts and VPS service are overcome.
Note that the above is only a preferred embodiment of the present application and the technical principle applied. Those skilled in the art will appreciate that the present application is not limited to the particular embodiments described herein, but is capable of numerous obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the present application. For example, one skilled in the art may use the various forms of flow shown above to reorder, add, or delete steps; the steps recited in the present application may be performed in parallel, sequentially or in a different order, as long as the desired results of the technical solutions of the present application are achieved, and are not limited herein.
The above embodiments do not limit the scope of the application. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present application are intended to be included within the scope of the present application.

Claims (10)

1. A method for detecting the validity of a test case, the method comprising:
acquiring a source program and a test case set of an application system, and generating a plurality of variant programs corresponding to the source program;
running the test case set under each mutation program of the plurality of mutation programs to obtain a program mutation type of each mutation program relative to the source program;
and determining the validity of the test case set based on the program mutation type corresponding to each mutation program.
2. The method for detecting validity of test cases according to claim 1, wherein running the test case set under each of the plurality of mutation programs obtains a program mutation type of the each mutation program with respect to the source program, comprising:
aiming at a current mutation program, determining whether any at least one test case exists in the test case set to cause the operation failure of the current mutation program;
if so, determining the program variation type of the current variation program as a non-equivalent variant;
if not, determining the program variation type of the current variation program as an equivalent variant;
traversing the plurality of mutation programs to obtain the program mutation type corresponding to each mutation program.
3. The method for detecting validity of test cases according to claim 2, wherein the determining validity of the test case set based on the program mutation type corresponding to each mutation program includes:
determining a first number of said non-equivalent variants in said plurality of variant programs;
determining a ratio of the first number to the total number of the plurality of variant procedures;
and if the ratio is equal to 1, determining the validity of the test case set to be all valid.
4. The method for detecting validity of a test case according to claim 3, further comprising:
and supplementing the set of test cases based on the equivalent variants in the plurality of variant programs when the validity is not all valid.
5. The method of claim 4, wherein the supplementing the test case set based on the equivalent variants in the plurality of variant programs comprises:
determining a mutation code module with mutation between the source program and the equivalent variant to instruct a user to write a corresponding first test case based on the mutation code module;
and receiving a supplementing operation for the test case set, and supplementing the first test case to the test case set.
6. The method of claim 1, wherein the source program and the set of test cases are determined by:
acquiring an initial program and an initial use case set of the application system;
running each initial use case in the initial use case set under the initial program to determine whether any at least one initial use case exists in the initial use case set to cause the failure of the initial program operation;
if yes, determining an operation failure reason to indicate a user to modify the initial program or the initial use case based on the operation failure reason;
and receiving a modification operation of the initial program or the initial use cases, and repeatedly executing the operation of running each initial use case in the initial use case set under the initial program until each initial use case makes the initial program run successfully, so as to obtain the source program and the test use case set.
7. The method for detecting validity of a test case according to claim 1, wherein the generating a plurality of mutation programs corresponding to the source program includes:
determining a program type of the source program, wherein the program type comprises a process-oriented program and an object-oriented program;
determining a mutation operator corresponding to the program type;
and carrying out mutation processing on the source program based on the mutation operator to obtain a plurality of mutation programs.
8. A test case validity detection apparatus, the apparatus comprising:
the system comprises a mutation program generation module, a test case set generation module and a program analysis module, wherein the mutation program generation module is used for acquiring a source program and the test case set of an application system and generating a plurality of mutation programs corresponding to the source program;
a mutation type determining module, configured to run the test case set under each mutation program of the plurality of mutation programs to obtain a program mutation type of each mutation program relative to the source program;
and the validity detection module is used for determining the validity of the test case set based on the program mutation type corresponding to each mutation program.
9. An electronic device, the electronic device comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the test case validity detection method of any one of claims 1 to 7.
10. A computer readable storage medium storing computer instructions for causing a processor to execute the method for detecting the validity of the test case according to any one of claims 1 to 7.
CN202311630790.7A 2023-11-30 2023-11-30 Test case validity detection method and device, electronic equipment and storage medium Pending CN117632726A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311630790.7A CN117632726A (en) 2023-11-30 2023-11-30 Test case validity detection method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311630790.7A CN117632726A (en) 2023-11-30 2023-11-30 Test case validity detection method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117632726A true CN117632726A (en) 2024-03-01

Family

ID=90017812

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311630790.7A Pending CN117632726A (en) 2023-11-30 2023-11-30 Test case validity detection method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117632726A (en)

Similar Documents

Publication Publication Date Title
US8719791B1 (en) Display of aggregated stack traces in a source code viewer
US11321081B2 (en) Affinity recommendation in software lifecycle management
US10212058B2 (en) System and method for detecting system's performance regression
CN116401113B (en) Environment verification method, device and medium for heterogeneous many-core architecture acceleration card
CN116645082A (en) System inspection method, device, equipment and storage medium
CN117632726A (en) Test case validity detection method and device, electronic equipment and storage medium
CN115373929A (en) Test method, device, equipment, readable storage medium and program product
CN115576831A (en) Test case recommendation method, device, equipment and storage medium
CN114546799A (en) Point burying log checking method and device, electronic equipment, storage medium and product
CN114003497A (en) Method, device and equipment for testing service system and storage medium
CN114741291A (en) Method, device, equipment and medium for automatically submitting vulnerability information
TWI735511B (en) Code submission method and equipment
CN118502814B (en) Software modification evaluation method, device, equipment and medium based on byte codes
CN117112435B (en) Vulnerability linkage detection result fusion method, storage medium and electronic equipment
CN117453567A (en) Chaos testing method, device and equipment
CN107291613B (en) Functional node abnormity simulation method and device
CN117648252A (en) Function test method and device for software application, electronic equipment and storage medium
CN118502814A (en) Software modification evaluation method, device, equipment and medium based on byte codes
CN116431499A (en) Automatic test method and device, electronic equipment and storage medium
CN117687853A (en) Firmware detection method, device, equipment and medium
CN115904943A (en) Code coverage rate determining method, system, electronic equipment and storage medium
CN117632670A (en) Fault warning method and device for test environment, electronic equipment and storage medium
CN115794623A (en) Batch task processing method and device, electronic equipment and storage medium
CN117609064A (en) Unit test method and device, electronic equipment and storage medium
CN114238075A (en) Method, device, equipment, medium and product for testing program component

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