CN112286803A - Test case detection method and device - Google Patents

Test case detection method and device Download PDF

Info

Publication number
CN112286803A
CN112286803A CN202011149969.7A CN202011149969A CN112286803A CN 112286803 A CN112286803 A CN 112286803A CN 202011149969 A CN202011149969 A CN 202011149969A CN 112286803 A CN112286803 A CN 112286803A
Authority
CN
China
Prior art keywords
test case
test
case
calling
check point
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202011149969.7A
Other languages
Chinese (zh)
Other versions
CN112286803B (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 Sankuai Online Technology Co Ltd
Original Assignee
Beijing Sankuai Online 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 Sankuai Online Technology Co Ltd filed Critical Beijing Sankuai Online Technology Co Ltd
Priority to CN202011149969.7A priority Critical patent/CN112286803B/en
Priority claimed from CN202011149969.7A external-priority patent/CN112286803B/en
Publication of CN112286803A publication Critical patent/CN112286803A/en
Application granted granted Critical
Publication of CN112286803B publication Critical patent/CN112286803B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • 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

Landscapes

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

Abstract

The specification discloses a test case detection method and a test case detection device, wherein a test platform can firstly obtain a test case set and carry out testing according to the test case set, then, a method call link of a detection point in the test platform is monitored and called through a monitoring code, whether the monitored method call link contains a unique identifier corresponding to the test case or not is judged for each test case, when the test case contains the unique identifier corresponding to the test case, the test case is determined to be an effective case, otherwise, the test case is determined to be an invalid case, and a tester is prompted to modify the invalid case. The validity of the test case is determined by monitoring each method call link of the call check point and judging whether each method call link contains the unique identifier corresponding to the test case, so that the execution of invalid cases is reduced, the test time is further reduced, and the resource waste is avoided.

Description

Test case detection method and device
Technical Field
The present application relates to the field of test technologies, and in particular, to a method and an apparatus for detecting a test case.
Background
At present, in order to improve the testing efficiency, an automated testing method is generally used in combination with an automated testing framework for testing.
When the function of the application to be tested is detected by an automatic testing method, the testing platform can firstly acquire a test case, and the test case is used for testing certain service information in the application to be tested. And then, starting to execute the test case in a test framework and capturing a response result of the application to be tested. Then, the checkpoint in the test framework is called through the test case, and the captured response result of the application to be tested is compared with the expected result. And finally, generating a quality evaluation report of the test case according to the comparison result, wherein the quality evaluation report comprises information of whether the function test is normal and the like so as to prompt a tester whether the applied function needs to be perfected. Wherein a checkpoint refers to a function in the testing framework that compares the captured information to an expected result.
Disclosure of Invention
Embodiments of the present specification provide a method and an apparatus for detecting a test case, which are used to partially solve the problems that in the prior art, when a check point is not called in a test case, the test case cannot detect service information, and the execution of the test case consumes a long time and causes resource waste.
The embodiment of the specification adopts the following technical scheme:
the test case detection method provided by the present specification includes:
the method comprises the following steps that a test platform obtains a test case set and tests according to each test case in the test case set;
monitoring and calling a method calling link of a check point in the test platform through a preset monitoring code, wherein the method calling link comprises a unique identifier corresponding to a test case;
judging whether each monitored method calling link contains a unique identifier corresponding to each test case or not aiming at each test case;
if yes, determining the test case as an effective case;
if not, determining that the test case is an invalid case, and prompting a tester to modify according to the information of the invalid case.
Optionally, the monitoring and calling a method call link of the inspection point in the test platform through a preset monitoring code specifically includes:
monitoring a calling request of the test case for calling the check point in the test platform through a preset monitoring code;
and determining a method call link corresponding to the call request according to the monitored call request.
Optionally, the determining whether the monitored method call links include the unique identifier corresponding to the test case specifically includes:
determining unique identifiers corresponding to the test cases contained in each method calling chain for calling the check points;
matching the unique identification corresponding to the test case with the unique identification corresponding to each test case contained in the method call chain;
and judging whether each method calling link for calling the check point contains the unique identifier corresponding to the test case or not according to the matching result.
Optionally, when the test case set includes one test case, the method further includes:
and if a method call link for calling the check point in the test platform is monitored through a preset monitoring code, determining the test cases contained in the test case set as effective cases.
Optionally, the method further comprises:
judging whether a monitored method calling link for calling each check point in the test platform contains a unique identifier corresponding to the test case or not;
and when the method calling link contains the unique identifier corresponding to the test case, determining that the test case calls the check point.
Optionally, the method further comprises:
and testing the service information detected by the check point according to a plurality of test cases which are contained in the test case set and used for calling the check point.
Optionally, the method further comprises:
and testing according to the determined effective cases contained in the test case set.
This specification provides a detection apparatus for a test case, including:
the acquisition module is used for acquiring the test case set through the test platform and testing according to each test case in the test case set;
the monitoring module is used for monitoring and calling a method calling link of a check point in the test platform through a preset monitoring code, and the method calling link comprises a unique identifier corresponding to a test case;
and the judging module is used for judging whether the monitored method calling link contains the unique identifier corresponding to the test case or not aiming at each test case, if so, determining that the test case is an effective case, otherwise, determining that the test case is an ineffective case, and prompting a tester to modify according to the information of the ineffective case.
The present specification provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the computer program implements the method for detecting the test case.
The electronic device provided by the present specification includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the detection method of the test case when executing the program.
The embodiment of the specification adopts at least one technical scheme which can achieve the following beneficial effects:
in this specification, a test platform may first obtain a test case set used for testing, perform testing according to the test case set, then monitor and call a method call link of a check point in the test platform through a monitoring code, and determine, for each test case, whether each monitored method call link includes a unique identifier corresponding to the test case, determine, when each monitored method call link includes a unique identifier corresponding to the test case, that the test case is an effective case, determine, when each monitored method call link does not include a unique identifier corresponding to the test case, that the test case is an ineffective case, and prompt a tester to modify the ineffective case. The validity of the test case is determined by monitoring each method call link of the call check point and judging whether each method call link contains the unique identifier corresponding to the test case, so that the execution of invalid cases is reduced, the test time is further reduced, and the resource waste is avoided.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
fig. 1 is a schematic flowchart of a method for detecting a test case according to an embodiment of the present disclosure;
fig. 2 is a schematic structural diagram of a test platform provided in an embodiment of the present disclosure;
fig. 3 is a schematic structural diagram of a device for detecting a test case according to an embodiment of the present disclosure;
fig. 4 is a schematic view of an electronic device implementing a test case detection method provided in an embodiment of the present specification.
Detailed Description
In order to make the objects, technical solutions and advantages of the present disclosure more apparent, the technical solutions of the present disclosure will be clearly and completely described below with reference to the specific embodiments of the present disclosure and the accompanying drawings. It should be apparent that the described embodiments are only some of the embodiments of the present application, and not all of the embodiments. All other embodiments obtained by a person skilled in the art without making any inventive step based on the embodiments in the description belong to the protection scope of the present application.
At present, in order to improve the testing efficiency, the testing method is gradually changed from manual testing to automatic testing. In the manual test stage, because of the manual participation of testers, when the realization function of part of test cases is complex, the testers can directly and automatically judge whether the function can be normally realized. For example: when the color of the characters in the page is detected to be red, the function of writing the color of the detected characters in the test case is complex, so that the written test case only needs to realize the operation of opening the page, and a tester can autonomously judge the color of the characters in the opened page.
In the stage of automatic testing, because the manual participation of testing personnel is reduced, the execution result of the test case does not need to be judged manually, when the test case is executed in the automatic testing frame, the check point in the testing frame can be directly called by the test case, and the captured response result of the application to be tested is compared with the expected result to determine whether the testing function is normal or not.
However, in the manual test phase, for a test case that is manually judged without including a detection function in a written part, it is impossible to detect whether the function is normal by directly executing the test case in an automated test framework. That is, for a test case that does not call a checkpoint and executes a detection function, the detection of the function cannot be realized, and it takes a long time to execute the test case instead, which results in waste of test resources.
Therefore, the present specification provides a method for detecting a test case, which can determine whether the test case can implement functional detection according to whether the test case calls a check point, and use the test case capable of performing functional detection as an effective case, so that the method can be used in a subsequent test process, thereby reducing test duration and waste of test resources. And taking the test case without executing the function detection as an invalid case, and prompting a tester to modify or delete and the like.
The technical solutions provided by the embodiments of the present application are described in detail below with reference to the accompanying drawings.
Fig. 1 is a schematic flow chart of a method for detecting a test case provided in an embodiment of the present specification, which may specifically include the following steps:
s100: the test platform obtains the test case set and tests according to each test case in the test case set.
Generally, when testing various functions (service information) in an application to be tested, a test case set for testing needs to be written in advance according to various service logics in the application to be tested. And when performing automated testing, the automated testing process may be performed in an automated testing platform. The automated testing platform includes a testing framework, a console, a data collection platform, and the like, as shown in fig. 2, where the testing framework is used to execute a test case, and in this specification, the testing framework may also be used to monitor a call condition of a checkpoint. The test frame may be an aframe frame or an xframe frame, and may be specifically set as needed. The control console is used for displaying the execution result of the test case to prompt a tester to modify, and the data collection platform is used for reading and analyzing the execution result of the test case and generating a quality evaluation report of the test case.
In the automated testing in this specification, specifically, first, the test platform may obtain a test case set. The test cases are collectively composed of a plurality of test cases, the test cases can be written by a tester in advance according to the service logic of the application to be tested, and can also be generated according to the operation record of the tester in the application to be tested. Thereafter, testing is performed by running each test case in the set of test cases simultaneously in the test framework.
S102: and monitoring and calling a method calling link of the inspection point in the test platform through a preset monitoring code.
The detection method of the test case provided by the specification is used for judging whether the test case is effective or not according to whether the test case calls the check point or not. Therefore, when the test case is executed in this specification, the condition that each checkpoint in the test framework is called can be monitored, and whether the test case is valid or not can be determined according to the condition that each checkpoint is called.
Specifically, for each checkpoint provided in the test platform, a monitoring code for monitoring the invoked condition of the checkpoint may be automatically inserted when the test platform is started, and the invoked condition of the checkpoint is monitored in real time by the monitoring code in the process of running the test case. Wherein, the check point is a function provided by the test platform for detection, such as: and the text check point, the object check point and the like are respectively used for detecting the text and the object so as to judge whether the detection result is consistent with the expected result.
Then, each test case executes the incompletely same operation in the running process, that is, calls the incompletely same method, that is, one test case corresponds to one method call link in the running process, and the method call link refers to a set of methods that the test cases call in sequence in the running process. The method call link that calls the checkpoint can be monitored by the monitoring code. The method call link comprises a unique identifier corresponding to the test case, and the unique identifier is expressed in a 'class + method' form.
Further, since the checkpoint is a detection method encapsulated in the test framework, when the monitoring code is added, the monitoring code can be added to the checkpoint by means of code instrumentation when the test platform is started, so as to monitor the condition that the checkpoint is called.
Furthermore, when the monitoring code monitors a method call link calling the checkpoint, the monitoring code may determine a method call link corresponding to a call request by monitoring the call request for calling the checkpoint sent in the running process of the test case and according to the monitored call request.
It should be noted that, in this specification, when monitoring a method call link of a call checkpoint by monitoring a code, monitoring may be performed specifically by using a java dynamic tracking technology, and since the java dynamic tracking technology is already a mature prior art, this is not described in detail herein.
S104: and judging whether the monitored method call links contain the unique identification corresponding to the test case or not for each test case, if so, executing step S106, and if not, executing step S108.
In one or more embodiments of the present specification, when it is monitored that each check point in the test framework is called in the execution process of each test case, a link may be called according to each monitored method, and the test case that has called the check point is determined.
Specifically, for each test case, the test platform may first determine a unique identifier corresponding to the test case in the method call link, and then match the unique identifier corresponding to the test case with the unique identifier corresponding to each test case included in each method call chain in which the check point is monitored. And finally, judging whether each method calling link for calling the check point contains the unique identifier corresponding to the test case or not according to the matching result.
S106: and determining the test case as a valid case.
In one or more embodiments of the present disclosure, when it is determined that the matching is successful through step S104, that is, the monitored method call links include the unique identifier corresponding to the test case, it may be determined that, in the running process of the test case, a checkpoint in the test framework is actually called, and thus, the detection of the function may be performed. Therefore, the test case can be determined to be an effective case, and the detected effective case can be used for testing during subsequent testing, so that the test time and the test resource waste are avoided. That is, the test case determined to be the valid case is used for the application test.
Of course, the information of the effective use case may also be sent to the data collection platform, so that the data collection platform reads and analyzes the information of the effective use case to generate a quality evaluation report of the test case. The quality evaluation report includes information such as the running time length, the execution result, the validity of the test case and the like.
S108: and determining the test case as an invalid case, and prompting a tester to modify the test case according to the information of the invalid case.
In one or more embodiments of the present disclosure, when it is determined that the matching is not successful through step S104, that is, each monitored method invocation link does not include the unique identifier corresponding to the test case, it may be determined that, in the running process of the test case, any checkpoint in the test framework is not actually invoked, and no function is detected.
Therefore, the test case can be determined to be an invalid case, and the information of the detected invalid case is sent to the console to prompt the tester to modify the test case. And/or sending the information of the invalid case to a data collection platform, so that the data collection platform reads and analyzes the information of the invalid case, and a quality evaluation report of the test case is generated, so that a tester can modify the quality evaluation report of the test case. The quality evaluation report includes information such as the running time length, the execution result, the validity of the test case and the like.
Based on the detection method of the test case shown in fig. 1, a test platform may first obtain a test case set for testing, and perform testing according to the test case set, then monitor and call a method call link of a detection point in the test platform through a monitoring code, and determine, for each test case, whether each monitored method call link includes a unique identifier corresponding to the test case, when each monitored method call link includes a unique identifier corresponding to the test case, determine that the test case is an effective case, when each monitored method call link does not include a unique identifier corresponding to the test case, determine that the test case is an ineffective case, and prompt a tester to modify the ineffective case. The validity of the test case is determined by monitoring each method call link of the call check point and judging whether each method call link contains the unique identifier corresponding to the test case, so that the execution of invalid cases is reduced, the test time is further reduced, and the resource waste is avoided.
The test case detection method provided by the specification is used for determining whether the check point is called by the test case in the execution process by monitoring each method call chain for calling each check point. Compared with static detection of the test case, the validity of the test case is judged by identifying whether the test case contains a code for calling the check point, so that the situation that the code for calling the check point is contained in the test case due to code logic, but the code is not executed in the execution process, so that the judgment is wrong is reduced. For example, assume that the business logic when writing a test case is: if the preset condition is met, the check point is called, otherwise, the check point is not called. Then the codes in the test cases are judged statically, and the codes which call the check points in the test cases can be determined to be effective cases. However, in the running process of the test case, the preset condition is not met, so that the check point is not called, and the validity of the test case is judged statically to be wrong.
In this specification, when a test case is detected, a test case of a certain check point may be called for targeted detection. Specifically, for each checkpoint in the test platform, after a method call link for calling the checkpoint is monitored by a monitoring code, whether the monitored method call link for calling the checkpoint contains a unique identifier corresponding to the test case or not can be judged for each test case, and when the method call link contains the unique identifier corresponding to the test case, it can be determined that the test case has called the checkpoint. And then, testing the service information detected by the check point through the determined test case for calling the check point.
Of course, in this specification, the test case set may also include only one test case, and in step S102, when a method call link that calls a check point in the test platform is monitored through a preset monitoring code, it may be determined that the test case included in the test case set is an effective case.
Further, after the validity of each test case is determined in the specification, that is, after it is determined that each test case is an invalid case or a valid case, the test platform may generate a quality evaluation report of the test case according to the running time, the execution result, and the validity of the test case for each test case.
The test case detection method provided in this specification may be executed before the test is performed using the test case, or may be executed during the test performed using the test case. Of course, in order to reduce the waste of test resources, the test is usually performed during the process of performing the test by using the test case for the first time, and during the subsequent test, the test can be performed according to the determined effective case.
Based on the detection method for the test case shown in fig. 1, the embodiment of the present specification further provides a schematic structural diagram of a detection apparatus for a test case, as shown in fig. 3.
Fig. 3 is a schematic structural diagram of an apparatus for detecting a test case according to an embodiment of the present disclosure, where the apparatus includes:
the obtaining module 200 is configured to obtain a test case set through a test platform, and perform a test according to each test case in the test case set;
the monitoring module 202 is configured to monitor and call a method call link of the inspection point in the test platform through a preset monitoring code, where the method call link includes a unique identifier corresponding to the test case;
the judging module 204 is configured to judge, for each test case, whether the monitored method call link includes a unique identifier corresponding to the test case, determine that the test case is an effective case if the monitored method call link includes the unique identifier corresponding to the test case, determine that the test case is an ineffective case if the monitored method call link does not include the unique identifier corresponding to the test case, and prompt a tester to modify the test case according to information of the ineffective case if the monitored method call link does not include the unique identifier corresponding to the test case.
Optionally, the monitoring module 202 is specifically configured to monitor, through a preset monitoring code, a call request for the test case to call a check point in the test platform, and determine, according to the monitored call request, a method call link corresponding to the call request.
Optionally, the determining module 204 is specifically configured to determine unique identifiers corresponding to the test cases included in each method call chain for calling the checkpoint, match the unique identifiers corresponding to the test cases with the unique identifiers corresponding to the test cases included in the method call chain, and determine whether each method call chain for calling the checkpoint includes the unique identifier corresponding to the test case according to a matching result.
Optionally, when the test case set includes one test case, the device for detecting a test case further includes a single case detection module 206, where the single case detection module 206 is specifically configured to determine that the test case included in the test case set is an effective case if a method call link for calling a check point in the test platform is monitored through a preset monitoring code.
Optionally, the determining module 204 is further configured to determine, for each checkpoint in the test platform, whether a monitored method call link for calling the checkpoint includes a unique identifier corresponding to the test case, and when the method call link includes the unique identifier corresponding to the test case, determine that the test case has called the checkpoint.
Optionally, the determining module 204 is further configured to test the service information detected by the checkpoint according to a plurality of test cases included in the test case set and calling the checkpoint.
Optionally, the device for detecting a test case further includes a test module 208, and the test module 208 is specifically configured to perform a test according to each valid case included in the test case set.
The embodiment of the present specification further provides a computer-readable storage medium, where a computer program is stored, and the computer program may be used to execute the method for detecting the test case provided in fig. 1.
Based on the detection method of the test case shown in fig. 1, an embodiment of the present specification further provides a schematic structural diagram of the electronic device shown in fig. 4. As shown in fig. 4, at the hardware level, the electronic device includes a processor, an internal bus, a network interface, a memory, and a non-volatile memory, but may also include hardware required for other services. The processor reads a corresponding computer program from the nonvolatile memory into the memory and then runs the computer program to implement the test case detection method shown in fig. 1.
Of course, besides the software implementation, the present specification does not exclude other implementations, such as logic devices or a combination of software and hardware, and the like, that is, the execution subject of the following processing flow is not limited to each logic unit, and may be hardware or logic devices.
In the 90 s of the 20 th century, improvements in a technology could clearly distinguish between improvements in hardware (e.g., improvements in circuit structures such as diodes, transistors, switches, etc.) and improvements in software (improvements in process flow). However, as technology advances, many of today's process flow improvements have been seen as direct improvements in hardware circuit architecture. Designers almost always obtain the corresponding hardware circuit structure by programming an improved method flow into the hardware circuit. Thus, it cannot be said that an improvement in the process flow cannot be realized by hardware physical modules. For example, a Programmable Logic Device (PLD), such as a Field Programmable Gate Array (FPGA), is an integrated circuit whose Logic functions are determined by programming the Device by a user. A digital system is "integrated" on a PLD by the designer's own programming without requiring the chip manufacturer to design and fabricate application-specific integrated circuit chips. Furthermore, nowadays, instead of manually making an Integrated Circuit chip, such Programming is often implemented by "logic compiler" software, which is similar to a software compiler used in program development and writing, but the original code before compiling is also written by a specific Programming Language, which is called Hardware Description Language (HDL), and HDL is not only one but many, such as abel (advanced Boolean Expression Language), ahdl (alternate Hardware Description Language), traffic, pl (core universal Programming Language), HDCal (jhdware Description Language), lang, Lola, HDL, laspam, hardward Description Language (vhr Description Language), vhal (Hardware Description Language), and vhigh-Language, which are currently used in most common. It will also be apparent to those skilled in the art that hardware circuitry that implements the logical method flows can be readily obtained by merely slightly programming the method flows into an integrated circuit using the hardware description languages described above.
The controller may be implemented in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, an Application Specific Integrated Circuit (ASIC), a programmable logic controller, and an embedded microcontroller, examples of which include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320, the memory controller may also be implemented as part of the control logic for the memory. Those skilled in the art will also appreciate that, in addition to implementing the controller as pure computer readable program code, the same functionality can be implemented by logically programming method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers and the like. Such a controller may thus be considered a hardware component, and the means included therein for performing the various functions may also be considered as a structure within the hardware component. Or even means for performing the functions may be regarded as being both a software module for performing the method and a structure within a hardware component.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
For convenience of description, the above devices are described as being divided into various units by function, and are described separately. Of course, the functions of the various elements may be implemented in the same one or more software and/or hardware implementations of the present description.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present description may be provided as a method, system, or computer program product. Accordingly, the description may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the description may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
This description may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only an example of the present specification, and is not intended to limit the present specification. Various modifications and alterations to this description will become apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present specification should be included in the scope of the claims of the present specification.

Claims (10)

1. A method for detecting a test case is characterized in that the method comprises the following steps:
the method comprises the following steps that a test platform obtains a test case set and tests according to each test case in the test case set;
monitoring and calling a method calling link of a check point in the test platform through a preset monitoring code, wherein the method calling link comprises a unique identifier corresponding to a test case;
judging whether each monitored method calling link contains a unique identifier corresponding to each test case or not aiming at each test case;
if yes, determining the test case as an effective case;
if not, determining that the test case is an invalid case, and prompting a tester to modify according to the information of the invalid case.
2. The method of claim 1, wherein monitoring a method call link that calls a check point in the test platform through a preset monitoring code comprises:
monitoring a calling request of the test case for calling the check point in the test platform through a preset monitoring code;
and determining a method call link corresponding to the call request according to the monitored call request.
3. The method of claim 1, wherein judging whether each monitored method call link includes a unique identifier corresponding to the test case comprises:
determining unique identifiers corresponding to the test cases contained in each method calling chain for calling the check points;
matching the unique identification corresponding to the test case with the unique identification corresponding to each test case contained in the method call chain;
and judging whether each method calling link for calling the check point contains the unique identifier corresponding to the test case or not according to the matching result.
4. The method of claim 1, wherein when the set of test cases contains one test case, the method further comprises:
and if a method call link for calling the check point in the test platform is monitored through a preset monitoring code, determining the test cases contained in the test case set as effective cases.
5. The method of claim 1, wherein the method further comprises:
judging whether a monitored method calling link for calling each check point in the test platform contains a unique identifier corresponding to the test case or not;
and when the method calling link contains the unique identifier corresponding to the test case, determining that the test case calls the check point.
6. The method of claim 5, wherein the method further comprises:
and testing the service information detected by the check point according to a plurality of test cases which are contained in the test case set and used for calling the check point.
7. The method of claim 1, wherein the method further comprises:
and testing according to each effective case contained in the test case set.
8. An apparatus for detecting a test case, comprising:
the acquisition module is used for acquiring the test case set through the test platform and testing according to each test case in the test case set;
the monitoring module is used for monitoring and calling a method calling link of a check point in the test platform through a preset monitoring code, and the method calling link comprises a unique identifier corresponding to a test case;
and the judging module is used for judging whether the monitored method calling link contains the unique identifier corresponding to the test case or not aiming at each test case, if so, determining that the test case is an effective case, otherwise, determining that the test case is an ineffective case, and prompting a tester to modify according to the information of the ineffective case.
9. A computer-readable storage medium, characterized in that the storage medium stores a computer program which, when executed by a processor, implements the method of any of the preceding claims 1-7.
10. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of any of claims 1-7 when executing the program.
CN202011149969.7A 2020-10-23 Test case detection method and device Active CN112286803B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011149969.7A CN112286803B (en) 2020-10-23 Test case detection method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011149969.7A CN112286803B (en) 2020-10-23 Test case detection method and device

Publications (2)

Publication Number Publication Date
CN112286803A true CN112286803A (en) 2021-01-29
CN112286803B CN112286803B (en) 2024-10-25

Family

ID=

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115576853A (en) * 2022-11-24 2023-01-06 云账户技术(天津)有限公司 Method and device for judging integrity of use case

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110096437A (en) * 2019-04-12 2019-08-06 平安普惠企业管理有限公司 The test method and Related product of micro services framework
US20190243613A1 (en) * 2018-02-07 2019-08-08 Sap Se Facilitated production of code for software testing
CN111506511A (en) * 2020-04-21 2020-08-07 腾讯科技(深圳)有限公司 Test case generation method and device, electronic equipment and medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190243613A1 (en) * 2018-02-07 2019-08-08 Sap Se Facilitated production of code for software testing
CN110096437A (en) * 2019-04-12 2019-08-06 平安普惠企业管理有限公司 The test method and Related product of micro services framework
CN111506511A (en) * 2020-04-21 2020-08-07 腾讯科技(深圳)有限公司 Test case generation method and device, electronic equipment and medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
张李梅;牟永敏;张志华;崔展齐;: "基于函数调用路径的测试用例混合优化方法", 科学技术与工程, vol. 20, no. 09, 28 March 2020 (2020-03-28), pages 3640 - 3647 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115576853A (en) * 2022-11-24 2023-01-06 云账户技术(天津)有限公司 Method and device for judging integrity of use case

Similar Documents

Publication Publication Date Title
CN105512015B (en) A kind of Android intended application collapse statistical method and device
CN110704306B (en) Assertion processing method, device, equipment and storage medium in test
US20180300222A1 (en) Monitoring Activity of Software Development Kits Using Stack Trace Analysis
US20050114839A1 (en) Testing flow control at test assertion level
CN105426310A (en) Method and apparatus for detecting performance of target process
US20100131472A1 (en) Detection and utilzation of inter-module dependencies
TWI684916B (en) Function selection method and server
CN113704117A (en) Algorithm testing system, method and device
CN114840427A (en) Code testing and test case generating method and device
CN110675028A (en) Block chain-based food safety supervision method, device, equipment and system
CN113032100A (en) Exception handling method, device, equipment and storage medium
CN112084108A (en) Test script generation method and device and related components
CN111078435A (en) Service processing method and device and electronic equipment
CN112286803A (en) Test case detection method and device
CN112286803B (en) Test case detection method and device
CN113127367B (en) Defect detection method for Android dynamic permission application
US8291389B2 (en) Automatically detecting non-modifying transforms when profiling source code
CN113656290B (en) Automatic mock point identification method, device and equipment
CN116055349A (en) Method, device and equipment for detecting stream data
KR101858594B1 (en) Method and apparatus for detecting anti-reversing code
CN109857665B (en) Test execution method and device for test case
CN112506782A (en) Application program testing method, device, equipment and storage medium
CN113688031A (en) Testing positioning method based on byte code enhancement technology
CN114048488B (en) Vulnerability detection method and system
CN117155628B (en) Method, system, device and readable storage medium for interactive security test of containerized application

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