CN114185798A - Interface test case detection method and device, computer equipment and storage medium - Google Patents

Interface test case detection method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN114185798A
CN114185798A CN202111533189.7A CN202111533189A CN114185798A CN 114185798 A CN114185798 A CN 114185798A CN 202111533189 A CN202111533189 A CN 202111533189A CN 114185798 A CN114185798 A CN 114185798A
Authority
CN
China
Prior art keywords
case
interface test
test case
checking
interface
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
CN202111533189.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.)
Ping An Securities Co Ltd
Original Assignee
Ping An Securities 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 Ping An Securities Co Ltd filed Critical Ping An Securities Co Ltd
Priority to CN202111533189.7A priority Critical patent/CN114185798A/en
Publication of CN114185798A publication Critical patent/CN114185798A/en
Pending legal-status Critical Current

Links

Images

Classifications

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Test And Diagnosis Of Digital Computers (AREA)

Abstract

The application relates to the technical field of artificial intelligence, and provides an interface test case detection method, an interface test case detection device, computer equipment and a storage medium. The method comprises the following steps: acquiring interface test case configuration data, generating an interface test case according to the interface test case configuration data and preset interface test case template data, and when a preset case inspection event is triggered, inspecting the interface test case according to a case inspection mechanism corresponding to the preset case inspection event to obtain an inspection result of the interface test case; the preset case check events comprise a no-assertion case check event, an assertion case check event, a reverse case check event and a test case quantity check event. By adopting the method, the automatic detection of the interface test case is realized, the problems of the interface test case can be fed back in time, the error probability of the interface test case is reduced, and the quality of the interface test case is improved.

Description

Interface test case detection method and device, computer equipment and storage medium
Technical Field
The present application relates to the field of artificial intelligence technologies, and in particular, to a method and an apparatus for detecting an interface test case, a computer device, a storage medium, and a computer program product.
Background
Automated testing is a process that translates human-driven test behavior into machine execution. Generally, after the interface test case is designed and passes review, the tester performs the test step by step according to the procedures described in the interface test case, resulting in a comparison of the actual results with the expected results.
With the popularization of the automated testing technology and the artificial intelligence technology, the platform for the interface automated testing is favored by more and more enterprises, the platform can configure and execute the interface automated use cases, but because the automated interface test cases are automatically executed by the platform, thousands of interface test cases are automatically executed by a system, the situations that the use cases are randomly and non-normatively configured and the quality of the use cases is uneven are easily caused, so that even if all functions of a product are covered by the interface test cases, problems still occur in the subsequent production environment, and the actual efficiency cannot be reached.
Therefore, it is necessary to provide an interface test case detection scheme capable of effectively monitoring and detecting the quality of an interface test case to ensure the quality of the interface test case.
Disclosure of Invention
In view of the foregoing, it is desirable to provide an interface test case detection method, an apparatus, a computer device, a computer readable storage medium, and a computer program product, which can ensure the quality of an interface test case.
In a first aspect, the present application provides a method for detecting an interface test case. The method comprises the following steps:
acquiring interface test case configuration data;
generating an interface test case according to the interface test case configuration data and preset interface test case template data;
when the preset case inspection event is triggered, inspecting the interface test case according to a case inspection mechanism corresponding to the preset case inspection event to obtain an inspection result of the interface test case;
the preset case check events comprise a no-assertion case check event, an assertion case check event, a reverse case check event and a test case quantity check event.
In one embodiment, when the preset case check event is triggered, the interface test case is checked according to a case check mechanism corresponding to the preset case check event, and obtaining a check result of the interface test case includes:
when a storage instruction of the test case is received, triggering a no-assertion case check event and an assertion case check event, checking the interface test case according to a no-assertion case check mechanism and an assertion case mechanism, and respectively obtaining a no-assertion check result and an assertion check result of the interface test case;
and when the preset case checking period is reached, triggering a reverse case checking event and a test case quantity checking event, checking the interface test case according to a reverse case checking mechanism and a test case quantity checking mechanism, and respectively obtaining a reverse case checking result and a quantity checking result of the interface test case.
In one embodiment, checking the interface test case according to the assertion-free case checking mechanism includes:
traversing the post-verification data of the interface test case;
and if the fact that the post-verification data does not contain Verify method data and Forverify method data is detected, judging that the interface test case is a no-assertion case.
In one embodiment, checking the interface test case according to the assertion case checking mechanism includes:
checking the post-verification data of the current interface test case according to a preset interface post-verification rule;
and if detecting that the post-check data lacks the corresponding parameter check item, judging that the interface test case is an assertion case.
In one embodiment, checking the interface test case according to a reverse case checking mechanism includes:
acquiring essential transmission parameters of an interface corresponding to an interface test case;
traversing an interface test case corresponding to the interface;
and if the interface test case is detected to carry out reverse verification on the necessary parameters, judging that the interface test case is a reverse case.
In one embodiment, the checking the interface test cases according to the test case quantity checking mechanism includes:
acquiring the configured number of the interface test cases;
estimating the number of the interface test cases according to a boundary value method or an equivalence class division method to obtain the estimated number of the interface test cases;
and comparing the configured quantity of the interface test cases with the estimated quantity of the interface test cases to obtain a quantity check result of the interface test cases.
In a second aspect, the present application further provides an interface test case detection apparatus. The device comprises:
the data acquisition module is used for acquiring interface test case configuration data;
the test case generation module is used for generating an interface test case according to the interface test case configuration data and the preset interface test case template data;
the test case checking module is used for checking the interface test case according to a case checking mechanism corresponding to the preset case checking event when the preset case checking event is triggered to obtain a checking result of the interface test case;
the preset case check events comprise a no-assertion case check event, an assertion case check event, a reverse case check event and a test case quantity check event.
In a third aspect, the present application also provides a computer device. The computer device comprises a memory storing a computer program and a processor implementing the following steps when executing the computer program:
acquiring interface test case configuration data;
generating an interface test case according to the interface test case configuration data and preset interface test case template data;
when the preset case inspection event is triggered, inspecting the interface test case according to a case inspection mechanism corresponding to the preset case inspection event to obtain an inspection result of the interface test case;
the preset case check events comprise a no-assertion case check event, an assertion case check event, a reverse case check event and a test case quantity check event.
In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of:
acquiring interface test case configuration data;
generating an interface test case according to the interface test case configuration data and preset interface test case template data;
when the preset case inspection event is triggered, inspecting the interface test case according to a case inspection mechanism corresponding to the preset case inspection event to obtain an inspection result of the interface test case;
the preset case check events comprise a no-assertion case check event, an assertion case check event, a reverse case check event and a test case quantity check event.
In a fifth aspect, the present application further provides a computer program product. The computer program product comprising a computer program which when executed by a processor performs the steps of:
acquiring interface test case configuration data;
generating an interface test case according to the interface test case configuration data and preset interface test case template data;
when the preset case inspection event is triggered, inspecting the interface test case according to a case inspection mechanism corresponding to the preset case inspection event to obtain an inspection result of the interface test case;
the preset case check events comprise a no-assertion case check event, an assertion case check event, a reverse case check event and a test case quantity check event.
According to the interface test case detection method, the device, the computer equipment, the storage medium and the computer program product, the interface test case can be quickly generated according to the interface test case configuration data and the preset interface test case template data, and when no assertion case check event, reverse case check event and test case quantity check event are triggered, the automatically generated interface test case can be checked from multiple dimensions according to a corresponding case check mechanism, so that an accurate and comprehensive check result of the interface test case is obtained. By the aid of the scheme, automatic inspection of the interface test cases is realized, detection accuracy of the interface test cases is improved, problems of the interface test cases can be detected in time, error probability of the interface test cases is reduced, and quality of the interface test cases is improved.
Drawings
FIG. 1 is a diagram of an application environment of a method for interface test case detection in one embodiment;
FIG. 2 is a flowchart illustrating a method for detecting interface test cases in an embodiment;
FIG. 3 is a flowchart illustrating the steps of checking the number of interface test cases for the interface test cases in one embodiment;
FIG. 4 is a block diagram illustrating an exemplary embodiment of an interface test case detection apparatus;
FIG. 5 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The interface test case detection method provided by the embodiment of the application can be applied to the application environment shown in fig. 1. Wherein the terminal 102 communicates with the server 104 via a network. The data storage system may store data that the server 104 needs to process. The data storage system may be integrated on the server 104, or may be located on the cloud or other network server. Specifically, the tester and the terminal 102 may configure an interface test case, upload interface test case configuration data to the server 104, and send a test case detection message to the server 104, where the server 104 responds to the message to obtain the interface test case configuration data, generate an interface test case according to the interface test case configuration data and preset interface test case template data, and then, when a preset case check event is triggered, check the interface test case according to a case check mechanism corresponding to the preset case check event to obtain a check result of the interface test case, where the preset case check event includes a no-assertion case check event, an assertion case check event, a reverse case check event, and a test case quantity check event. The terminal 102 may be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers, internet of things devices and portable wearable devices, and the internet of things devices may be smart speakers, smart televisions, smart air conditioners, smart car-mounted devices, and the like. The portable wearable device can be a smart watch, a smart bracelet, a head-mounted device, and the like. The server 104 may be an independent server, or may be a cloud server that provides basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a web service, cloud communication, a middleware service, a domain name service, a security service, a Content Delivery Network (CDN), a big data and artificial intelligence platform, and the like. It is worth mentioning that in the embodiment of the application, the product information keywords and the user data can be acquired and processed based on an artificial intelligence technology. It is worth mentioning that, in the embodiment of the present application, the interface test case configuration data may be acquired and processed based on an artificial intelligence technology.
In an embodiment, as shown in fig. 2, an interface test case method is provided, which is described by taking the application of the method to the server in fig. 1 as an example, and includes the following steps:
step 202, obtaining interface test case configuration data.
The interface test case configuration data comprises an interface test case number, an interface test case precondition, a postcondition, interface parameter output and parameter input details and the like. In practical application, when a tester wants to perform a case test on a certain product function or interface, taking a test interface as an example, and the tester wants to perform an interface test on a certain interface, the tester can configure the automation interface test case data of the relevant interface on a deployed interface automation test platform, and receive the configuration data of the automation interface test case input by a user in real time to obtain the interface test case configuration data.
And 204, generating an interface test case according to the interface test case configuration data and the preset interface test case template data.
In specific implementation, the post-condition of the interface test case includes operation type, condition judgment, verification method, parameter name/interface parameter output, expected result value/parameter input, and the like. The interface test case may be generated by acquiring logic frame data, i.e., template data, of the interface test case, and automatically filling configuration data of the interface test case into a corresponding field based on the template data to generate a corresponding automated interface test case. Or reading a preset interface test case template, wherein the preset interface test case template carries data such as a case name, a case description, an operation step, an expected result, a fixed field of priority and the like, and correspondingly writing interface test case configuration data into the preset interface test case template to generate a corresponding interface test case.
And step 206, when the preset case inspection event is triggered, inspecting the interface test case according to a case inspection mechanism corresponding to the preset case inspection event to obtain an inspection result of the interface test case, wherein the preset case inspection event comprises a no-assertion case inspection event, an assertion case inspection event, a reverse case inspection event and a test case quantity inspection event.
The non-assertion use case refers to a use case without any check on a result returned by the interface, and the assertion use case refers to a use case without fixed fields such as state information and data information. In practical application, a tester can preset interface test case inspection events comprising a no-assertion case inspection event, an assertion case inspection event, a reverse case inspection event and an interface case number inspection event, and correspondingly designs a set of corresponding test case inspection mechanisms for each event, and presets corresponding trigger conditions for each event, and when an event is triggered, the interface test cases are detected according to the corresponding test case inspection mechanisms to obtain corresponding inspection results, and particularly, the interface test cases with problems can be marked. Furthermore, the reason of non-compliance is also given, so that the tester can find the problem in time.
According to the interface test case detection method, the interface test case can be quickly generated according to the interface test case configuration data and the preset interface test case template data, and when no assertion case inspection event, no reverse case inspection event and no test case quantity inspection event are triggered, the automatically generated interface test case can be inspected from multiple dimensions according to a corresponding case inspection mechanism, so that an accurate and comprehensive inspection result of the interface test case is obtained. By the aid of the scheme, automatic inspection of the interface test cases is realized, detection accuracy of the interface test cases is improved, problems of the interface test cases can be detected in time, error probability of the interface test cases is reduced, and quality of the interface test cases is improved.
In one embodiment, when the preset case check event is triggered, the interface test case is checked according to a case check mechanism corresponding to the preset case check event, and obtaining a check result of the interface test case includes:
when a storage instruction of the test case is received, triggering a no-assertion case check event and an assertion case check event, checking the interface test case according to a no-assertion case check mechanism and an assertion case mechanism, and respectively obtaining a no-assertion check result and an assertion check result of the interface test case;
and when the preset case checking period is reached, triggering a reverse case checking event and a test case quantity checking event, checking the interface test case according to a reverse case checking mechanism and a test case quantity checking mechanism, and respectively obtaining a reverse case checking result and a quantity checking result of the interface test case.
In this embodiment, the interface test case may be pushed to the user terminal after the interface test case is generated according to the interface test case configuration data and the interface test case template data configured by the tester, the user terminal displays the interface test case so that the tester can check and confirm the interface test case, after the interface test case is confirmed to be correct, the "save" button is clicked, at this time, when a save instruction of the test case is received, a preset non-assertion case check event and a preset assertion case check event are triggered, and whether the compiled interface test case has the non-assertion case and the assertion case is checked according to the non-assertion case check mechanism and the assertion case check mechanism. Therefore, whether the test cases have assertion cases or not and whether the test cases have no assertion cases or not can be automatically checked. In addition, the tester can also set a fixed time period to perform reverse case inspection and test case quantity inspection. The reverse use case generally refers to a use case of an input or condition state which is not supported by the system, and the use case can check the fault tolerance capability and reliability of the system. The reverse case check refers to checking whether the interface test case performs the check of an abnormal scene on each functional point. The test case quantity check indicates whether the quantity of the generated test cases of the detection interface is reasonable. In this embodiment, 23 points per night may be set to start the reverse case checking mechanism and the test case quantity checking mechanism, and reverse case checking and test case quantity checking may be performed on the interface test cases. In the embodiment, the automatic examination of the interface test case can be realized by presetting the interface test case examination mechanism, so that the examination efficiency is improved.
In one embodiment, checking the interface test case according to the assertion-free case checking mechanism includes: traversing the post-verification data of the interface test case, and if the post-verification data is detected not to contain Verify method data and Forverify method data, judging that the interface test case is a no-assertion case.
The check data returned by the interface test case to the interface is called post check data. In specific implementation, when the non-assertion use case is checked, if the interface test use case does not check the result returned by the interface, the use case cannot be checked even if the interface returns failure, and basically belongs to a meaningless use case, and the corresponding interface is marked at this time. The configuration of the test case of the automatic interface sets a certain rule, and only two methods of Verify and Forverify are used for data verification. When the no-assertion use case is checked, only whether the post-verification data contains Verify method data and Forverify method data or not needs to be scanned, and if the post-verification data does not contain Verify and Forverify methods, the no-assertion use case is judged. In this embodiment, whether the interface test case is a no-assertion case or not can be quickly determined by directly scanning whether the Verify and the ForVerify exist in the post-verification data or not.
In one embodiment, checking the interface test case according to the assertion case checking mechanism includes: and checking the post-verification data of the current interface test case according to a preset interface post-verification rule, and if detecting that the post-verification data lacks a corresponding parameter check item, judging the interface test case to be an assertion case.
In practical application, the post-check data is divided into two types, including state information and data information, the state has a fixed field, the data information has special keyword check, if the post-check data does not contain these check items, the default such use case belongs to the assertion use case. Specifically, the return of the interface also has a certain rule, and the rule is agreed in advance. For example, two parameters, MSG _ CODE and MSG _ TEXT, are used to indicate the status, and data is in data. In this embodiment, the post-verification data of the interface test case may be scanned according to the rule, and if the post-verification data does not include the check item of the parameter, the interface test case is determined to be an assertion case. In this embodiment, whether the use case is an assertion use case can be quickly and efficiently determined by scanning whether the post-verification data has a corresponding parameter check item.
In one embodiment, checking the interface test case according to a reverse case checking mechanism includes: acquiring the essential transmission parameters of the interface corresponding to the interface test case, traversing the interface test case corresponding to the interface, and judging the interface test case to be a reverse case if detecting that the essential transmission parameters are reversely verified by the interface test case.
Based on the theory of testing, each functional point needs to perform some verification of abnormal scenarios, called reverse verification, in addition to performing forward test verification. In practical application, when a tester configures an interface, the tester indicates which parameters are necessary to be transmitted (necessary items), and for the necessary parameters, reverse verification is performed, that is, whether the interface has an abnormality is verified if the interface does not transmit or transmits abnormal data. For mandatory items, there is at least a need for use case verification when the parameter is not transmitted. When the use case is examined, firstly scanning the parameter configuration of the interface to obtain the interface mandatory item, namely the interface mandatory parameter, then scanning the interface test case under the interface to judge whether the condition of verifying the mandatory parameter of the interface is not transmitted, if not, judging that the reverse use case is unqualified to check, and marking that the interface is not completely verified, otherwise, judging that the interface test case is the reverse use case if the mandatory parameter is reversely verified by the interface test case. Similarly, parameters are transmitted by the scanning interface, whether the condition that the interface is not verified to transmit the mandatory item exists is detected, and the reverse case check can be rapidly and accurately made.
As shown in fig. 3, in one embodiment, the checking the interface test cases according to the test case quantity checking mechanism includes:
step 226, obtaining the configured number of the interface test cases;
step 246, estimating the number of the interface test cases according to a boundary value method or an equivalence class division method to obtain the estimated number of the interface test cases;
step 266, comparing the configured number of the interface test cases with the estimated number of the interface test cases to obtain the number checking result of the interface test cases.
The quantity check of the interface test cases may be according to the quantity of input parameters of the interface and according to the design method of the test cases, for example: and (3) estimating the number of the interface test cases by an equivalence class division method or a boundary value and the like, then comparing the configured interface test cases with the estimated number of the interface test cases, and if the difference between the configured number of the interface test cases and the estimated number of the interface test cases is larger, reminding the interface mark. Specifically, the estimation of the case data may be implemented by a boundary value method, which may be: for example, when the interface is configured, the int type is selected as the participating type, and the number of interface test cases related to this field is at least 3 (maximum value, minimum value, intermediate value). The number of interface test cases estimated according to the equivalence class partition method may be: when the interface is configured, the necessary filling parameters are configured, the valid input and the invalid input are configured, and the number of the test cases can be estimated by combining the equivalence class division and the necessary filling parameters. In this embodiment, through the interface test case quantity checking mechanism, whether the configuration quantity of the test cases is reasonable or not can be quickly judged.
In order to describe the interface test case detection method provided by the present application, a specific example is described below:
when a tester wants to execute an interface test for a certain interface, the automatic interface test case data of the relevant interface is configured on a deployed interface automatic test platform, an interface test case detection message is sent to a server, the server responds to the message to acquire the interface test case configuration data, logic frame data, namely template data, of a preset interface test case is read, the configuration data of the interface test case is automatically filled into a corresponding field based on the template data, and a corresponding automatic interface test case is generated. When a storage instruction of the test case is received, triggering a preset non-assertion case check event and a preset assertion case check event, and checking whether the compiled interface test case has a non-assertion case and an assertion case according to a non-assertion case check mechanism and an assertion case check mechanism to obtain a non-assertion check result and an assertion check result of the interface test case; and triggering a reverse case checking event and a test case quantity checking event when a preset case checking period is reached, such as 8 o' clock every day, and performing reverse case checking and test case quantity checking on the interface test cases according to the reverse case checking mechanism and the test case quantity checking mechanism to obtain reverse case checking results and quantity checking results of the interface test cases.
Specifically, when the no-assertion use case check is performed, whether the post-verification data contains both Verify and ForVerify methods may be scanned, and if neither the post-verification data contains both Verify and ForVerify methods, the no-assertion use case is determined. The assertion case checking may be checking the post-verification data of the current interface test case according to a preset interface post-verification rule, and if it is detected that the post-verification data lacks a corresponding parameter check item, determining that the interface test case is the assertion case. When the reverse case check is carried out, the parameter configuration of the interface can be scanned firstly to obtain the interface required item, namely the interface required parameter, then the interface test case under the interface is scanned, whether the condition of verifying the required parameter of the interface which is not transmitted exists or not exists, if the condition is not verified, the reverse case check is judged to be unqualified, and the interface is marked to be incompletely verified. And otherwise, if the interface test case carries out reverse verification on the necessary parameters, judging that the interface test case is a reverse case. The quantity check of the interface test cases may be according to the quantity of input parameters of the interface and according to the design method of the test cases, for example: and (3) estimating the number of the interface test cases by an equivalence class division method or a boundary value and the like, then comparing the configured interface test cases with the estimated number of the interface test cases, and if the difference between the configured number of the interface test cases and the estimated number of the interface test cases is larger, reminding the interface mark.
It should be understood that, although the steps in the flowcharts related to the embodiments as described above are sequentially displayed as indicated by arrows, the steps are not necessarily performed sequentially as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a part of the steps in the flowcharts related to the embodiments described above may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, and the execution order of the steps or stages is not necessarily sequential, but may be rotated or alternated with other steps or at least a part of the steps or stages in other steps.
Based on the same inventive concept, the embodiment of the present application further provides an interface test case detection apparatus for implementing the above-mentioned interface test case detection method. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme described in the above method, so that specific limitations in one or more embodiments of the interface test case detection device provided below can refer to the limitations on the interface test case detection method in the above description, and details are not described herein again.
In one embodiment, as shown in fig. 4, an interface test case detection apparatus is provided, which includes: a data acquisition module 510, a test case generation module 520, and a test case inspection module 530, wherein:
a data obtaining module 510, configured to obtain interface test case configuration data.
The test case generating module 520 is configured to generate an interface test case according to the interface test case configuration data and the preset interface test case template data.
The test case checking module 530 is configured to, when a preset case checking event is triggered, check the interface test case according to a case checking mechanism corresponding to the preset case checking event to obtain a checking result of the interface test case, where the preset case checking event includes a no-assertion case checking event, an assertion case checking event, a reverse case checking event, and a test case quantity checking event.
According to the interface test case detection device, the interface test case can be rapidly generated according to the interface test case configuration data and the preset interface test case template data, and when no assertion case inspection event, an assertion case inspection event, a reverse case inspection event and a test case quantity inspection event are triggered, the automatically generated interface test case can be inspected from multiple dimensions according to a corresponding case inspection mechanism, so that an accurate and comprehensive inspection result of the interface test case is obtained. By the aid of the scheme, automatic inspection of the interface test cases is realized, detection accuracy of the interface test cases is improved, problems of the interface test cases can be detected in time, error probability of the interface test cases is reduced, and quality of the interface test cases is improved.
In one embodiment, the test case checking module 530 is further configured to trigger the no-assertion case checking event and the assertion case checking event when receiving a save instruction of the test case, and check the interface test case according to the no-assertion case checking mechanism and the assertion case mechanism to obtain a no-assertion checking result and an assertion checking result of the interface test case, respectively; and when the preset case checking period is reached, triggering a reverse case checking event and a test case quantity checking event, checking the interface test case according to a reverse case checking mechanism and a test case quantity checking mechanism, and respectively obtaining a reverse case checking result and a quantity checking result of the interface test case.
In one embodiment, the test case checking module 530 is further configured to traverse the post-verification data of the interface test case, and if it is detected that the post-verification data does not include Verify method data and ForVerify method data, determine that the interface test case is a no-assertion case.
In one embodiment, the test case checking module 530 is further configured to check the post-verification data of the current interface test case according to a preset interface post-verification rule, and if it is detected that the post-verification data lacks a corresponding parameter check item, determine that the interface test case is an assertion case.
In one embodiment, the test case checking module 530 is further configured to obtain a must-pass parameter of an interface corresponding to the interface test case, traverse the interface test case corresponding to the interface, and determine that the interface test case is a reverse case if it is detected that the interface test case performs reverse verification on the must-pass parameter.
In one embodiment, the test case checking module 530 is further configured to obtain the configured number of the interface test cases, estimate the number of the interface test cases according to a boundary value method or an equivalence class division method, obtain the estimated number of the interface test cases, and compare the configured number of the interface test cases with the estimated number of the interface test cases, to obtain the number checking result of the interface test cases.
All or part of each module in the interface test case detection device can be realized by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as shown in fig. 5. The computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer equipment is used for storing interface test case configuration data, interface test case template data and the like. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement an interface test case detection method.
Those skilled in the art will appreciate that the architecture shown in fig. 5 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided, which includes a memory and a processor, where the memory stores a computer program, and the processor implements the steps in the interface test case detection method when executing the computer program.
In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and the computer program, when executed by a processor, implements the steps in the interface test case detection method described above.
In one embodiment, a computer program product is provided, which includes a computer program that, when executed by a processor, implements the steps in the interface test case detection method described above.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, database, or other medium used in the embodiments provided herein may include at least one of non-volatile and volatile memory. The nonvolatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical Memory, high-density embedded nonvolatile Memory, resistive Random Access Memory (ReRAM), Magnetic Random Access Memory (MRAM), Ferroelectric Random Access Memory (FRAM), Phase Change Memory (PCM), graphene Memory, and the like. Volatile Memory can include Random Access Memory (RAM), external cache Memory, and the like. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others. The databases referred to in various embodiments provided herein may include at least one of relational and non-relational databases. The non-relational database may include, but is not limited to, a block chain based distributed database, and the like. The processors referred to in the embodiments provided herein may be general purpose processors, central processing units, graphics processors, digital signal processors, programmable logic devices, quantum computing based data processing logic devices, etc., without limitation.
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present application. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present application shall be subject to the appended claims.

