CN112000579A - Software interface testing method, system, equipment and medium - Google Patents
Software interface testing method, system, equipment and medium Download PDFInfo
- Publication number
- CN112000579A CN112000579A CN202010873478.0A CN202010873478A CN112000579A CN 112000579 A CN112000579 A CN 112000579A CN 202010873478 A CN202010873478 A CN 202010873478A CN 112000579 A CN112000579 A CN 112000579A
- Authority
- CN
- China
- Prior art keywords
- interface
- tested
- parameter
- test instruction
- detecting whether
- 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
- 238000012360 testing method Methods 0.000 title claims abstract description 171
- 230000004044 response Effects 0.000 claims abstract description 37
- 238000000034 method Methods 0.000 claims abstract description 18
- 238000006243 chemical reaction Methods 0.000 claims description 12
- 230000005540 biological transmission Effects 0.000 claims description 10
- 238000004590 computer program Methods 0.000 claims description 9
- 238000001514 detection method Methods 0.000 claims description 8
- 238000004891 communication Methods 0.000 abstract description 39
- 238000010998 test method Methods 0.000 abstract description 4
- 230000006870 function Effects 0.000 description 7
- 238000010586 diagram Methods 0.000 description 3
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000002159 abnormal effect Effects 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000009977 dual effect Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000012545 processing 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
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 discloses a software interface test method, a system, equipment and a medium, which are characterized in that an interface test instruction is obtained; acquiring an interface to be tested from an interface test instruction; detecting whether the interface to be tested needs to transmit parameters; when the interface to be tested needs to transmit parameters, acquiring target parameters from an interface test instruction; calling an interface to be tested, and transmitting a target parameter into the interface to be tested when the interface to be tested needs to transmit the parameter; and receiving a response result output by the interface to be tested so as to judge whether the interface to be tested passes the test according to the response result. The invention solves the problems of complex test process and low efficiency caused by using the traditional single-function test code compiling method to test in the communication module interface test.
Description
Technical Field
The invention belongs to the technical field of testing, and particularly relates to a software interface testing method, a system, equipment and a medium.
Background
The conventional communication product generally includes an MCU (Microcontroller Unit) and a communication module, the MCU is used as a main processor, and is in communication connection with the communication module through an AT interface, so that the hardware structure is complex and the hardware cost is high. To this end, in the prior art, a quepoint system using a communication module itself as a main processor is designed, the system provides a plurality of software interfaces, a user can write an APP (Application) running in the communication module based on the system, and the APP can realize a corresponding function by calling the software interface provided by the system. In order to ensure that the APP can operate normally, a software interface provided by the system needs to be tested. For a software interface provided by a QuecOpen system, at present, during testing, firstly, test codes with single functions need to be written manually, then, the test codes are compiled into executable files in a compiling software development kit and loaded into a communication module for running, then, interface testing is carried out according to the logic of test programs, and for different functions, different test programs need to be written for testing.
However, with the continuous development of services and the continuous increase of new projects, the traditional test method for writing single-function test codes is complex in process and low in efficiency.
Disclosure of Invention
The invention provides a software interface testing method, a system, equipment and a medium, aiming at overcoming the defects of complex process and low efficiency of the traditional manual testing method in the prior art.
The invention solves the technical problems through the following technical scheme:
in a first aspect, the present invention provides a software interface testing method, including:
acquiring an interface test instruction;
acquiring an interface to be tested from the interface test instruction;
detecting whether the interface to be tested needs to input parameters or not;
when the interface to be tested needs to input parameters, acquiring target parameters from the interface test instruction;
calling the interface to be tested, and transmitting the target parameter into the interface to be tested when the interface to be tested needs to transmit the parameter;
and receiving a response result output by the interface to be tested so as to judge whether the interface to be tested passes the test according to the response result.
Preferably, the obtaining the interface to be tested from the interface test instruction includes:
and detecting whether the interface test instruction contains an interface identifier in advance, and acquiring an interface to be tested from the interface test instruction when the interface test instruction contains the interface identifier.
Preferably, the detecting whether the interface to be tested needs incoming parameters includes:
whether an interface to be tested is legal is detected in advance, and when the interface to be tested is legal, whether parameters need to be transmitted into the interface to be tested is detected.
Preferably, the obtaining the target parameter from the interface test instruction includes:
and detecting whether the interface test instruction contains a parameter identifier, and acquiring a target parameter from the interface test instruction when the interface test instruction contains the parameter identifier.
Preferably, after obtaining the target parameter from the interface test instruction, the method further includes:
detecting whether the target parameter is legal or not;
and/or the presence of a gas in the gas,
and carrying out format conversion on the target parameters according to a preset rule.
In a second aspect, the present invention further provides a software interface testing system, including:
the instruction acquisition module is used for acquiring an interface test instruction;
the interface acquisition module is used for acquiring an interface to be tested from the interface test instruction;
the parameter transmission requirement detection module is used for detecting whether the interface to be tested needs to transmit parameters;
the parameter acquisition module is used for acquiring target parameters from the interface test instruction when the to-be-tested interface needs to transmit the parameters;
the interface calling module is used for calling the interface to be tested and transmitting the target parameter to the interface to be tested when the interface to be tested needs to transmit the parameter;
and the response receiving module is used for receiving the response result output by the interface to be tested so as to judge whether the interface to be tested passes the test according to the response result.
Preferably, the interface obtaining module is specifically configured to:
and detecting whether the interface test instruction contains an interface identifier in advance, and acquiring an interface to be tested from the interface test instruction when the interface test instruction contains the interface identifier.
Preferably, the parameter transmission requirement detecting module is specifically configured to:
and detecting whether the interface to be tested is legal in advance, and when the interface to be tested is legal, detecting whether the interface to be tested needs to transmit parameters.
Preferably, the parameter obtaining module is specifically configured to:
and detecting whether the interface test instruction contains a parameter identifier in advance, and acquiring a target parameter from the interface test instruction when the interface test instruction contains the parameter identifier.
Preferably, the system further comprises:
the parameter legality detection module is used for detecting whether the target parameter is legal or not after the target parameter is obtained from the interface test instruction;
and/or the presence of a gas in the gas,
and the parameter conversion module is used for carrying out format conversion on the target parameter according to a preset rule.
In a third aspect, the present invention further provides an electronic device, which includes a processor, a memory, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, the steps of the software interface testing method according to the first aspect are implemented.
In a fourth aspect, the present invention provides a computer-readable storage medium, in which a computer program is stored, which, when being executed by a processor, implements the steps of a software interface testing method according to the first aspect.
The positive progress effects of the invention are as follows: providing a software interface test method, a system, equipment and a medium, and obtaining an interface test instruction; acquiring an interface to be tested from an interface test instruction; detecting whether the interface to be tested needs to transmit parameters; when the interface to be tested needs to transmit parameters, acquiring target parameters from an interface test instruction; calling an interface to be tested, and transmitting a target parameter into the interface to be tested when the interface to be tested needs to transmit the parameter; and receiving a response result output by the interface to be tested so as to judge whether the interface to be tested passes the test according to the response result. The invention solves the problems of complex test process and low efficiency caused by using the traditional single-function test code compiling method to test in the communication module interface test.
Drawings
Fig. 1 is a flowchart of a software interface testing method according to embodiment 1 of the present invention.
Fig. 2 is a schematic block diagram of a software interface test system according to embodiment 2 of the present invention.
Fig. 3 is a schematic diagram of a hardware structure of an electronic device according to embodiment 3 of the present invention.
Detailed Description
The invention is further illustrated by the following examples, which are not intended to limit the scope of the invention.
Example 1
As shown in fig. 1, this embodiment provides a software interface testing method, which can be applied to a software interface testing process in a communication module of a quepoint system, for example, and includes the following steps:
and step S1, acquiring an interface test instruction.
For example, the interface test instruction may be obtained from the upper computer through a preset communication interface. The upper computer can be a computer, a mobile phone and the like which are in communication connection with the communication module to be tested, and can directly send the control instruction to the communication module to be tested through the communication interface. The communication interface may be an RS232 interface, that is, a standard serial port, or an RS485 interface, and the like, and the embodiment does not limit the specific selection of the communication interface.
In this embodiment, the obtained interface test instruction may only include the interface portion, or may include both the interface portion and the data portion. The interface part carries an interface identifier and an interface name corresponding to the interface to be tested. The interface designator may be configured as any field. The data part carries a parameter identifier and a target parameter. The Interface identifier and the parameter identifier are configured as different fields, and the Application Program Interface (API) may be used as the Interface identifier and the DAT may be used as the parameter identifier. Of course, "API" and "DAT" are merely illustrated as examples, and the present embodiment does not set any limit on the fields configured by the interface identifier and the parameter identifier.
It should be noted that the interface identifier in this embodiment is located at the head of the interface test instruction, and when the interface identifier exists, it is possible that the corresponding parameter identifier exists after the interface portion, and when the interface identifier does not exist, the corresponding parameter identifier does not exist.
In a possible implementation mode, the communication interface is opened in advance before the interface test instruction is acquired, if the opening fails, an error report can be prompted to the upper computer and the flow is ended, if the opening succeeds, the test is formally started, and the interface test instruction sent by the upper computer is received through the communication interface.
And step S2, acquiring the interface to be tested from the interface test instruction.
After the communication interface is used for acquiring the interface test instruction from the connected upper computer, the interface test instruction is firstly analyzed to obtain an analyzed result. And then, obtaining an interface to be tested from the analyzed result, for example, the interface to be tested is a software interface provided by the quepoint system.
In step S2, it may be detected in advance whether the interface test command includes an interface identifier, and if so, the interface to be tested is obtained from the interface test command.
Specifically, whether an interface identifier, such as an "API", is included in the analyzed interface test instruction is detected, if not, error information is output and returned to the upper computer, and the process is ended; and if the API is contained, acquiring the interface to be tested according to the interface name following the interface identifier.
And step S3, detecting whether the interface to be tested needs to input parameters.
In this embodiment, before the interface test instruction is obtained, an interface list may be preset, where the interface list includes information such as an interface name, the number of interface parameters, and meanings of each interface parameter corresponding to each interface to be tested.
Preferably, before detecting whether the interface to be tested needs to input the parameters, the embodiment detects in advance whether the interface to be tested is legal, that is, detects in advance whether the interface to be tested is the interface to be tested. Specifically, when it is detected that an interface to be tested exists in the preset interface list, it is determined that the interface to be tested is legal, that is, the interface to be tested is an interface to be tested, otherwise, it is determined that the interface to be tested is illegal, that is, the interface to be tested is not an interface to be tested.
When the interface to be tested is detected to be legal, the step judges whether the interface to be tested needs to transmit the parameters or not by detecting whether the parameter configuration corresponding to the interface to be tested exists in the interface list. Specifically, when the parameter configuration corresponding to the interface to be tested exists in the interface list, it is determined that the interface to be tested needs to transmit the parameters, and step S4 is executed; otherwise, it is determined that the dut does not require the incoming parameters, and step S7 is performed directly.
And step S4, when the interface to be tested needs to input the parameters, acquiring the target parameters from the interface test instruction.
In step S4, it is first detected whether the interface test command includes a parameter identifier, and when so, a target parameter is obtained from the interface test command, the target parameter generally following the parameter identifier and being separated by a predetermined symbol.
For example, when "DAT" is detected from the interface test instruction, indicating that the parameter identifier exists, the target parameter corresponding to the interface to be tested is obtained from the parsed interface test instruction.
Step S5, detecting whether the target parameter is legal, if so, executing step S6; if the data is illegal, error information is output.
In this embodiment, whether the target parameter is legal is determined by detecting whether the number of the target parameter is correct (for example, whether the number of the target parameter is matched with the number of the parameters of the interface to be tested configured in the interface list), and if the number of the target parameter is correct, the target parameter is judged to be legal, otherwise, the target parameter is judged to be illegal. It can be understood that, a person skilled in the art can judge whether the target parameter is legal by comparing the type, number and meaning of the target parameter.
If the target parameter is legal, the subsequent steps are executed to continue testing the interface to be tested, and if the target parameter is illegal, the corresponding error information is returned to the upper computer through the communication interface, so that the upper computer can judge that the test is abnormal according to the response result.
And step S6, converting the format of the target parameter according to a preset rule.
For example, assuming that the Data portion is DAT: "Data1", "Date2" or DAT: "13", "0", only Data in "" can be transferred to the interface when the interface to be tested is subsequently called according to the preset rule, the parameter conversion module 160 converts "Data1", "Date2" into Data1 and Date2, and converts "13", "0" into 13, 0.
And step S7, calling the interface to be tested, and transmitting the target parameters to the interface to be tested when the interface to be tested needs to transmit the parameters.
And step S8, receiving a response result output by the interface to be tested so as to judge whether the interface to be tested passes the test according to the response result.
In this embodiment, the received response result generated by the interface to be tested correspondingly may be returned to the upper computer through the communication interface, so that the upper computer can determine whether the test interface passes the test according to the response result. Specifically, the upper computer may determine whether the test is passed by determining whether the received response result matches a preset response result, and if so, the upper computer indicates that the test is passed, otherwise, the upper computer indicates that the test is failed. Further, after the response result output by the interface to be tested is returned through the communication interface, the next interface test instruction is started to be received.
Preferably, the foregoing steps S1, S2 and S4 are implemented by one thread, and the other steps are implemented by another thread, so that the program running efficiency is improved by using a dual thread.
In the embodiment, a software interface testing method is provided, in which an interface testing instruction is obtained; acquiring an interface to be tested from an interface test instruction; detecting whether the interface to be tested needs to transmit parameters; when the interface to be tested needs to transmit parameters, acquiring target parameters from an interface test instruction; calling an interface to be tested, and transmitting a target parameter into the interface to be tested when the interface to be tested needs to transmit the parameter; and receiving a response result output by the interface to be tested so as to judge whether the interface to be tested passes the test according to the response result. The invention solves the problems of complex test process and low efficiency of the test code caused by using the traditional single writing function in the communication module interface test.
Example 2
The present embodiment provides a software interface testing system, as shown in fig. 2, specifically including: the system comprises an instruction acquisition module 110, an interface acquisition module 120, a parameter transmission requirement detection module 130, a parameter acquisition module 140, a parameter legality detection module 150, a parameter conversion module 160, an interface calling module 170 and a response receiving module 180.
The instruction obtaining module 110 is configured to obtain an interface test instruction.
For example, the instruction obtaining module 110 may obtain the interface test instruction from the upper computer through a preset communication interface. The upper computer is a computer, a mobile phone and the like which are in communication connection with the communication module to be tested, and can directly send a control instruction to the communication module to be tested through the communication interface. The communication interface may be an RS232 interface, that is, a standard serial port, or an RS485 interface, and the like, and the embodiment does not limit the specific selection of the communication interface.
In this embodiment, the obtained interface test instruction may only include the interface portion, or may include both the interface portion and the data portion. The interface part carries an interface identifier and an interface name corresponding to the interface to be tested. The interface designator may be configured as any field. The data part carries a parameter identifier and a target parameter. The Interface identifier and the parameter identifier are configured as different fields, and the Application Program Interface (API) may be used as the Interface identifier and the DAT may be used as the parameter identifier. Of course, "API" and "DAT" are merely illustrated as examples, and the present embodiment does not set any limit on the fields configured by the interface identifier and the parameter identifier.
It should be noted that the interface identifier in this embodiment is located at the head of the interface test instruction, and when the interface identifier exists, it is possible that a corresponding parameter identifier exists behind the interface identifier, and when the interface identifier does not exist, the corresponding parameter identifier does not exist.
In a possible implementation manner, the communication interface is opened in advance before the interface test instruction is acquired, if the opening fails, an error report can be prompted to the upper computer and the flow is ended, and if the opening succeeds, the test is formally started, and the interface test instruction sent by the upper computer is received through the communication interface.
The interface obtaining module 120 is configured to obtain an interface to be tested from the interface testing instruction.
When the communication interface is used to obtain an interface test instruction from the connected upper computer, the interface obtaining module 120 first analyzes the interface test instruction to obtain an analyzed result. Then, the interface obtaining module 120 obtains an interface to be tested from the analyzed result, for example, the interface to be tested is a software interface provided by the quepoint system.
The interface obtaining module 120 is further configured to detect in advance whether the interface test instruction includes the interface identifier, and when the interface test instruction includes the interface identifier, obtain the interface to be tested from the interface test instruction.
Specifically, whether the analyzed interface test instruction contains an interface identifier, such as "API", is detected, if not, error information is output, and the error information is returned to the upper computer, and the process is ended. And if the API is contained, acquiring the interface to be tested according to the interface name following the interface identifier.
A parameter transmission requirement detecting module 130, configured to detect whether the interface to be tested needs to transmit parameters.
In this embodiment, before the interface test instruction is obtained, an interface list may be preset, where the interface list is an interface list to be tested, and the interface list includes information such as an interface name, the number of interface parameters, and meanings of each interface parameter corresponding to each interface to be tested.
The parameter transmission requirement detecting module 130 is further specifically configured to detect whether the preset interface list is legal in advance, and when the preset interface list is legal, detect whether the interface to be tested needs to transmit the parameters.
Preferably, in this embodiment, before detecting whether the interface to be tested needs to input the parameters, whether the interface to be tested is legal is detected in advance, that is, whether the interface to be tested is the interface that needs to be tested is detected in advance. Specifically, when it is detected that an interface to be tested exists in the preset interface list, it is determined that the interface to be tested is legal, that is, the interface to be tested is an interface to be tested, otherwise, it is determined that the interface to be tested is illegal, that is, the interface to be tested is not an interface to be tested.
When it is detected that the interface to be tested is legal, the parameter transmission requirement detecting module 130 determines whether the interface to be tested needs to transmit the parameters by detecting whether the parameter configuration corresponding to the interface to be tested exists in the interface list. Specifically, when the parameter configuration corresponding to the interface to be tested exists in the interface list, the parameter transmission requirement detecting module 130 determines that the interface to be tested needs to transmit the parameter, and calls the parameter obtaining module 140; otherwise, it is determined that the interface to be tested does not need to transmit the parameters, and the response receiving module 180 is directly called.
The parameter obtaining module 140 is configured to obtain a target parameter from an interface test instruction when the interface to be tested needs to input the parameter.
The parameter acquisition module 140 first detects whether the interface test command includes a parameter identifier, and when so, acquires a target parameter from the interface test command, the target parameter generally following the parameter identifier, the two being separated by a predetermined symbol.
For example, when "DAT" is detected from the interface test instruction, indicating that the parameter identifier exists, the target parameter corresponding to the interface to be tested is obtained from the parsed interface test instruction.
The parameter legality detection module 150 is used for detecting whether the target parameter is legal or not, and if the target parameter is legal, the parameter conversion module 160 is executed; if the data is illegal, error information is output.
In this embodiment, the parameter validity detecting module 150 determines whether the target parameter is valid by detecting whether the number of the target parameter is correct (for example, whether the number of the target parameter matches the number of the parameters configured in the interface to be tested in the interface list), and if so, determines that the target parameter is valid, otherwise, determines that the target parameter is not valid. It can be understood that, a person skilled in the art can judge whether the target parameter is legal by comparing the type, number and meaning of the target parameter.
If the target parameter is legal, the test of the interface to be tested is continued, and if the target parameter is illegal, the communication interface returns the error information to the upper computer, so that the upper computer can judge that the test interface does not pass the test according to the response result.
And the parameter conversion module 160 is used for performing format conversion on the target parameter according to a predetermined rule.
For example, assuming that the Data portion is DAT: "Data1", "Date2" or DAT: "13", "0", only Data in "" can be transferred to the interface when the interface to be tested is subsequently called according to the preset rule, the parameter conversion module 160 converts "Data1", "Date2" into Data1 and Date2, and converts "13", "0" into 13, 0.
An interface calling module 170 for calling the interface to be tested and transmitting the target parameter to the interface to be tested when the interface to be tested needs to transmit the parameter
The response receiving module 180 is configured to receive a response result output by the interface to be tested, so as to determine whether the interface to be tested passes the test according to the response result.
In this embodiment, the received response result generated by the interface to be tested correspondingly may be returned to the upper computer through the communication interface, so that the upper computer can determine whether the test interface passes the test according to the response result. Specifically, the upper computer may determine whether the test is passed by determining whether the received response result matches a preset response result, and if so, the upper computer indicates that the test is passed, otherwise, the upper computer indicates that the test is failed. Further, after the response result output by the interface to be tested is returned through the communication interface, the next interface test instruction is started to be received.
In this embodiment, a software interface testing system is provided, in which an instruction obtaining module obtains an interface testing instruction; the interface acquisition module acquires an interface to be tested from an interface test instruction; a parameter transmission requirement detection module detects whether the interface to be tested needs to transmit parameters; when the interface to be tested needs to transmit parameters, the parameter acquisition module acquires target parameters from an interface test instruction; the interface calling module calls an interface to be tested and transmits a target parameter to the interface to be tested when the interface to be tested needs to transmit the parameter; and the response receiving module receives a response result output by the interface to be tested. The invention solves the problems of complex test process and low efficiency of the test code caused by using the traditional single writing function in the communication module interface test.
Example 3
Fig. 3 is a schematic structural diagram of an electronic device provided in this embodiment. The electronic device includes a memory, a processor and a computer program stored in the memory and executable on the processor, and the processor implements the software interface testing method of embodiment 1 when executing the program, and the electronic device 30 shown in fig. 3 is only an example and should not bring any limitation to the function and the scope of the application of the embodiment of the present invention.
The electronic device 30 may be embodied in the form of a general purpose computing device, which may be, for example, a server device. The components of the electronic device 30 may include, but are not limited to: the at least one processor 31, the at least one memory 32, and a bus 33 connecting the various system components (including the memory 32 and the processor 31).
The bus 33 includes a data bus, an address bus, and a control bus.
The memory 32 may include volatile memory, such as Random Access Memory (RAM)321 and/or cache memory 322, and may further include Read Only Memory (ROM) 323.
The processor 31 executes various functional applications and data processing, such as the software interface test method of embodiment 1 of the present invention, by executing the computer program stored in the memory 32.
The electronic device 30 may also communicate with one or more external devices 34 (e.g., keyboard, pointing device, etc.). Such communication may be through input/output (I/O) interfaces 35. Also, model-generating device 30 may also communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the Internet) via network adapter 36. As shown, network adapter 36 communicates with the other modules of model-generating device 30 via bus 33. It should be understood that although not shown in the figures, other hardware and/or software modules may be used in conjunction with the model-generating device 30, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID (disk array) systems, tape drives, and data backup storage systems, etc.
It should be noted that although in the above detailed description several units/modules or sub-units/modules of the electronic device are mentioned, such a division is merely exemplary and not mandatory. Indeed, the features and functionality of two or more of the units/modules described above may be embodied in one unit/module according to embodiments of the invention. Conversely, the features and functions of one unit/module described above may be further divided into embodiments by a plurality of units/modules.
Example 4
The present embodiment provides a computer-readable storage medium on which a computer program is stored, which when executed by a processor, implements the steps of the software interface testing method of embodiment 1.
More specific examples, among others, that the readable storage medium may employ may include, but are not limited to: a portable disk, a hard disk, random access memory, read only memory, erasable programmable read only memory, optical storage device, magnetic storage device, or any suitable combination of the foregoing.
In a possible implementation, the invention may also be implemented in the form of a program product comprising program code for causing a terminal device to perform the steps of implementing the software interface testing method of embodiment 1, when said program product is run on said terminal device.
Where program code for carrying out the invention is written in any combination of one or more programming languages, the program code may be executed entirely on the user device, partly on the user device, as a stand-alone software package, partly on the user device and partly on a remote device or entirely on the remote device.
While specific embodiments of the invention have been described above, it will be appreciated by those skilled in the art that this is by way of example only, and that the scope of the invention is defined by the appended claims. Various changes and modifications to these embodiments may be made by those skilled in the art without departing from the spirit and scope of the invention, and these changes and modifications are within the scope of the invention.
Claims (12)
1. A software interface testing method is characterized by comprising the following steps:
acquiring an interface test instruction;
acquiring an interface to be tested from the interface test instruction;
detecting whether the interface to be tested needs to input parameters or not;
when the interface to be tested needs to input parameters, acquiring target parameters from the interface test instruction;
calling the interface to be tested, and transmitting the target parameter into the interface to be tested when the interface to be tested needs to transmit the parameter;
and receiving a response result output by the interface to be tested so as to judge whether the interface to be tested passes the test according to the response result.
2. The method for testing software interface according to claim 1, wherein said obtaining the interface to be tested from the interface test instruction comprises:
and detecting whether the interface test instruction contains an interface identifier in advance, and acquiring an interface to be tested from the interface test instruction when the interface test instruction contains the interface identifier.
3. The method for testing software interface according to claim 1, wherein said detecting whether said interface to be tested requires incoming parameters comprises:
and detecting whether the interface to be tested is legal in advance, and when the interface to be tested is legal, detecting whether the interface to be tested needs to transmit parameters.
4. The method according to claim 1, wherein the obtaining target parameters from the interface test instructions comprises:
and detecting whether the interface test instruction contains a parameter identifier in advance, and acquiring a target parameter from the interface test instruction when the interface test instruction contains the parameter identifier.
5. The method of claim 1, wherein after obtaining the target parameter from the interface test instruction, the method further comprises:
detecting whether the target parameter is legal or not;
and/or the presence of a gas in the gas,
and carrying out format conversion on the target parameters according to a preset rule.
6. A software interface test system, the system comprising:
the instruction acquisition module is used for acquiring an interface test instruction;
the interface acquisition module is used for acquiring an interface to be tested from the interface test instruction;
the parameter transmission requirement detection module is used for detecting whether the interface to be tested needs to transmit parameters;
the parameter acquisition module is used for acquiring target parameters from the interface test instruction when the to-be-tested interface needs to transmit the parameters;
the interface calling module is used for calling the interface to be tested and transmitting the target parameter to the interface to be tested when the interface to be tested needs to transmit the parameter;
and the response receiving module is used for receiving the response result output by the interface to be tested so as to judge whether the interface to be tested passes the test according to the response result.
7. The software interface testing system of claim 6, wherein the interface acquisition module is specifically configured to:
and detecting whether the interface test instruction contains an interface identifier in advance, and acquiring an interface to be tested from the interface test instruction when the interface test instruction contains the interface identifier.
8. The software interface testing system of claim 6, wherein the parameter transmission requirement detecting module is specifically configured to:
and detecting whether the interface to be tested is legal in advance, and when the interface to be tested is legal, detecting whether the interface to be tested needs to transmit parameters.
9. The software interface testing system of claim 6, wherein the parameter obtaining module is specifically configured to:
and detecting whether the interface test instruction contains a parameter identifier in advance, and acquiring a target parameter from the interface test instruction when the interface test instruction contains the parameter identifier.
10. The software interface test system of claim 6, wherein the system further comprises:
the parameter legality detection module is used for detecting whether the target parameter is legal or not after the target parameter is obtained from the interface test instruction;
and/or the presence of a gas in the gas,
and the parameter conversion module is used for carrying out format conversion on the target parameter according to a preset rule.
11. An electronic device comprising a processor, a memory, and a computer program stored on the memory and executable on the processor, wherein the steps of a software interface testing method according to any one of claims 1-5 are implemented when the computer program is executed by the processor.
12. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of a method for testing a software interface according to any one of claims 1 to 5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010873478.0A CN112000579B (en) | 2020-08-26 | 2020-08-26 | Software interface testing method, system, equipment and medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010873478.0A CN112000579B (en) | 2020-08-26 | 2020-08-26 | Software interface testing method, system, equipment and medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112000579A true CN112000579A (en) | 2020-11-27 |
CN112000579B CN112000579B (en) | 2024-03-19 |
Family
ID=73471618
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010873478.0A Active CN112000579B (en) | 2020-08-26 | 2020-08-26 | Software interface testing method, system, equipment and medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112000579B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112882936A (en) * | 2021-02-24 | 2021-06-01 | 平安普惠企业管理有限公司 | Interface case testing method and device and storage medium |
Citations (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20130318402A1 (en) * | 2012-05-23 | 2013-11-28 | Sap Ag | Software Systems Testing Interface |
CN106021090A (en) * | 2016-05-04 | 2016-10-12 | 上海瀚银信息技术有限公司 | Software interface test system and method |
US20170046253A1 (en) * | 2015-08-13 | 2017-02-16 | Ca, Inc. | Generic test automation for application programming interface applications |
CN107908556A (en) * | 2017-11-08 | 2018-04-13 | 中国平安人寿保险股份有限公司 | Interface test method, device, equipment and computer-readable recording medium |
CN110147320A (en) * | 2019-04-19 | 2019-08-20 | 平安普惠企业管理有限公司 | Interface test method, device and electronic equipment |
CN110196809A (en) * | 2019-05-30 | 2019-09-03 | 贝壳技术有限公司 | Interface test method and device |
CN110347604A (en) * | 2019-07-11 | 2019-10-18 | 中国工商银行股份有限公司 | Programming interface test method and equipment, electronic equipment and readable storage medium storing program for executing |
CN110362497A (en) * | 2019-07-23 | 2019-10-22 | 上海金融期货信息技术有限公司 | Cover the automation api interface test method and system of full unusual character |
CN110569160A (en) * | 2019-09-11 | 2019-12-13 | 上海移远通信技术股份有限公司 | Test system of development board based on communication module |
CN110750442A (en) * | 2019-09-06 | 2020-02-04 | 平安医疗健康管理股份有限公司 | Test case generation method, device, equipment and storage medium |
WO2020082585A1 (en) * | 2018-10-25 | 2020-04-30 | 深圳壹账通智能科技有限公司 | Method and device for interface testing |
WO2020119434A1 (en) * | 2018-12-15 | 2020-06-18 | 深圳壹账通智能科技有限公司 | Method and apparatus for interface data processing, method and apparatus for automated testing, device, and medium |
-
2020
- 2020-08-26 CN CN202010873478.0A patent/CN112000579B/en active Active
Patent Citations (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20130318402A1 (en) * | 2012-05-23 | 2013-11-28 | Sap Ag | Software Systems Testing Interface |
US20170046253A1 (en) * | 2015-08-13 | 2017-02-16 | Ca, Inc. | Generic test automation for application programming interface applications |
CN106021090A (en) * | 2016-05-04 | 2016-10-12 | 上海瀚银信息技术有限公司 | Software interface test system and method |
CN107908556A (en) * | 2017-11-08 | 2018-04-13 | 中国平安人寿保险股份有限公司 | Interface test method, device, equipment and computer-readable recording medium |
WO2020082585A1 (en) * | 2018-10-25 | 2020-04-30 | 深圳壹账通智能科技有限公司 | Method and device for interface testing |
WO2020119434A1 (en) * | 2018-12-15 | 2020-06-18 | 深圳壹账通智能科技有限公司 | Method and apparatus for interface data processing, method and apparatus for automated testing, device, and medium |
CN110147320A (en) * | 2019-04-19 | 2019-08-20 | 平安普惠企业管理有限公司 | Interface test method, device and electronic equipment |
CN110196809A (en) * | 2019-05-30 | 2019-09-03 | 贝壳技术有限公司 | Interface test method and device |
CN110347604A (en) * | 2019-07-11 | 2019-10-18 | 中国工商银行股份有限公司 | Programming interface test method and equipment, electronic equipment and readable storage medium storing program for executing |
CN110362497A (en) * | 2019-07-23 | 2019-10-22 | 上海金融期货信息技术有限公司 | Cover the automation api interface test method and system of full unusual character |
CN110750442A (en) * | 2019-09-06 | 2020-02-04 | 平安医疗健康管理股份有限公司 | Test case generation method, device, equipment and storage medium |
CN110569160A (en) * | 2019-09-11 | 2019-12-13 | 上海移远通信技术股份有限公司 | Test system of development board based on communication module |
Non-Patent Citations (6)
Title |
---|
ANDREY PONOMARENKO等: "Header-driven generation of sanity API tests for shared libraries", 《2010 6TH CENTRAL AND EASTERN EUROPEAN SOFTWARE ENGINEERING CONFERENCE(CEE-SECR)》, 31 March 2011 (2011-03-31), pages 97 - 102 * |
JANEHOST: "postman接口测试系列:接口参数化和参数的传递", Retrieved from the Internet <URL:https://www.cnblogs.com/LOVEYU/p/7929471.html> * |
TESTING: "API Testing Tutorial-Quick Guide on the Basics", Retrieved from the Internet <URL:https://reqtest.com/en/knowledgebase/api-testing-tutorial> * |
吕江花等: "安全苛刻系统测试语言中的测试设备协同语句", 《软件学报》, no. 2016, 5 January 2016 (2016-01-05), pages 562 - 579 * |
左刚: "基于JUnit框架的接口测试系统研究与实现", 《中国优秀硕士论文全文数据库 信息科技辑》, 15 August 2014 (2014-08-15), pages 138 - 735 * |
杨欣等: "基于Robot Framework的自动化接口测试框架的设计与实现", 《电子质量》, no. 2018, pages 40 - 45 * |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112882936A (en) * | 2021-02-24 | 2021-06-01 | 平安普惠企业管理有限公司 | Interface case testing method and device and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN112000579B (en) | 2024-03-19 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109558282B (en) | PCIE link detection method, system, electronic equipment and storage medium | |
CN110445688B (en) | Interface service function monitoring method and system based on data collection | |
CN112965908B (en) | Communication test method, device, communication equipment and storage medium | |
CN108563567B (en) | Automated testing method, apparatus, device and computer readable storage medium | |
CN109726136A (en) | Test method, device, equipment and the storage medium of database | |
WO2021244535A1 (en) | Vehicle software fault detection method, apparatus and device, and storage medium | |
WO2020019490A1 (en) | Interface testing method, electronic device and storage medium | |
CN110427735A (en) | A kind of method of calibration, device, server and storage medium | |
US7882395B2 (en) | Debug device for embedded systems and method thereof | |
CN112996020B (en) | Bluetooth-based automatic test method and device and Bluetooth test terminal | |
CN111796978B (en) | Interface detection method, device, system, equipment and storage medium | |
WO2021047184A1 (en) | System failure analysis and processing method and apparatus, storage medium, and electronic device | |
CN110659210A (en) | Information acquisition method and device, electronic equipment and storage medium | |
CN113225232A (en) | Hardware testing method and device, computer equipment and storage medium | |
CN113268416A (en) | Application program testing method and device, storage medium and terminal | |
CN110609786B (en) | Software testing method, device, computer equipment and storage medium | |
CN111338951A (en) | Wireless intelligent household appliance detection method and system | |
CN112000579B (en) | Software interface testing method, system, equipment and medium | |
CN112445692A (en) | Case testing method and terminal | |
US20070101034A1 (en) | Monitor method for computer system | |
CN115454856B (en) | Multi-application security detection method, device, medium and electronic equipment | |
CN111737933A (en) | SOC prototype verification method, system, equipment and medium | |
CN114553663B (en) | Abnormality detection method, abnormality detection device, abnormality detection equipment and storage medium | |
CN115495363A (en) | Software testing method, electronic equipment and readable storage medium | |
US20090094614A1 (en) | Direct synchronous input |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |