CN113282496A - Automatic interface test method, device, equipment and storage medium - Google Patents
Automatic interface test method, device, equipment and storage medium Download PDFInfo
- Publication number
- CN113282496A CN113282496A CN202110597398.1A CN202110597398A CN113282496A CN 113282496 A CN113282496 A CN 113282496A CN 202110597398 A CN202110597398 A CN 202110597398A CN 113282496 A CN113282496 A CN 113282496A
- Authority
- CN
- China
- Prior art keywords
- interface
- test
- abnormal
- development
- case
- 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
Links
- 238000010998 test method Methods 0.000 title claims description 9
- 238000012360 testing method Methods 0.000 claims abstract description 328
- 230000002159 abnormal effect Effects 0.000 claims abstract description 156
- 238000011161 development Methods 0.000 claims abstract description 108
- 230000008439 repair process Effects 0.000 claims abstract description 77
- 238000004458 analytical method Methods 0.000 claims abstract description 12
- 238000000034 method Methods 0.000 claims description 23
- 238000001514 detection method Methods 0.000 claims description 14
- 230000002776 aggregation Effects 0.000 claims description 4
- 238000004220 aggregation Methods 0.000 claims description 4
- 238000004590 computer program Methods 0.000 claims description 4
- 238000007726 management method Methods 0.000 abstract description 43
- 238000005516 engineering process Methods 0.000 abstract description 4
- 238000012827 research and development Methods 0.000 abstract description 2
- 238000004891 communication Methods 0.000 description 9
- 230000006870 function Effects 0.000 description 8
- 230000008569 process Effects 0.000 description 8
- 238000010586 diagram Methods 0.000 description 4
- 238000012423 maintenance Methods 0.000 description 4
- 238000013461 design Methods 0.000 description 2
- 238000012545 processing Methods 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 1
- 238000004422 calculation algorithm Methods 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 238000013522 software testing Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3684—Test management for test design, e.g. generating new test cases
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3688—Test management for test execution, e.g. scheduling of test suites
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
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 invention relates to a research and development management technology, and discloses an automatic interface testing method, which comprises the following steps: generating an interface test script with development identification based on an interface to be detected and a test case set corresponding to the interface to be detected, creating an interface test task by using the interface test script, operating the interface test task to obtain a test case result, performing abnormity analysis on the test case result to obtain an abnormal interface, inputting the abnormal interface into a pre-constructed abnormity management library, developing a repair terminal based on the development identification association, and performing case regression test on the repair interface fed back by the development repair terminal by using the abnormal management library to obtain a regression test result. In addition, the invention also relates to a block chain technology, and the regression test result can be stored in a node of the block chain. The invention also provides an automatic interface testing device, electronic equipment and a computer readable storage medium. The invention can solve the problem of low interface testing efficiency.
Description
Technical Field
The present invention relates to the field of research and development management technologies, and in particular, to an automatic interface testing method and apparatus, an electronic device, and a computer-readable storage medium.
Background
For background interface test and interface test case maintenance, in the prior art, under the condition that the number of version iterations is large or the functions of a client terminal are more and more complex, due to the increase of the number of interfaces, when a plurality of failed test cases exist, the release standard can be met only by performing interface test for many times, so that the number of abnormal interfaces needing to be maintained and the number of failed interface test cases are more and more. Too many cases fail and can occupy more and more human resources, and the maintenance cost is higher, needs the manual work to carry out the work of typeeing of unusual interface according to the interface test report simultaneously, and the problem that the mistake often appears and type inefficiency is typeeed to the typeeing, leads to the interface efficiency of software testing lower, seriously influences daily test work arrangement.
Disclosure of Invention
The invention provides an automatic interface testing method, device, equipment and storage medium, and mainly aims to solve the problem of low interface testing efficiency.
In order to achieve the above object, the present invention provides an automatic interface testing method, which includes:
acquiring a development identifier of a development and repair terminal, and generating an interface test script with the development identifier based on an interface to be detected and a test case set corresponding to the interface to be detected;
creating an interface test task by using the interface test script, and running the interface test task to obtain a test case result;
carrying out anomaly analysis on the test case result to obtain an abnormal interface;
inputting the abnormal interface into a pre-constructed abnormal management library, and associating a development and repair terminal based on the development identifier;
and performing case regression testing on the restoration interface fed back by the development and restoration terminal by using the abnormal management library to obtain a regression testing result.
Optionally, the generating an interface test script with the development identifier based on the interface to be detected and the test case set corresponding to the interface to be detected includes:
generating a unique identifier of the interface to be detected, and associating the interface to be detected and a test case set corresponding to the interface to be detected by using the unique identifier;
converting the associated test case set into an original test script by using a preset interface test tool;
and adding the development identification of the development and repair terminal in the original test script to obtain the interface test script.
Optionally, the running the interface test task to obtain a test case result includes:
detecting all test cases in the associated test case set by using the interface test task and the interface to be detected;
if one test case passes the detection, determining that the test case result is that the test passes;
and if one of the test cases fails to pass the detection, determining that the test case result is that the test does not pass.
Optionally, the performing an exception analysis on the test case result to obtain an exception interface includes:
taking the test case which fails the test as an abnormal case, marking the abnormal case, and recording the abnormal times of the abnormal case;
calculating the ratio of the abnormal times to the test case aggregation case number;
and when the ratio is larger than a preset abnormal threshold value, determining that the interface to be detected corresponding to the abnormal case is an abnormal interface.
Optionally, the entering the exception interface into a pre-constructed exception management library includes:
sequentially carrying out abnormity marking detection on the interface test tasks;
when detecting that an abnormal use case mark exists in the interface test task, establishing an abnormal input task;
and importing all abnormal cases and abnormal interfaces in the interface test task into the abnormal management library according to the abnormal entry task.
Optionally, the developing and repairing terminal based on the development identifier association includes:
searching for a development and repair terminal with the same development identifier according to the development identifier;
and pushing the abnormal interface in the abnormal management library to the development and repair terminal.
Optionally, the performing, by using the exception management library, a case regression test on the repair interface fed back by the development and repair terminal to obtain a regression test result includes:
testing the repair interface by using the abnormal case in the abnormal management library to obtain a test result of the repair interface;
when the abnormal cases do not pass the test completely in the test result of the repair interface, taking the repair interface as an abnormal interface, and returning to the step of inputting the abnormal interface into a pre-constructed abnormal management library;
and when all the abnormal cases pass the test in the test result of the repair interface, summarizing all the repair interfaces to obtain the regression test result.
In order to solve the above problem, the present invention further provides an automatic interface testing apparatus, including:
the test script generating module is used for acquiring a development identifier of a development and repair terminal and generating an interface test script with the development identifier based on an interface to be detected and a test case set corresponding to the interface to be detected;
the interface test module is used for creating an interface test task by using the interface test script and running the interface test task to obtain a test case result;
the abnormal interface determining module is used for carrying out abnormal analysis on the test case result to obtain an abnormal interface;
the identification association module is used for inputting the abnormal interface into a pre-constructed abnormal management library and associating a development and repair terminal based on the development identification;
and the case regression testing module is used for carrying out case regression testing on the restoration interface fed back by the development and restoration terminal by utilizing the abnormity management library to obtain a regression testing result.
In order to solve the above problem, the present invention also provides an electronic device, including:
a memory storing at least one instruction; and
and the processor executes the instructions stored in the memory to realize the automatic interface test method.
In order to solve the above problem, the present invention further provides a computer-readable storage medium, in which at least one instruction is stored, and the at least one instruction is executed by a processor in an electronic device to implement the above automatic interface testing method.
According to the invention, the abnormal interface can be automatically input by utilizing the abnormal management library, so that the interface input efficiency is improved, the abnormal management library and the development and repair terminal can be associated based on the development identification in the interface test script, a tester does not need to manually collect the abnormal interface to push the development and repair personnel, and the interface test efficiency is improved. Therefore, the interface automatic test method, the device, the electronic equipment and the computer readable storage medium provided by the invention can solve the problem of low interface test efficiency.
Drawings
Fig. 1 is a schematic flow chart illustrating an automatic interface testing method according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart showing a detailed implementation of one of the steps in FIG. 1;
FIG. 3 is a schematic flow chart showing another step of FIG. 1;
FIG. 4 is a schematic flow chart showing another step of FIG. 1;
FIG. 5 is a functional block diagram of an automatic interface testing apparatus according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of an electronic device implementing the interface automatic test method according to an embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The embodiment of the application provides an automatic interface testing method. The execution subject of the interface automatic test method includes, but is not limited to, at least one of electronic devices that can be configured to execute the method provided by the embodiments of the present application, such as a server, a terminal, and the like. In other words, the interface automatic test method may be performed by software or hardware installed in the terminal device or the server device, and the software may be a block chain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, and the like.
Fig. 1 is a schematic flow chart of an interface automatic testing method according to an embodiment of the present invention. In this embodiment, the method for automatically testing an interface includes:
s1, acquiring a development identifier of the development and repair terminal, and generating an interface test script with the development identifier based on the interface to be detected and the test case set corresponding to the interface to be detected.
In the embodiment of the present invention, the interface to be detected is a part used for connecting and interacting with an external system, a system and each internal subsystem, and is mainly used for exchanging data, transmitting and controlling a management process, mutual logic dependency relationships between systems, and the like, including a process interface, a scene interface, and the like. The process interface refers to an interface related to a business process, and can be combined with other interfaces to form a complete business flow according to the business characteristics of the interface, including: the method comprises the steps of registering an interface, logging in an interface and the like, wherein the scene interface refers to an interface used for different service scenes and is used for verifying whether the content format and the field content of a single interface meet the design requirements or not, and the scene interface is generally independent of other interfaces, such as an interface which is set according to different interface request contents, an interface which is set according to different interface field types and the like. The test case set is designed from the three aspects of the service flow, the request content structure and the parameter validity according to the functions and the parameters of the interface and is used for detecting whether the functions and the structures of the interface to be detected are normal. The development and repair terminal is terminal equipment used by a developer, and the development identification is used for associating an interface test task and developing and repairing the terminal.
Specifically, referring to fig. 2, the generating an interface test script with the development identifier based on the interface to be detected and the test case suite corresponding to the interface to be detected includes:
s10, generating a unique identifier of the interface to be detected, and associating the interface to be detected and a test case set corresponding to the interface to be detected by using the unique identifier;
s11, converting the associated test case set into an original test script by using a preset interface test tool;
and S12, adding the development identification of the development and repair terminal in the original test script to obtain the interface test script.
In the embodiment of the invention, each interface to be detected has a plurality of test case sets, and the unique identifier is used for corresponding the interface to be detected with the corresponding test case set, so that the accuracy of interface test can be ensured. The preset interface test tool can be an interface test tool such as a jmeter and postman, and the interface test tool can generate a test script of the interface according to the interface to be detected and the test case set. The development identification can be a terminal mark of a development and repair person, and is convenient to directly push to the development and repair person.
And S2, creating an interface test task by using the interface test script, and running the interface test task to obtain a test case result.
In the embodiment of the invention, the interface test task uses the interface to be detected to detect the test cases in the test case set by executing the interface test script, and judges whether the interface to be detected is abnormal or not according to the result of the test cases.
Specifically, the running the interface test task to obtain a test case result includes:
detecting all test cases in the associated test case set by using the interface test task and the interface to be detected;
if one test case passes the detection, determining that the test case result is that the test passes;
and if one of the test cases fails to pass the detection, determining that the test case result is that the test does not pass.
In an optional embodiment of the present invention, the test case is used to determine whether the interface to be detected is normal, if the test case passes, it is determined that the interface to be detected is normal, and if the test case does not pass, it is determined that the interface to be detected is abnormal.
And S3, carrying out exception analysis on the test case result to obtain an exception interface.
Specifically, referring to fig. 3, performing exception analysis on the test case result to obtain an exception interface includes:
s30, taking the test case which fails the test as an abnormal case, marking the abnormal case, and recording the abnormal times of the abnormal case;
s31, calculating the ratio of the abnormal times to the test case aggregation case number;
and S32, when the ratio is larger than a preset abnormal threshold value, determining that the interface to be detected corresponding to the abnormal use case is an abnormal interface.
In an optional embodiment of the present invention, for example, the exception case flag may be a "Bug" flag, and when a ratio of the number of cases that do not pass the test to the total number of cases exceeds a preset exception threshold (which may be 30%), the "Bug" flag is marked on the exception case.
In the embodiment of the invention, whether the interface to be detected is abnormal can be rapidly and accurately determined according to the total number of test cases, the number of cases passing the test and the number of cases failing the test of each interface to be detected, so that the efficiency of detecting the interface is improved.
And S4, inputting the abnormal interface into a pre-constructed abnormal management library, and associating a development and repair terminal based on the development identifier.
Specifically, referring to fig. 4, entering the exception interface into a pre-constructed exception management library includes:
s40, sequentially carrying out abnormity marking detection on the interface test tasks;
s41, when detecting that the interface test task has an abnormal use case mark, creating an abnormal entry task;
and S42, importing all abnormal cases and abnormal interfaces in the interface testing task into the abnormal management library according to the abnormal entry task.
In the embodiment of the invention, the abnormal cases are marked, and the abnormal management library is used for automatically inputting the interface, so that the abnormal cases do not need to be screened and input manually, the manpower resource consumption of the test is greatly saved, and the efficiency of the interface test is improved.
In detail, the developing and repairing terminal based on the development identifier association includes:
searching for a development and repair terminal with the same development identifier according to the development identifier;
and pushing the abnormal interface in the abnormal management library to the development and repair terminal.
In an optional embodiment of the invention, because the development identifier is added in the interface test script, the abnormal management library can directly push the abnormal interface to the terminal of the corresponding developer through the development identifier without manually collecting the abnormal interface, thereby improving the maintenance efficiency of interface detection.
And S5, performing case regression testing on the repair interface fed back by the development and repair terminal by using the abnormity management library to obtain a regression testing result.
Specifically, the performing, by using the exception management library, a case regression test on the repair interface fed back by the development and repair terminal to obtain a regression test result includes:
testing the repair interface by using the abnormal case in the abnormal management library to obtain a test result of the repair interface;
when the abnormal cases do not pass all tests in the test result of the repair interface, taking the repair interface as an abnormal interface, and returning to S4;
and when all the abnormal cases pass the test in the test result of the repair interface, summarizing all the repair interfaces to obtain the regression test result.
In the embodiment of the invention, after the restoration interface fed back by a developer is received, the restoration interface is tested by directly utilizing the abnormal case in the abnormal management library without repeatedly testing the passed test case, thereby greatly improving the pertinence of the restoration interface test and further improving the efficiency of the interface test.
According to the invention, the abnormal interface can be automatically input by utilizing the abnormal management library, so that the interface input efficiency is improved, the abnormal management library and the development and repair terminal can be associated based on the development identification in the interface test script, a tester does not need to manually collect the abnormal interface to push the development and repair personnel, and the interface test efficiency is improved. Therefore, the embodiment of the invention can solve the problem of low interface testing efficiency.
Fig. 5 is a functional block diagram of an automatic interface testing device according to an embodiment of the present invention.
The automatic interface test apparatus 100 according to the present invention may be installed in an electronic device. According to the implemented functions, the automatic interface testing device 100 may include a test script generation module 101, an interface testing module 102, an abnormal interface determination module 103, an identifier association module 104, and a use case regression testing module 105. The module of the present invention, which may also be referred to as a unit, refers to a series of computer program segments that can be executed by a processor of an electronic device and that can perform a fixed function, and that are stored in a memory of the electronic device.
In the present embodiment, the functions regarding the respective modules/units are as follows:
the test script generating module 101 is configured to obtain a development identifier of a development and repair terminal, and generate an interface test script with the development identifier based on an interface to be detected and a test case set corresponding to the interface to be detected.
In the embodiment of the present invention, the interface to be detected is a part used for connecting and interacting with an external system, a system and each internal subsystem, and is mainly used for exchanging data, transmitting and controlling a management process, mutual logic dependency relationships between systems, and the like, including a process interface, a scene interface, and the like. The process interface refers to an interface related to a business process, and can be combined with other interfaces to form a complete business flow according to the business characteristics of the interface, including: the method comprises the steps of registering an interface, logging in an interface and the like, wherein the scene interface refers to an interface used for different service scenes and is used for verifying whether the content format and the field content of a single interface meet the design requirements or not, and the scene interface is generally independent of other interfaces, such as an interface which is set according to different interface request contents, an interface which is set according to different interface field types and the like. The test case set is designed from the three aspects of the service flow, the request content structure and the parameter validity according to the functions and the parameters of the interface and is used for detecting whether the functions and the structures of the interface to be detected are normal. The development and repair terminal is terminal equipment used by a developer, and the development identification is used for associating an interface test task and developing and repairing the terminal.
Specifically, the test script generating module 101 generates an interface test script with the development identifier by:
generating a unique identifier of the interface to be detected, and associating the interface to be detected and a test case set corresponding to the interface to be detected by using the unique identifier;
converting the associated test case set into an original test script by using a preset interface test tool;
and adding the development identification of the development and repair terminal in the original test script to obtain the interface test script.
In the embodiment of the invention, each interface to be detected has a plurality of test case sets, and the unique identifier is used for corresponding the interface to be detected with the corresponding test case set, so that the accuracy of interface test can be ensured. The preset interface test tool can be an interface test tool such as a jmeter and postman, and the interface test tool can generate a test script of the interface according to the interface to be detected and the test case set. The development identification can be a terminal mark of a development and repair person, and is convenient to directly push to the development and repair person.
The interface test module 102 is configured to create an interface test task by using the interface test script, and run the interface test task to obtain a test case result.
In the embodiment of the invention, the interface test task uses the interface to be detected to detect the test cases in the test case set by executing the interface test script, and judges whether the interface to be detected is abnormal or not according to the result of the test cases.
Specifically, the interface test module 102 obtains the test case result by the following operations, including:
detecting all test cases in the associated test case set by using the interface test task and the interface to be detected;
if one test case passes the detection, determining that the test case result is that the test passes;
and if one of the test cases fails to pass the detection, determining that the test case result is that the test does not pass.
In an optional embodiment of the present invention, the test case is used to determine whether the interface to be detected is normal, if the test case passes, it is determined that the interface to be detected is normal, and if the test case does not pass, it is determined that the interface to be detected is abnormal.
The abnormal interface determining module 103 is configured to perform abnormal analysis on the test case result to obtain an abnormal interface.
Specifically, the abnormal interface determination module 103 obtains an abnormal interface by the following operations:
taking the test case which fails the test as an abnormal case, marking the abnormal case, and recording the abnormal times of the abnormal case;
calculating the ratio of the abnormal times to the test case aggregation case number;
and when the ratio is larger than a preset abnormal threshold value, determining that the interface to be detected corresponding to the abnormal case is an abnormal interface.
In an optional embodiment of the present invention, for example, the exception case flag may be a "Bug" flag, and when a ratio of the number of cases that do not pass the test to the total number of cases exceeds a preset exception threshold (which may be 30%), the "Bug" flag is marked on the exception case.
In the embodiment of the invention, whether the interface to be detected is abnormal can be rapidly and accurately determined according to the total number of test cases, the number of cases passing the test and the number of cases failing the test of each interface to be detected, so that the efficiency of detecting the interface is improved.
The identifier association module 104 is configured to enter the exception interface into a pre-constructed exception management library, and associate a development and repair terminal based on the development identifier.
Specifically, the identification association module 104 enters the exception interface into a pre-constructed exception management library by:
sequentially carrying out abnormity marking detection on the interface test tasks;
when detecting that an abnormal use case mark exists in the interface test task, establishing an abnormal input task;
and importing all abnormal cases and abnormal interfaces in the interface test task into the abnormal management library according to the abnormal entry task.
In the embodiment of the invention, the abnormal cases are marked, and the abnormal management library is used for automatically inputting the interface, so that the abnormal cases do not need to be screened and input manually, the manpower resource consumption of the test is greatly saved, and the efficiency of the interface test is improved.
In detail, the identity associating module 104 associates, based on the development identity, a development and repair terminal by:
searching for a development and repair terminal with the same development identifier according to the development identifier;
and pushing the abnormal interface in the abnormal management library to the development and repair terminal.
In an optional embodiment of the invention, because the development identifier is added in the interface test script, the abnormal management library can directly push the abnormal interface to the terminal of the corresponding developer through the development identifier without manually collecting the abnormal interface, thereby improving the maintenance efficiency of interface detection.
The case regression testing module 105 is configured to perform case regression testing on the repair interface fed back by the development and repair terminal by using the anomaly management library to obtain a regression testing result.
Specifically, the use case regression testing module 105 obtains the regression testing result by the following operations, including:
testing the repair interface by using the abnormal case in the abnormal management library to obtain a test result of the repair interface;
when the abnormal cases do not pass the test in the test result of the repair interface, taking the repair interface as an abnormal interface and returning to the identifier association module 104;
and when all the abnormal cases pass the test in the test result of the repair interface, summarizing all the repair interfaces to obtain the regression test result.
In the embodiment of the invention, after the restoration interface fed back by a developer is received, the restoration interface is tested by directly utilizing the abnormal case in the abnormal management library without repeatedly testing the passed test case, thereby greatly improving the pertinence of the restoration interface test and further improving the efficiency of the interface test.
Fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present invention, which includes a processor 111, a communication interface 112, a memory 113, and a communication bus 114, where the processor 111, the communication interface 112, and the memory 113 complete mutual communication via the communication bus 114,
a memory 113 for storing a computer program such as an interface automatic test generation program;
in an embodiment of the present application, when the processor 111 is configured to execute the program stored in the memory 113, the method for automatically testing an interface provided in any one of the foregoing method embodiments is implemented, including:
acquiring a development identifier of a development and repair terminal, and generating an interface test script with the development identifier based on an interface to be detected and a test case set corresponding to the interface to be detected;
creating an interface test task by using the interface test script, and running the interface test task to obtain a test case result;
carrying out anomaly analysis on the test case result to obtain an abnormal interface;
inputting the abnormal interface into a pre-constructed abnormal management library, and associating a development and repair terminal based on the development identifier;
and performing case regression testing on the restoration interface fed back by the development and restoration terminal by using the abnormal management library to obtain a regression testing result.
The communication bus 114 may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus 114 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface 112 is used for communication between the above-described electronic apparatus and other apparatuses.
The memory 113 may include a Random Access Memory (RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory. Optionally, the memory 113 may also be at least one storage device located remotely from the processor 111.
The processor 111 may be a general-purpose processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the integrated circuit may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic device, or discrete hardware components.
The present invention also provides a computer-readable storage medium, storing a computer program which, when executed by a processor of an electronic device, may implement:
acquiring a development identifier of a development and repair terminal, and generating an interface test script with the development identifier based on an interface to be detected and a test case set corresponding to the interface to be detected;
creating an interface test task by using the interface test script, and running the interface test task to obtain a test case result;
carrying out anomaly analysis on the test case result to obtain an abnormal interface;
inputting the abnormal interface into a pre-constructed abnormal management library, and associating a development and repair terminal based on the development identifier;
and performing case regression testing on the restoration interface fed back by the development and restoration terminal by using the abnormal management library to obtain a regression testing result.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus, device and method can be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is only one logical functional division, and other divisions may be realized in practice.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional modules in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional module.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof.
The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference signs in the claims shall not be construed as limiting the claim concerned.
The block chain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
Furthermore, it is obvious that the word "comprising" does not exclude other elements or steps, and the singular does not exclude the plural. A plurality of units or means recited in the system claims may also be implemented by one unit or means in software or hardware. The terms second, etc. are used to denote names, but not any particular order.
Finally, it should be noted that the above embodiments are only for illustrating the technical solutions of the present invention and not for limiting, and although the present invention is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions may be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.
Claims (10)
1. An automatic interface testing method, characterized in that the method comprises:
acquiring a development identifier of a development and repair terminal, and generating an interface test script with the development identifier based on an interface to be detected and a test case set corresponding to the interface to be detected;
creating an interface test task by using the interface test script, and running the interface test task to obtain a test case result;
carrying out anomaly analysis on the test case result to obtain an abnormal interface;
inputting the abnormal interface into a pre-constructed abnormal management library, and associating a development and repair terminal based on the development identifier;
and performing case regression testing on the restoration interface fed back by the development and restoration terminal by using the abnormal management library to obtain a regression testing result.
2. The method according to claim 1, wherein the generating an interface test script with the development identifier based on the interface to be detected and the test case suite corresponding to the interface to be detected comprises:
generating a unique identifier of the interface to be detected, and associating the interface to be detected and a test case set corresponding to the interface to be detected by using the unique identifier;
converting the associated test case set into an original test script by using a preset interface test tool;
and adding the development identification of the development and repair terminal in the original test script to obtain the interface test script.
3. The method for automatically testing an interface of claim 2, wherein the running the interface test task to obtain a test case result comprises:
detecting all test cases in the associated test case set by using the interface test task and the interface to be detected;
if one test case passes the detection, determining that the test case result is that the test passes;
and if one of the test cases fails to pass the detection, determining that the test case result is that the test does not pass.
4. The method according to claim 3, wherein the performing an exception analysis on the test case result to obtain an exception interface comprises:
taking the test case which fails the test as an abnormal case, marking the abnormal case, and recording the abnormal times of the abnormal case;
calculating the ratio of the abnormal times to the test case aggregation case number;
and when the ratio is larger than a preset abnormal threshold value, determining that the interface to be detected corresponding to the abnormal case is an abnormal interface.
5. The method for automatically testing an interface of claim 4, wherein said entering the exception interface into a pre-built exception management library comprises:
sequentially carrying out abnormity marking detection on the interface test tasks;
when detecting that an abnormal use case mark exists in the interface test task, establishing an abnormal input task;
and importing all abnormal cases and abnormal interfaces in the interface test task into the abnormal management library according to the abnormal entry task.
6. The interface automatic test method of claim 5, wherein associating a development repair terminal based on the development identifier comprises:
searching for a development and repair terminal with the same development identifier according to the development identifier;
and pushing the abnormal interface in the abnormal management library to the development and repair terminal.
7. The method according to claim 4, wherein the performing a case regression test on the repair interface fed back by the development and repair terminal by using the anomaly management library to obtain a regression test result includes:
testing the repair interface by using the abnormal case in the abnormal management library to obtain a test result of the repair interface;
when the abnormal cases do not pass the test completely in the test result of the repair interface, taking the repair interface as an abnormal interface, and returning to the step of inputting the abnormal interface into a pre-constructed abnormal management library;
and when all the abnormal cases pass the test in the test result of the repair interface, summarizing all the repair interfaces to obtain the regression test result.
8. An automatic interface test device, comprising:
the test script generating module is used for acquiring a development identifier of a development and repair terminal and generating an interface test script with the development identifier based on an interface to be detected and a test case set corresponding to the interface to be detected;
the interface test module is used for creating an interface test task by using the interface test script and running the interface test task to obtain a test case result;
the abnormal interface determining module is used for carrying out abnormal analysis on the test case result to obtain an abnormal interface;
the identification association module is used for inputting the abnormal interface into a pre-constructed abnormal management library and associating a development and repair terminal based on the development identification;
and the case regression testing module is used for carrying out case regression testing on the restoration interface fed back by the development and restoration terminal by utilizing the abnormity management library to obtain a regression testing result.
9. An electronic device, characterized in that the electronic device comprises:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of automatic interface testing of any of claims 1 to 7.
10. A computer-readable storage medium, in which a computer program is stored, which, when being executed by a processor, implements an interface automatic test method according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110597398.1A CN113282496B (en) | 2021-05-31 | 2021-05-31 | Automatic interface testing method, device, equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110597398.1A CN113282496B (en) | 2021-05-31 | 2021-05-31 | Automatic interface testing method, device, equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113282496A true CN113282496A (en) | 2021-08-20 |
CN113282496B CN113282496B (en) | 2024-04-02 |
Family
ID=77282576
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110597398.1A Active CN113282496B (en) | 2021-05-31 | 2021-05-31 | Automatic interface testing method, device, equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113282496B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114116522A (en) * | 2022-01-27 | 2022-03-01 | 四川野马科技有限公司 | Swagger-based method for automatically testing interface |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104407971A (en) * | 2014-11-18 | 2015-03-11 | 中国电子科技集团公司第十研究所 | Method for automatically testing embedded software |
CN107943682A (en) * | 2016-10-13 | 2018-04-20 | 北京国双科技有限公司 | Submit the method and device of bug |
CN108038052A (en) * | 2017-11-27 | 2018-05-15 | 平安科技(深圳)有限公司 | Automatic test management method, device, terminal device and storage medium |
CN109947641A (en) * | 2019-02-20 | 2019-06-28 | 北京百佑科技有限公司 | Automated testing method and device |
WO2019144681A1 (en) * | 2018-01-23 | 2019-08-01 | 网易(杭州)网络有限公司 | Automated testing method and apparatus, storage medium and electronic device |
CN111198813A (en) * | 2018-11-20 | 2020-05-26 | 北京京东尚科信息技术有限公司 | Interface testing method and device |
CN111782502A (en) * | 2019-12-13 | 2020-10-16 | 北京沃东天骏信息技术有限公司 | Automatic testing method and device |
US10831645B1 (en) * | 2019-07-18 | 2020-11-10 | International Business Machines Corporation | Developer-based test case selection |
CN112527655A (en) * | 2020-12-16 | 2021-03-19 | 平安银行股份有限公司 | Software version quality abnormity detection method and device, electronic equipment and storage medium |
-
2021
- 2021-05-31 CN CN202110597398.1A patent/CN113282496B/en active Active
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104407971A (en) * | 2014-11-18 | 2015-03-11 | 中国电子科技集团公司第十研究所 | Method for automatically testing embedded software |
CN107943682A (en) * | 2016-10-13 | 2018-04-20 | 北京国双科技有限公司 | Submit the method and device of bug |
CN108038052A (en) * | 2017-11-27 | 2018-05-15 | 平安科技(深圳)有限公司 | Automatic test management method, device, terminal device and storage medium |
WO2019144681A1 (en) * | 2018-01-23 | 2019-08-01 | 网易(杭州)网络有限公司 | Automated testing method and apparatus, storage medium and electronic device |
CN111198813A (en) * | 2018-11-20 | 2020-05-26 | 北京京东尚科信息技术有限公司 | Interface testing method and device |
CN109947641A (en) * | 2019-02-20 | 2019-06-28 | 北京百佑科技有限公司 | Automated testing method and device |
US10831645B1 (en) * | 2019-07-18 | 2020-11-10 | International Business Machines Corporation | Developer-based test case selection |
CN111782502A (en) * | 2019-12-13 | 2020-10-16 | 北京沃东天骏信息技术有限公司 | Automatic testing method and device |
CN112527655A (en) * | 2020-12-16 | 2021-03-19 | 平安银行股份有限公司 | Software version quality abnormity detection method and device, electronic equipment and storage medium |
Non-Patent Citations (4)
Title |
---|
CHUNHUI ZHAO 等: "Semantic-oriented Automatic Generation Method of REST Interface Test Cases", 《ISCSIC 2020: PROCEEDINGS OF THE 2020 4TH INTERNATIONAL SYMPOSIUM ON COMPUTER SCIENCE AND INTELLIGENT CONTROL》, vol. 11, 15 February 2021 (2021-02-15), pages 1 * |
SH-XULIANG: "回归测试;测试用例;基线测试用例库", pages 1 - 4, Retrieved from the Internet <URL:https://www.cnblogs.com/SH-xuliang/p/8021646.html> * |
支文瑜: "基于java开发工具包的接口自动化测试", 《信息技术与标准化》, pages 63 - 65 * |
郭心睿: "基于"生成—检验"框架的软件代码错误自动修复技术研究", 《中国博士学位论文全文数据库 信息科技辑》, 15 February 2019 (2019-02-15), pages 138 - 17 * |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114116522A (en) * | 2022-01-27 | 2022-03-01 | 四川野马科技有限公司 | Swagger-based method for automatically testing interface |
Also Published As
Publication number | Publication date |
---|---|
CN113282496B (en) | 2024-04-02 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9569325B2 (en) | Method and system for automated test and result comparison | |
US20110107307A1 (en) | Collecting Program Runtime Information | |
CN111290956B (en) | Brain graph-based test method and device, electronic equipment and storage medium | |
CN110221948B (en) | Test script generation method, test script generation device, computer device and storage medium | |
CN110764980A (en) | Log processing method and device | |
US11429574B2 (en) | Computer system diagnostic log chain | |
CN113138929A (en) | Distributed interface testing method and device, electronic equipment and storage medium | |
CN114546738A (en) | Server general test method, system, terminal and storage medium | |
CN114116496A (en) | Automatic testing method, device, equipment and medium | |
CN110851471A (en) | Distributed log data processing method, device and system | |
CN112667501A (en) | Link testing method and device based on automatic baffle and related equipment | |
CN115630036A (en) | Error information processing method, apparatus, device, storage medium and program product | |
CN113051171A (en) | Interface test method, device, equipment and storage medium | |
CN103425580A (en) | Method for automatically and rapidly obtaining and calibrating configuration information of cloud computing device | |
CN113282496B (en) | Automatic interface testing method, device, equipment and storage medium | |
CN113392000B (en) | Test case execution result analysis method, device, equipment and storage medium | |
US9354962B1 (en) | Memory dump file collection and analysis using analysis server and cloud knowledge base | |
CN112527655A (en) | Software version quality abnormity detection method and device, electronic equipment and storage medium | |
CN112256532A (en) | Test interface generation method and device, computer equipment and readable storage medium | |
CN112579475A (en) | Code testing method, device, equipment and readable storage medium | |
CN111399805A (en) | Software development management system and method | |
CN114116488A (en) | Method, device and equipment for acquiring test coverage rate information and storage medium | |
CN114020645A (en) | Test method, device, equipment, readable storage medium and computer program product | |
CN110618943B (en) | Security service test method and device, electronic equipment and readable storage medium | |
CN114327988A (en) | Visual network fault relation determining method and device |
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 | ||
TA01 | Transfer of patent application right |
Effective date of registration: 20211015 Address after: 518000 Room 201, building A, No. 1, Qian Wan Road, Qianhai Shenzhen Hong Kong cooperation zone, Shenzhen, Guangdong (Shenzhen Qianhai business secretary Co., Ltd.) Applicant after: Shenzhen saiante Technology Service Co.,Ltd. Address before: 1-34 / F, Qianhai free trade building, 3048 Xinghai Avenue, Mawan, Qianhai Shenzhen Hong Kong cooperation zone, Shenzhen, Guangdong 518000 Applicant before: Ping An International Smart City Technology Co.,Ltd. |
|
TA01 | Transfer of patent application right | ||
GR01 | Patent grant | ||
GR01 | Patent grant |