CN112000579B - Software interface testing method, system, equipment and medium - Google Patents

Software interface testing method, system, equipment and medium Download PDF

Info

Publication number
CN112000579B
CN112000579B CN202010873478.0A CN202010873478A CN112000579B CN 112000579 B CN112000579 B CN 112000579B CN 202010873478 A CN202010873478 A CN 202010873478A CN 112000579 B CN112000579 B CN 112000579B
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.)
Active
Application number
CN202010873478.0A
Other languages
Chinese (zh)
Other versions
CN112000579A (en
Inventor
徐�明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Quectel Wireless Solutions Co Ltd
Original Assignee
Quectel Wireless Solutions Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Quectel Wireless Solutions Co Ltd filed Critical Quectel Wireless Solutions Co Ltd
Priority to CN202010873478.0A priority Critical patent/CN112000579B/en
Publication of CN112000579A publication Critical patent/CN112000579A/en
Application granted granted Critical
Publication of CN112000579B publication Critical patent/CN112000579B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test 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 testing method, a system, equipment and a medium, wherein interface testing instructions are obtained; acquiring an interface to be tested from an interface test instruction; detecting whether an interface to be tested needs an incoming parameter; when the interface to be tested needs to be input with parameters, acquiring target parameters from an interface test instruction; calling an interface to be tested, and transmitting target parameters to the interface to be tested when the interface to be tested needs to transmit the parameters; 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 or not according to the response result. The invention solves the problems of complex testing process and low efficiency caused by testing by writing single-function testing codes in the traditional testing of the communication module interface.

Description

Software interface testing method, system, equipment and medium
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 traditional communication product generally comprises an MCU (Microcontroller Unit, a micro control unit) and a communication module, wherein the MCU is used as a main processor and is in communication connection with the communication module by adopting an AT interface, so that the hardware structure is complex, and the hardware cost is high. In this regard, the prior art designs a QuecOpen system using a communication module as a main processor, where the QuecOpen system provides many software interfaces, and a user may write an APP (Application program) running in the communication module based on the QuecOpen system, and the APP may implement corresponding functions by calling the software interfaces provided by the system. To ensure that the APP can function properly, the software interface provided by the system needs to be tested. Aiming at a software interface provided by a Quecan system, at present, when testing, firstly, single-function test codes are manually written, then compiled into executable files in a compiling software development kit and loaded into a communication module for operation, then interface testing is carried out according to logic of a test program, and for different functions, different test programs are required to be written for testing.
However, with the continuous development of services, new projects are continuously increased, and the traditional test method for writing single-function test codes is complex in process and low in efficiency.
Disclosure of Invention
The invention aims to overcome the defects of complex process and low efficiency of the traditional manual testing method in the prior art and provides a software interface testing method, a system, equipment and a medium.
The invention solves the technical problems by the following technical scheme:
in a first aspect, the present invention provides a software interface testing method, the method comprising:
acquiring an interface test instruction;
acquiring an interface to be tested from the interface test instruction;
detecting whether the interface to be tested needs an incoming parameter;
when the interface to be tested needs to be input with parameters, acquiring target parameters from the interface test instruction;
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 receiving a response result output by the interface to be tested so as to judge whether the interface to be tested passes the test or not 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 identifier is contained.
Preferably, the detecting whether the interface to be tested needs an incoming parameter includes:
and detecting whether the interface to be tested is legal or not in advance, and detecting whether the interface to be tested needs to be subjected to the parameter input or not when the interface to be tested is legal.
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 parameter identifier is contained.
Preferably, after the target parameter is obtained from the interface test instruction, the method further comprises:
detecting whether the target parameter is legal or not;
and/or the number of the groups of groups,
and carrying out format conversion on the target parameters according to a preset rule.
In a second aspect, the present invention also provides a software interface testing system, the system comprising:
the instruction acquisition module is used for acquiring interface test instructions;
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 the parameter transmission;
the parameter acquisition module is used for acquiring target parameters from the interface test instruction when the interface to be tested needs to be subjected to the input parameters;
the interface calling module is used for 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 the response receiving module is used for receiving a response result output by the interface to be tested so as to judge whether the interface to be tested passes the test or not according to the response result.
Preferably, 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 identifier is contained.
Preferably, the parameter transmission requirement detection module is specifically configured to:
and detecting whether the interface to be tested is legal or not in advance, and detecting whether the interface to be tested needs to be subjected to the parameter input or not when the interface to be tested is legal.
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 parameter identifier is contained.
Preferably, the system further comprises:
the parameter legal detection module is used for detecting whether the target parameter is legal or not after the target parameter is acquired from the interface test instruction;
and/or the number of the groups of groups,
and the parameter conversion module is used for carrying out format conversion on the target parameters according to a preset rule.
In a third aspect, the present invention also provides an electronic device, including a processor, a memory, and a computer program stored on the memory and executable on the processor, the processor implementing the steps of a software interface testing method according to the first aspect when the computer program is executed by the processor.
In a fourth aspect, the present invention provides a computer readable storage medium having a computer program stored therein, which when executed by a processor implements the steps of a software interface testing method according to the first aspect.
The invention has the positive progress effects that: 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 an interface to be tested needs an incoming parameter; when the interface to be tested needs to be input with parameters, acquiring target parameters from an interface test instruction; calling an interface to be tested, and transmitting target parameters to the interface to be tested when the interface to be tested needs to transmit the parameters; 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 or not according to the response result. The invention solves the problems of complex testing process and low efficiency caused by testing by writing single-function testing codes in the traditional testing of the communication module interface.
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 testing system according to embodiment 2 of the present invention.
Fig. 3 is a schematic hardware structure of an electronic device according to embodiment 3 of the present invention.
Detailed Description
The invention is further illustrated by means of the following examples, which are not intended to limit the scope of the invention.
Example 1
As shown in fig. 1, the present embodiment provides a software interface testing method, which may be applied to a software interface testing process in a communication module of a qecopen system, and includes the following steps:
step S1, obtaining 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 a control instruction to the communication module to be tested through a communication interface. The communication interface may be an RS232 interface, that is, a standard serial port, or an RS485 interface, etc., and the embodiment does not limit the specific selection of the communication interface.
In this embodiment, the acquired interface test instruction may include only 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 identifier may be configured as any field. The data portion carries a parameter identifier and a target parameter. The interface identifier and the parameter identifier are configured in different fields, and the application can use an API (Application Programming Interface, application program interface) as the interface identifier and use DAT as the parameter identifier. Of course, "API", "DAT" are merely illustrative, and the present embodiment does not make any limitation on the fields of interface identifier and parameter identifier configuration.
It should be noted that, in this embodiment, the interface identifier is located at the header of the interface test instruction, when the interface identifier is present, it is only 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 one possible implementation manner, the communication interface is opened in advance before the interface test instruction is acquired, if the communication interface fails to be opened, the upper computer can be prompted to report errors and finish the flow, if the communication interface fails to be opened, the test is formally started, and the interface test instruction sent by the upper computer is received through the communication interface.
And S2, acquiring an interface to be tested from the interface test instruction.
After the interface test instruction is obtained from the connected upper computer by utilizing the communication interface, the interface test instruction is analyzed first to obtain an analyzed result. And then, acquiring an interface to be tested from the analyzed result, wherein the interface to be tested is a software interface provided by a Quecap open system, for example.
In step S2, it may be detected in advance whether the interface identifier is included in the interface test instruction, and when the interface identifier is included, the interface to be tested is obtained from the interface test instruction.
Specifically, whether the interface identifier, such as an API, is contained in the parsed interface test instruction is detected, if not, error information is output, the error information is returned to the upper computer, and the process is finished; and if the interface identifier comprises the API, acquiring the interface to be tested according to the interface name following the interface identifier.
And S3, detecting whether the interface to be tested needs to be input with parameters.
In this embodiment, before the interface test instruction is acquired, an interface list may be preset, where the interface list includes information such as an interface name, the number of interface parameters, and meaning of each interface parameter corresponding to each interface to be tested.
Preferably, the present embodiment detects in advance whether the interface to be tested is legal or not, that is, whether the interface to be tested is an interface to be tested or not, before detecting whether the interface to be tested needs the incoming parameters. Specifically, when the interface to be tested is detected to exist in the preset interface list, the interface to be tested is judged to be legal, namely the interface to be tested is the interface to be tested, otherwise, the interface to be tested is judged to be illegal, namely the interface to be tested is not the 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 be input 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, determining that the interface to be tested needs to be input with parameters, and executing step S4; otherwise, it is determined that the interface to be tested does not need the input parameters, and step S7 is directly executed.
And S4, when the interface to be tested needs to be input with parameters, acquiring target parameters from the interface test instruction.
In step S4, it is first detected whether the parameter identifier is included in the interface test instruction, and when included, the target parameter is obtained from the interface test instruction, and the target parameter is usually followed by the parameter identifier, and the target parameter and the parameter identifier are separated by a predetermined symbol.
For example, when "DAT" is detected from the interface test instruction, it indicates that the parameter identifier exists, and then the target parameter corresponding to the interface to be tested is obtained from the parsed interface test instruction.
Step S5, detecting whether the target parameters are legal or not, and if yes, executing step S6; if not, outputting error information.
In this embodiment, whether the target parameter is legal is determined by detecting whether the number of the target parameters is correct (for example, whether the number of the target parameters matches with the number of the parameters of the interface to be tested configured in the interface list), and if so, the target parameter is determined to be legal, otherwise, the target parameter is determined to be illegal. It can be understood that, a person skilled in the art can judge whether the target parameter is legal or not by comparing the type, number and meaning of the target parameter as required.
If the target parameter is legal, the subsequent step is 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 judges that the test is abnormal according to the response result.
And S6, performing format conversion on the target parameters 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 invoked according to the preset rule, the parameter conversion module 160 converts" Data1"," Date2 "into Data1, date2, and" 13","0 "into 13, 0.
And 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 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 or not according to the response result.
In this embodiment, the received response result generated by the interface to be tested corresponding to the interface to be tested 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 can judge whether the test is passed or not by judging whether the received response result is matched with a preset response result, if so, the upper computer indicates that the test is passed, otherwise, the upper computer indicates that the test is failed. Further, after a 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 steps S1, S2, S4 are implemented by one thread, and the other steps are implemented by another thread, so that the program running efficiency is improved by adopting double threads.
In this embodiment, a software interface testing method is provided, by acquiring an interface testing instruction; acquiring an interface to be tested from an interface test instruction; detecting whether an interface to be tested needs an incoming parameter; when the interface to be tested needs to be input with parameters, acquiring target parameters from an interface test instruction; calling an interface to be tested, and transmitting target parameters to the interface to be tested when the interface to be tested needs to transmit the parameters; 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 or not according to the response result. The invention solves the problems of complex testing process and low efficiency of the test code caused by the traditional writing of a single 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: an instruction acquisition module 110, an interface acquisition module 120, a parameter transmission requirement detection module 130, a parameter acquisition module 140, a parameter legal detection module 150, a parameter conversion module 160, an interface calling module 170 and a response receiving module 180.
The instruction acquiring module 110 is configured to acquire an interface test instruction.
For example, the instruction acquiring module 110 may acquire the interface test instruction from the host 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 a communication interface. The communication interface may be an RS232 interface, that is, a standard serial port, or an RS485 interface, etc., and the embodiment does not limit the specific selection of the communication interface.
In this embodiment, the acquired interface test instruction may include only 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 identifier may be configured as any field. The data portion carries a parameter identifier and a target parameter. The interface identifier and the parameter identifier are configured in different fields, and the application can use an API (Application Programming Interface, application program interface) as the interface identifier and use DAT as the parameter identifier. Of course, "API", "DAT" are merely illustrative, and the present embodiment does not make any limitation on the fields of interface identifier and parameter identifier configuration.
It should be noted that, in this embodiment, the interface identifier is located at the head of the interface test instruction, when the interface identifier is present, it is only possible that the corresponding parameter identifier exists behind the interface identifier, and when the interface identifier does not exist, the corresponding parameter identifier does not exist.
In one possible implementation manner, the communication interface is opened in advance before the interface test instruction is acquired, if the communication interface fails to be opened, the error reporting can be prompted to the upper computer, the flow is ended, and if the communication interface fails to be opened, the interface test instruction sent by the upper computer is received through the communication interface after the test is formally started.
The interface obtaining module 120 is configured to obtain an interface to be tested from the interface test instruction.
After the communication interface is used to obtain the 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 parsed result, for example, the interface to be tested is a software interface provided by the Quecan open system.
The interface obtaining module 120 is specifically further configured to detect in advance whether the interface test instruction includes an interface identifier, and when the interface identifier is included, obtain the interface to be tested from the interface test instruction.
Specifically, whether the interface identifier, such as "API", is included in the parsed interface test instruction is detected, if not, an error message is output, and the error message is returned to the host computer, and the flow is ended. And if the interface identifier comprises the API, acquiring the interface to be tested according to the interface name following the interface identifier.
The parameter transmission requirement detection module 130 is configured to detect whether the interface to be tested needs an input parameter.
In this embodiment, before the interface test instruction is acquired, 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 the interface parameters corresponding to each interface to be tested.
The parameter transmission requirement detection module 130 is further specifically configured to detect whether the preset interface list is legal in advance, and detect whether the interface to be tested needs the parameter transmission when the preset interface list is legal.
Preferably, in this embodiment, before detecting whether the interface to be tested needs the parameter, whether the interface to be tested is legal is detected in advance, that is, whether the interface to be tested is detected in advance. Specifically, when the interface to be tested is detected to exist in the preset interface list, the interface to be tested is judged to be legal, namely the interface to be tested is the interface to be tested, otherwise, the interface to be tested is judged to be illegal, namely the interface to be tested is not the interface to be tested.
When detecting that the interface to be tested is legal, the parameter transmission requirement detection module 130 determines whether the interface to be tested needs the parameter transmission 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 detection module 130 determines that the interface to be tested needs to transmit in parameters, and invokes the parameter acquisition module 140; otherwise, it is determined that the interface to be tested does not need an incoming parameter, and the response receiving module 180 is directly invoked.
The parameter obtaining module 140 is configured to obtain the target parameter from the interface test instruction when the interface to be tested needs the incoming parameter.
The parameter acquisition module 140 first detects whether the parameter identifier is included in the interface test instruction, and when included, acquires the target parameter from the interface test instruction, where the target parameter generally follows the parameter identifier, and the target parameter and the parameter identifier are separated by a predetermined symbol.
For example, when "DAT" is detected from the interface test instruction, it indicates that the parameter identifier exists, and then the target parameter corresponding to the interface to be tested is obtained from the parsed interface test instruction.
The parameter legal detection module 150 is configured to detect whether the target parameter is legal, and if so, execute the parameter conversion module 160; if not, outputting error information.
In this embodiment, the parameter validity detection module 150 determines whether the target parameter is valid by detecting whether the number of target parameters is correct (for example, whether the number of target parameters matches the number of parameters configured by the interface to be tested in the interface list), and determines that the target parameter is valid when the number of target parameters is correct, or determines that the target parameter is not valid when the number of target parameters is not correct. It can be understood that, a person skilled in the art can judge whether the target parameter is legal or not by comparing the type, number and meaning of the target parameter as required.
If the target parameter is legal, the test of the interface to be tested is continued, if the target parameter is illegal, the communication interface returns the error information to the upper computer, so that the upper computer judges that the test interface fails the test according to the response result.
The parameter conversion module 160 is configured to perform 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 invoked according to the preset rule, the parameter conversion module 160 converts" Data1"," Date2 "into Data1, date2, and" 13","0 "into 13, 0.
The interface calling module 170 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 the parameter to be transmitted
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 corresponding to the interface to be tested 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 can judge whether the test is passed or not by judging whether the received response result is matched with a preset response result, if so, the upper computer indicates that the test is passed, otherwise, the upper computer indicates that the test is failed. Further, after a 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 test system is provided, and an instruction acquisition module acquires an interface test instruction; the interface acquisition module acquires an interface to be tested from the interface test instruction; the parameter transmission requirement detection module detects whether an interface to be tested needs to transmit parameters; when the interface to be tested needs to be input with parameters, the parameter acquisition module acquires target parameters from the interface test instruction; the interface calling module calls the interface to be tested, and transmits 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 receives a response result output by the interface to be tested. The invention solves the problems of complex testing process and low efficiency of the test code caused by the traditional writing of a single function in the communication module interface test.
Example 3
Fig. 3 is a schematic structural diagram of an electronic device according to the present embodiment. The electronic device includes a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor executes the program to implement the software interface testing method of embodiment 1, and the electronic device 30 shown in fig. 3 is merely an example and should not impose any limitation on the functions and the scope of use of the embodiment of the present invention.
The electronic device 30 may be in the form of a general purpose computing device, which may be a server device, for example. Components of electronic device 30 may include, but are not limited to: the at least one processor 31, the at least one memory 32, a bus 33 connecting the different system components, including the memory 32 and the processor 31.
The bus 33 includes a data bus, an address bus, and a control bus.
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.
Memory 32 may also include a program/utility 325 having a set (at least one) of program modules 324, such program modules 324 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each or some combination of which may include an implementation of a network environment.
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 running a 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 an input/output (I/O) interface 35. Also, model-generating device 30 may also communicate with one or more networks, such as 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 appreciated that although not shown in the figures, other hardware and/or software modules may be used in connection 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, data backup storage systems, and the like.
It should be noted that although several units/modules or sub-units/modules of an electronic device are mentioned in the above detailed description, such a division is merely exemplary and not mandatory. Indeed, the features and functionality of two or more units/modules described above may be embodied in one unit/module in accordance with embodiments of the present invention. Conversely, the features and functions of one unit/module described above may be further divided into ones that are embodied by a plurality of units/modules.
Example 4
The present embodiment provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the software interface testing method of embodiment 1.
More specifically, among others, readable storage media may be employed including, but not limited to: portable disk, 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 embodiment, the invention may also be implemented in the form of a program product comprising program code for causing a terminal device to carry out the steps of implementing the software interface testing method of embodiment 1, when said program product is run on the terminal device.
Wherein the program code for carrying out the invention may be written in any combination of one or more programming languages, which program code may execute entirely on the user device, partly on the user device, as a stand-alone software package, partly on the user device and partly on the 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 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 principles and spirit of the invention, but such changes and modifications fall within the scope of the invention.

Claims (10)

1. A method for testing a software interface, comprising the steps of:
acquiring an interface test instruction;
acquiring an interface to be tested from the interface test instruction;
detecting whether the interface to be tested needs an incoming parameter;
when the interface to be tested needs to be input with parameters, acquiring target parameters from the interface test instruction;
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;
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 obtaining the target parameter from the interface test instruction includes:
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;
and carrying out format conversion on the target parameters according to a preset rule.
2. The method for testing a software interface according to claim 1, wherein the obtaining an 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 identifier is contained.
3. The method for testing a software interface according to claim 1, wherein said detecting whether the interface to be tested requires an incoming parameter comprises:
and detecting whether the interface to be tested is legal or not in advance, and detecting whether the interface to be tested needs to be subjected to the parameter input or not when the interface to be tested is legal.
4. The software interface testing method of claim 1, wherein after obtaining the target parameter from the interface test instruction, the method further comprises:
and detecting whether the target parameters are legal or not.
5. A software interface testing system, the system comprising:
the instruction acquisition module is used for acquiring interface test instructions;
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 the parameter transmission;
the parameter acquisition module is used for acquiring target parameters from the interface test instruction when the interface to be tested needs to be subjected to the input parameters;
the interface calling module is used for 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;
the response receiving module is used for receiving a response result output by the interface to be tested so as to judge whether the interface to be tested passes the test or not according to the response result;
the parameter acquisition module is specifically configured to:
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;
and the parameter conversion module is used for carrying out format conversion on the target parameters according to a preset rule.
6. The software interface testing system of claim 5, 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 identifier is contained.
7. The software interface testing system of claim 5, wherein the parameter transmission demand detection module is specifically configured to:
and detecting whether the interface to be tested is legal or not in advance, and detecting whether the interface to be tested needs to be subjected to the parameter input or not when the interface to be tested is legal.
8. The software interface testing system of claim 5, wherein the system further comprises:
and the parameter legal detection module is used for detecting whether the target parameter is legal or not after the target parameter is acquired from the interface test instruction.
9. An electronic device comprising a processor, a memory and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the steps of a software interface testing method according to any of claims 1-4 when the computer program is executed by the processor.
10. A computer readable storage medium, characterized in that the computer readable storage medium has stored therein a computer program which, when executed by a processor, implements the steps of a software interface testing method according to any of claims 1-4.
CN202010873478.0A 2020-08-26 2020-08-26 Software interface testing method, system, equipment and medium Active CN112000579B (en)

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 CN112000579A (en) 2020-11-27
CN112000579B true 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)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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
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

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8949673B2 (en) * 2012-05-23 2015-02-03 Sap Se Software systems testing interface
US9934135B2 (en) * 2015-08-13 2018-04-03 Ca, Inc. Generic test automation for application programming interface applications

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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 (4)

* Cited by examiner, † Cited by third party
Title
Header-driven generation of sanity API tests for shared libraries;Andrey Ponomarenko等;《2010 6th Central and Eastern European Software Engineering Conference(CEE-SECR)》;20110331;97-102 *
基于JUnit框架的接口测试系统研究与实现;左刚;《中国优秀硕士论文全文数据库 信息科技辑》;20140815;I138-735 *
基于Robot Framework的自动化接口测试框架的设计与实现;杨欣等;《电子质量》(第2018年10期);40-45 *
安全苛刻系统测试语言中的测试设备协同语句;吕江花等;《软件学报》;20160105(第2016年01期);562-579 *

Also Published As

Publication number Publication date
CN112000579A (en) 2020-11-27

Similar Documents

Publication Publication Date Title
CN110445688B (en) Interface service function monitoring method and system based on data collection
CN108563567B (en) Automated testing method, apparatus, device and computer readable storage medium
US7469362B2 (en) Using a call stack hash to record the state of a process
EP3575975B1 (en) Method and apparatus for operating smart network interface card
US20070022324A1 (en) Multi-platform test automation enhancement
CN112965908B (en) Communication test method, device, communication equipment and storage medium
CN106209503B (en) RPC interface test method and system
WO2021244535A1 (en) Vehicle software fault detection method, apparatus and device, and storage medium
CN103049373B (en) A kind of localization method of collapse and device
CN108111364B (en) Service system testing method and device
WO2020019490A1 (en) Interface testing method, electronic device and storage medium
CN111796978B (en) Interface detection method, device, system, equipment and storage medium
CN112996020B (en) Bluetooth-based automatic test method and device and Bluetooth test terminal
CN111198797A (en) Operation monitoring method and device and operation analysis method and device
WO2021047184A1 (en) System failure analysis and processing method and apparatus, storage medium, and electronic device
CN107832176A (en) Hard disk pressure automatic test approach and system under a kind of Windows
US20090307668A1 (en) Software problem identification tool
TWI393003B (en) Remote hardware inspection system and method
CN112000579B (en) Software interface testing method, system, equipment and medium
CN112817883A (en) Method, device and system for adapting interface platform and computer readable storage medium
CN112216340A (en) Hard disk test method and device, storage medium and electronic equipment
CN115495363A (en) Software testing method, electronic equipment and readable storage medium
CN113238940B (en) Interface test result comparison method, device, equipment and storage medium
US20070101034A1 (en) Monitor method for computer system
CN108845932B (en) Unit testing method and device of network library, storage medium and terminal

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