Claims (10)

1. An interface test case detection method, the method comprising:
acquiring interface test case configuration data;
generating an interface test case according to the interface test case configuration data and preset interface test case template data;
when a preset case inspection event is triggered, inspecting the interface test case according to a case inspection mechanism corresponding to the preset case inspection event to obtain an inspection result of the interface test case;
the preset use case checking event comprises a no-assertion use case checking event, an assertion use case checking event, a reverse use case checking event and a test use case quantity checking event.
2. The method according to claim 1, wherein when a preset case check event is triggered, checking the interface test case according to a case check mechanism corresponding to the preset case check event, and obtaining a check result of the interface test case comprises:
when a storage instruction of the test case is received, triggering the no-assertion case check event and the assertion case check event, checking the interface test case according to the no-assertion case check mechanism and the assertion case mechanism, and respectively obtaining a no-assertion check result and an assertion check result of the interface test case;
and when a preset case checking period is reached, triggering the reverse case checking event and the test case quantity checking event, checking the interface test case according to a reverse case checking mechanism and a test case quantity checking mechanism, and respectively obtaining a reverse case checking result and a quantity checking result of the interface test case.
3. The method according to claim 2, wherein inspecting the interface test case according to an assertion-free case inspection mechanism comprises:
traversing the post-verification data of the interface test case;
and if the fact that the post-verification data does not contain Verify method data and Forverify method data is detected, judging that the interface test case is a no-assertion case.
4. The method according to claim 2, wherein inspecting the interface test case according to an assertion case inspection mechanism comprises:
checking the post-verification data of the current interface test case according to a preset interface post-verification rule;
and if the fact that the post-check data lacks the corresponding parameter check item is detected, judging that the interface test case is an assertion case.
5. The method according to claim 2, wherein inspecting the interface test case according to a reverse case inspection mechanism comprises:
acquiring essential transmission parameters of an interface corresponding to an interface test case;
traversing an interface test case corresponding to the interface;
and if the interface test case is detected to carry out reverse verification on the necessary transmission parameters, judging that the interface test case is a reverse case.
6. The method according to claim 2, wherein the checking the interface test cases according to a test case quantity checking mechanism comprises:
acquiring the configured number of the interface test cases;
estimating the number of the interface test cases according to a boundary value method or an equivalence class division method to obtain the estimated number of the interface test cases;
and comparing the configured quantity of the interface test cases with the estimated quantity of the interface test cases to obtain a quantity check result of the interface test cases.
7. An interface test case detection apparatus, the apparatus comprising:
the data acquisition module is used for acquiring interface test case configuration data;
the test case generation module is used for generating an interface test case according to the interface test case configuration data and preset interface test case template data;
the test case checking module is used for checking the interface test case according to a case checking mechanism corresponding to a preset case checking event when the preset case checking event is triggered to obtain a checking result of the interface test case;
the preset use case checking event comprises a no-assertion use case checking event, an assertion use case checking event, a reverse use case checking event and a test use case quantity checking event.
8. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the method of any of claims 1 to 6.
9. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 6.
10. A computer program product comprising a computer program, characterized in that the computer program realizes the steps of the method of any one of claims 1 to 6 when executed by a processor.
CN202111533189.7A 2021-12-15 2021-12-15 Interface test case detection method and device, computer equipment and storage medium Pending CN114185798A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111533189.7A CN114185798A (en) 2021-12-15 2021-12-15 Interface test case detection method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111533189.7A CN114185798A (en) 2021-12-15 2021-12-15 Interface test case detection method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114185798A true CN114185798A (en) 2022-03-15

Family

ID=80605130

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111533189.7A Pending CN114185798A (en) 2021-12-15 2021-12-15 Interface test case detection method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114185798A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117667748A (en) * 2024-01-31 2024-03-08 成都翌创微电子有限公司 Chip system level verification method based on composite framework

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117667748A (en) * 2024-01-31 2024-03-08 成都翌创微电子有限公司 Chip system level verification method based on composite framework
CN117667748B (en) * 2024-01-31 2024-04-09 成都翌创微电子有限公司 Chip system level verification method based on composite framework

Similar Documents

Publication Publication Date Title
CN111143163B (en) Data monitoring method, device, computer equipment and storage medium
US11310140B2 (en) Mitigating failure in request handling
CN108256322B (en) Security testing method and device, computer equipment and storage medium
CN112631926B (en) Code test coverage rate display method and device, computer equipment and storage medium
CN109325010A (en) Log inspection method, device, computer equipment and storage medium
CN111881014A (en) System test method, device, storage medium and electronic equipment
CN108399125B (en) Automatic testing method and device, computer equipment and storage medium
CN114356631A (en) Fault positioning method and device, computer equipment and storage medium
CN108920357A (en) Operation system detection method, device, computer equipment and storage medium
CN114185798A (en) Interface test case detection method and device, computer equipment and storage medium
CN110347565B (en) Application program abnormity analysis method and device and electronic equipment
CN107451056B (en) Method and device for monitoring interface test result
CN111444093B (en) Method and device for determining quality of project development process and computer equipment
CN112416735B (en) Application program detection method and device, terminal equipment and storage medium
CN116843314A (en) Monitoring terminal operation and maintenance management method, system, equipment and storage medium
CN114629690B (en) Device safety baseline compliance detection method and device and computer device
CN115587041A (en) Mobile application delivery task processing method and device, electronic equipment and storage medium
CN113672507A (en) Software source code detection method and device, computer equipment and storage medium
CN114218056B (en) Performance test method and device for transaction system, computer equipment and storage medium
CN114490361A (en) Test script quality obtaining method and device, computer equipment and storage medium
CN117194157A (en) Monitoring index checking method, device, equipment, medium and program product
US11086707B2 (en) Image-based detection of errors in application state
CN114780401A (en) Interface testing method and device, computer equipment and storage medium
CN116719659A (en) Vehicle fault detection method, device, equipment and storage medium
CN116521557A (en) Verification method and device for test cases, electronic equipment and storage medium

Legal Events

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