CN116627851A - Interface testing method and device - Google Patents

Interface testing method and device Download PDF

Info

Publication number
CN116627851A
CN116627851A CN202310908658.1A CN202310908658A CN116627851A CN 116627851 A CN116627851 A CN 116627851A CN 202310908658 A CN202310908658 A CN 202310908658A CN 116627851 A CN116627851 A CN 116627851A
Authority
CN
China
Prior art keywords
interface
test
tested
terminal
information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202310908658.1A
Other languages
Chinese (zh)
Other versions
CN116627851B (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.)
Hundsun Technologies Inc
Original Assignee
Hundsun Technologies Inc
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 Hundsun Technologies Inc filed Critical Hundsun Technologies Inc
Priority to CN202310908658.1A priority Critical patent/CN116627851B/en
Publication of CN116627851A publication Critical patent/CN116627851A/en
Application granted granted Critical
Publication of CN116627851B publication Critical patent/CN116627851B/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
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/368Test management for test version control, e.g. updating test cases to a new software version
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • 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/3696Methods or tools to render software testable
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The embodiment of the specification provides an interface testing method and device, wherein the method comprises the following steps: acquiring interface configuration information of an interface to be tested of an operation terminal through an agent interface corresponding to the operation terminal; generating a local mapping interface based on the interface configuration information, and determining interface parameters corresponding to the local mapping interface; updating a preset test case into a target test case based on the interface parameters, and sending the target test case to the operation terminal through the local mapping interface; and receiving an operation result returned by the operation terminal aiming at the target test instance, and generating the test information of the interface to be tested according to the operation result. The local mapping interface is generated according to the interface configuration information, so that different interface parameters are prevented from being manually input according to different interfaces to be tested, meanwhile, interface test is performed by using a target test instance generated by updating the interface parameters, the complexity of the interface test is reduced, and the interface test efficiency is improved.

Description

Interface testing method and device
Technical Field
The embodiment of the specification relates to the technical field of RPC interface testing, in particular to an interface testing method.
Background
With the development of computer technology, the RPC framework is increasingly widely used, and RPC (Remote Procedure Call) is a protocol that requests services from remote computer programs over a network without requiring knowledge of underlying network technology. In particular a procedure or function that allows the back-end program to call another address space without explicitly encoding the details of this remote call, it is easier to build a distributed application through the RPC framework. At present, no good test method is adopted for the RPC interface, so that the problems of the PRC service during creation and use are hidden, the PRC service cannot be repaired in time, and the normal use of the RPC service is affected. Therefore, how to accurately perform RPC interface testing is a current urgent problem to be solved.
Disclosure of Invention
In view of this, the embodiments of the present disclosure provide an interface testing method. One or more embodiments of the present specification relate to an interface testing apparatus, an interface testing system, a computing device, a computer-readable storage medium, and a computer program, which solve the technical drawbacks of the prior art.
According to a first aspect of embodiments of the present disclosure, there is provided an interface testing method, applied to a test terminal, including:
Acquiring interface configuration information of an interface to be tested of an operation terminal through an agent interface corresponding to the operation terminal;
generating a local mapping interface based on the interface configuration information, and determining interface parameters corresponding to the local mapping interface;
updating a preset test case into a target test case based on the interface parameters, and sending the target test case to the operation terminal through the local mapping interface;
and receiving an operation result returned by the operation terminal aiming at the target test instance, and generating the test information of the interface to be tested according to the operation result.
According to a second aspect of embodiments of the present specification, there is provided an interface test system comprising a test terminal and an operation terminal, wherein,
the test terminal is used for acquiring interface configuration information of an interface to be tested of the operation terminal through an agent interface corresponding to the operation terminal, generating a local mapping interface based on the interface configuration information, determining interface parameters corresponding to the local mapping interface, updating a preset test instance into a target test instance based on the interface parameters, and sending the target test instance to the operation terminal through the local mapping interface;
The operation terminal is used for operating the target test instance through the interface to be tested, obtaining an operation result of the target test instance and returning to the test terminal;
and the test terminal is used for generating the test information of the interface to be tested according to the operation result.
According to a third aspect of embodiments of the present specification, there is provided an interface test apparatus applied to a test terminal, including:
the device comprises an acquisition module, a test module and a test module, wherein the acquisition module is configured to acquire interface configuration information of an interface to be tested of an operation terminal through a proxy interface corresponding to the operation terminal;
the determining module is configured to generate a local mapping interface based on the interface configuration information and determine interface parameters corresponding to the local mapping interface;
the updating module is configured to update a preset test case into a target test case based on the interface parameters and send the target test case to the running terminal through the local mapping interface;
the generating module is configured to receive an operation result returned by the operation terminal aiming at the target test instance, and generate the test information of the interface to be tested according to the operation result.
According to a fourth aspect of embodiments of the present specification, there is provided a computing device comprising:
A memory and a processor;
the memory is configured to store computer-executable instructions that, when executed by the processor, perform the steps of the interface test method described above.
According to a fifth aspect of embodiments of the present specification, there is provided a computer readable storage medium storing computer executable instructions which, when executed by a processor, implement the steps of the interface test method described above.
According to a sixth aspect of the embodiments of the present specification, there is provided a computer program, wherein the computer program, when executed in a computer, causes the computer to perform the steps of the above-described interface test method.
The specification provides an interface testing method, which is applied to a testing terminal and comprises the following steps: acquiring interface configuration information of an interface to be tested of an operation terminal through an agent interface corresponding to the operation terminal; generating a local mapping interface based on the interface configuration information, and determining interface parameters corresponding to the local mapping interface; updating a preset test case into a target test case based on the interface parameters, and sending the target test case to the operation terminal through the local mapping interface; and receiving an operation result returned by the operation terminal aiming at the target test instance, and generating the test information of the interface to be tested according to the operation result.
According to the embodiment of the specification, the interface configuration information of the interface to be tested is obtained through the proxy interface, the local mapping interface is generated according to the interface configuration information, the condition that different interface parameters are required to be manually input according to different interfaces to be tested is avoided, the preset test example is updated into the target test example through the interface parameters of the local mapping interface, the target test example is sent to the operation terminal through calling the local mapping interface, the interface to be tested is tested based on the target test example, the noninductive test calling of the remote interface to be tested is realized under the condition that the local mapping interface is called by the test terminal, meanwhile, the interface test is carried out by utilizing the target test example generated by updating the interface parameters, the complexity of the interface test is reduced, and the interface test efficiency is improved.
Drawings
Fig. 1 is a schematic view of a scenario of an interface testing method according to an embodiment of the present disclosure;
FIG. 2 is a flow chart of an interface testing method provided in one embodiment of the present disclosure;
FIG. 3 is a process flow diagram of an interface testing method according to one embodiment of the present disclosure;
FIG. 4 is a system diagram of an interface test system according to one embodiment of the present disclosure;
FIG. 5 is a schematic diagram of an interface testing apparatus according to an embodiment of the present disclosure;
FIG. 6 is a block diagram of a computing device provided in one embodiment of the present description.
Detailed Description
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present description. This description may be embodied in many other forms than described herein and similarly generalized by those skilled in the art to whom this disclosure pertains without departing from the spirit of the disclosure and, therefore, this disclosure is not limited by the specific implementations disclosed below.
The terminology used in the one or more embodiments of the specification is for the purpose of describing particular embodiments only and is not intended to be limiting of the one or more embodiments of the specification. As used in this specification, one or more embodiments and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used in one or more embodiments of the present specification refers to and encompasses any or all possible combinations of one or more of the associated listed items.
It should be understood that, although the terms first, second, etc. may be used in one or more embodiments of this specification to describe various information, these information should not be limited by these terms. These terms are only used to distinguish one type of information from another. For example, a first may also be referred to as a second, and similarly, a second may also be referred to as a first, without departing from the scope of one or more embodiments of the present description. The word "if" as used herein may be interpreted as "at … …" or "at … …" or "responsive to a determination", depending on the context.
Furthermore, it should be noted that, user information (including, but not limited to, user equipment information, user personal information, etc.) and data (including, but not limited to, data for analysis, stored data, presented data, etc.) according to one or more embodiments of the present disclosure are information and data authorized by a user or sufficiently authorized by each party, and the collection, use, and processing of relevant data is required to comply with relevant laws and regulations and standards of relevant countries and regions, and is provided with corresponding operation entries for the user to select authorization or denial.
First, terms related to one or more embodiments of the present specification will be explained.
RPC: the RPC (Remote Procedure Call ) is a protocol that requests services from a remote computer program over a network without requiring knowledge of the underlying network technology. In particular a procedure or function that allows the back-end program to call another address space without the need to display details encoding this remote call, it is easier to build a distributed application through the RPC framework.
At present, there are two main methods for testing RPC services:
1. the service provider itself converts the RPC interface into an HTTP (Hypertext Transfer Protocol ) interface according to preset rules to provide the tester call. The method has the defects that the RPC interface can only be directly called after being converted into the HTTP interface, the routing function of the RPC framework can not be tested, and the basis of pressure test is not provided; the HTTP protocol is used, the format of the HTTP interface access is different from the format of the RPC interface actually used, and the routing and serialization process when the RPC interface is used in production cannot be restored.
2. The tester uses the generalized call RPC service interface. The disadvantage of this approach is that the generalized call is another way of providing interface calls within the RPC framework, which differ in proxy class selection, serialization of the incomes, etc., as compared to the actual use of RPC calls in production.
Therefore, the two methods can not well test the RPC interface, and the two methods are tested under the condition of no interface package, and the template data are required to be manually input, and a plurality of test cases for different RPC interfaces are written, so that the test cost and the complexity of the test are improved.
Based on this, an interface test method is provided in the present specification, which relates to an interface test apparatus, an interface test system, a computing device, and a computer-readable storage medium, one by one, in the following embodiments.
Referring to fig. 1, fig. 1 is a schematic diagram of a scenario of an interface testing method according to an embodiment of the present disclosure, where a test terminal may be understood as a test tool terminal for testing an RPC interface, a registration terminal may be understood as a terminal for storing a registration address of an exposed interface, and an operation terminal may be understood as a terminal where the RPC interface is actually deployed. When the RPC interface on the operation terminal, namely the interface to be tested, needs to be tested, the test terminal firstly obtains the registration information of the proxy interface corresponding to the interface to be tested from the registration terminal, and the test terminal does not know the access parameters of the RPC interface, so that the interface configuration information of the interface to be tested needs to be obtained through the proxy interface, then the local mapping interface is generated based on the interface configuration information, and the interface parameters of the local mapping interface are obtained, at the moment, a target test instance for testing the interface to be tested can be generated based on the interface parameters of the local mapping interface, so that the problem of complex test caused by manually writing the test instance according to the configuration information of the interface to be tested is avoided, the target test instance is sent to the operation terminal through the interface to be tested under the condition that the test terminal is not sensitive, the operation terminal runs the target test instance to return to the operation result, and the test terminal can generate the test result of the interface to be tested according to the operation result. Based on the interface configuration information of the interface to be tested is obtained through the proxy interface, a local mapping interface is generated according to the interface configuration information, different interface parameters are prevented from being manually input according to different interfaces to be tested, a preset test instance is updated to be a target test instance through the interface parameters of the local mapping interface, the target test instance is sent to the operation terminal through calling the local mapping interface, the interface to be tested is tested based on the target test instance, the remote non-sensing test calling of the interface to be tested is realized under the condition that the local mapping interface is called by the test terminal, meanwhile, the interface test is carried out by utilizing the target test instance generated by updating the interface parameters, the complexity of the interface test is reduced, and the interface test efficiency is improved.
Referring to fig. 2, fig. 2 shows a flowchart of an interface testing method according to an embodiment of the present disclosure, where the method is applied to a test terminal, and specifically includes the following steps.
Step 202: and acquiring interface configuration information of an interface to be tested of the operation terminal through a proxy interface corresponding to the operation terminal.
The running terminal can be understood as a terminal deployed with an RPC interface to be tested, in practical application, the running terminal can be a server deployed for a service provider, a plurality of micro services provided for users are deployed on the server, each micro service can open a plurality of RPC interfaces, and the users can directly call the corresponding RPC interface from the server based on an RPC protocol through a local client, so that services provided by the service provider are obtained. The proxy interface can be understood as a proxy component interface of the RPC interface to be tested, and the test terminal cannot directly call and communicate with the interface to be tested because the test terminal does not know the participation of the interface to be tested, so that the proxy interface of the test terminal and the tested application can be deployed together, a proxy interface is provided for each interface to be tested of the tested application, and the proxy interface can scan the memory information of the java virtual machine, so that the interface configuration information of the interface to be tested, which is loaded into the memory, is obtained. The interface configuration information of the interface to be tested can be understood as an interface package and a dependency package of the interface to be tested, the interface package can be regarded as a concept of a computer folder, and parameters such as classes written in Java, used interfaces, running mechanisms and the like are stored in the interface package.
In practical application, in an RPC framework based on Java language, a proxy interface capable of acquiring an RPC interface packet, a dependent packet byte code and an interface implementation class is provided, and the proxy interface is referred by a service corresponding to the RPC interface to be tested, namely, a corresponding relation exists between the proxy interface and the interface to be tested. The proxy interface can analyze or acquire interface jar packets and dependent jar packets of the class of the interface to be tested through a class loader (ClassLoader), and acquire resource locators of the jar packets, so that jar packet byte codes are acquired.
In a specific embodiment of the present disclosure, the running terminal is a server, and it is now required to test the interface 1 on the server to test whether it can provide normal service, and take the interface 1 as the interface to be tested. The test terminal may be a client of the service provider, which is specially used for testing the interface, and the client obtains interface configuration information of the interface 1 through a proxy interface on the server, where the interface configuration information includes an interface package and a dependency package.
Further, in order to avoid the problem that communication cannot be normally invoked with the interface to be tested due to the fact that access parameters of the interface to be tested cannot be determined, interface configuration information of the interface to be tested can be obtained through the proxy interface, specifically, the interface configuration information of the interface to be tested of the operation terminal is obtained through the proxy interface corresponding to the operation terminal, and the method comprises the following steps: determining an interface to be tested of an operation terminal and an agent interface with a corresponding relation with the interface to be tested; acquiring first interface registration information corresponding to the proxy interface; and calling a proxy interface corresponding to the operation terminal according to the first interface registration information to acquire interface configuration information of an interface to be tested of the operation terminal.
The interface to be tested is provided with a proxy interface with a corresponding relation, when the interface to be tested is required to be tested, the proxy interface corresponding to the interface to be tested can be determined, first interface registration information exposed by the proxy interface is acquired from a registration terminal, namely a registration center, the first interface registration information can be understood as information such as an IP address, a port number and the like of the registration of the proxy interface, and after the first interface registration information of the proxy interface is acquired, the proxy interface can be called based on the first interface registration information.
In practical application, after the test terminal obtains the RPC interface registration information of the proxy interface from the registration terminal, interface call can be performed based on the RPC interface registration information of the proxy interface, service corresponding to the proxy interface is operated, the proxy interface can automatically obtain interface configuration information of the interface to be tested, namely an RPC interface package and a dependency package of the interface to be tested, and the obtained interface configuration information is returned to the test terminal, so that the test terminal can determine information such as configuration environment, configuration parameters and the like of the interface to be tested based on the interface configuration information.
In a specific embodiment of the present disclosure, referring to the above example, it is necessary to test an interface 1 on a certain server, take the interface 1 as an interface to be tested, and determine a proxy interface corresponding to the interface 1. After the proxy interface is determined, the interface registration information corresponding to the proxy interface can be searched from the registration terminal, namely, the IP address and the port number of the proxy interface are acquired, interface call is carried out based on the first interface registration information of the proxy interface, so that the interface configuration information of the interface 1 is acquired through the proxy interface, and the interface configuration information is an interface package of the interface to be tested and byte codes of the dependent package.
Based on the configuration information, the proxy interface is configured for the interface to be tested, so that the test terminal can acquire the interface configuration information of the interface to be tested through the proxy interface, and the subsequent interface test efficiency is improved.
Step 204: and generating a local mapping interface based on the interface configuration information, and determining interface parameters corresponding to the local mapping interface.
The local mapping interface may be understood as an interface generated by simulating the interface configuration information of the interface to be tested in the test terminal, and the interface parameters corresponding to the local mapping interface may be understood as input parameters and output parameters of the interface. The input parameters refer to data or instructions which need to be transferred to the interface when the interface is called, and the input parameters can be basic data types such as integers, floating point numbers, boolean values and the like, or complex data types such as arrays, structures and the like, and when the interface is called, the corresponding data or instructions need to be transferred to the interface according to the parameter entering requirements of the interface. The output parameters refer to data or instructions returned to the calling terminal by the interface when the interface is called, the output parameters can be basic data types such as integers, floating point numbers, boolean values and the like, or complex data types such as arrays, structures and the like, and the calling terminal also needs to receive the data or instructions returned by the interface according to parameter output requirements of the interface when the interface is called.
In practical application, in order to enable the test terminal to call the remote interface to be tested without sense, a local mapping interface can be generated locally, and because the local mapping interface is generated according to interface configuration information of the interface to be tested, interface parameters of the local mapping interface are the same as interface parameters of the interface to be tested, so that calling the local mapping interface can trigger calling the remote interface to be tested. In the implementation, the class loader can be used for loading the interface package and the byte code of the dependent package of the interface to be tested under the RPC framework based on Java language, and the RPC framework is used for generating the corresponding local mapping interface for the interface to be tested. After the local mapping interface is generated, the access parameters of the local mapping interface can be obtained through analysis and caching by using Java reflection and other modes, and meanwhile, the access parameters can be converted into a test template for a tester to fill in related parameters.
In a specific embodiment of the present disclosure, referring to the above example, after obtaining the interface configuration information of the interface 1, that is, the byte codes of the interface package and the dependency package, the class loader (ClassLoader) loads the byte codes of the interface package and the dependency package, thereby generating the local mapping interface, and obtaining the interface parameters of the local mapping interface.
In another specific embodiment of the present disclosure, referring to the above example, after the local mapping interface is generated and the interface parameters of the local mapping interface are obtained, a test template may be generated based on the interface parameters, and a tester may fill in the values through the test template, so that a related test instance is manually generated for testing the interface to be tested.
Furthermore, in order to ensure that the local mapping interface can be generated, an interface generating component needs to be adopted to implement, and specifically, the local mapping interface is generated based on the interface configuration information, which includes: loading the interface configuration information by using a preset interface generating component; and generating a local mapping interface according to the loading result of the preset interface generating component.
The preset interface generating component is the class loader, loads interface configuration information through the class loader, and generates a local mapping interface according to a loading result of the class loader.
In a specific embodiment of the present disclosure, referring to the above example, the class loader is used to load the interface package and the dependency package byte code of the interface 1, and the local mapping interface is generated according to the loading result.
Based on the method, the local mapping interfaces which are the same with the interfaces to be tested in and out can be generated at the test terminal through loading the interface configuration information, and the automatic generation of the test case can be performed subsequently based on the interface parameters of the local mapping interfaces, so that the need of manually writing the test case by a tester is avoided, and the interface test efficiency is improved.
Step 206: updating a preset test case into a target test case based on the interface parameters, and sending the target test case to the operation terminal through the local mapping interface.
The preset test case can be understood as a case for the test interface, which is set by a tester in advance, the preset test case can include request data and response data, and related parameters, such as a test interface name and a data type, which need to be filled according to interface parameters of the interface to be tested, the target test case is a test case generated after the preset test case is adjusted and modified according to the interface parameters of the interface to be tested, the target test case has the corresponding test interface name filled, the request data and the expected receiving data set according to the data type defined by the interface access parameters, and after the target test case is sent to the interface to be tested, the operation terminal can operate the target test case through the micro-service corresponding to the interface to be tested, and returns an operation result to the test terminal, so that the test terminal can judge whether the interface to be tested passes the test or not based on the operation result.
In practical application, because the interface parameters of each interface to be tested are different, a tester is required to write a corresponding test instance based on different interfaces to be tested, but more writing workload is brought to the tester, so that the interface test cost is improved, in order to reduce the test cost and improve the test efficiency, a local mapping interface can be locally generated by acquiring an interface package of the interface to be tested and byte codes of a dependent package, and a preset test instance is automatically updated based on the interface parameters of the local mapping interface to obtain a target test instance, thereby realizing that the corresponding test instance can be automatically generated no matter which interface is tested, and avoiding the problem that the test instance is required to be updated for different test interfaces or the problem that the test instance is updated due to the adjustment of the interface parameters of the test interfaces.
In a specific embodiment of the present disclosure, referring to the above example, a preset test case is updated to a target test case according to an interface parameter of a local mapping interface, where the preset test case includes request data and expected data, and the target test case includes request data and expected data set according to a data type specified by the interface parameter. In addition, response time can be added to the target test case, namely, the interface is tested from the perspective of response time of the interface to be tested.
Further, in order to ensure that the interface to be tested can be tested correctly, a test case meeting the interface requirement of the interface to be tested needs to be used for testing, and specifically, updating the preset test case into the target test case based on the interface parameters includes: generating a test case template according to the interface parameters; and updating the preset test case according to the test case template to obtain a target test case, wherein the target test case has a unique matching relationship with the interface to be tested.
The test case template can be understood as a template defining the data use type in the test case, if the data type in the test case template is integer, the data types of the request data and the response data in the subsequent target test case are integer, so that the interface to be tested can normally receive the target test case, and the interface test is completed.
In practical application, because the interface parameters between the interfaces may be different, even the interface parameters of the same interface may be different due to service adjustment, a corresponding target test instance needs to be generated according to each interface to be tested, that is, each interface to be tested has a target test instance with a unique matching relationship. In addition, the target test case can include a plurality of target test sub-cases, and because different value ranges such as normal values, null values, critical values and the like can be tested in the actual test process, a plurality of groups of different parameters can be tested according to the service of the interface, for example, if the interface to be tested is a purchase service interface, the conditions of enough and insufficient purchase amount or the conditions of enough and insufficient purchase amount can be tested. Thus, testing of different dimensions of the interface to be tested may be achieved by multiple target test sub-instances in the target test instance.
In a specific embodiment of the present disclosure, the above example is referred to, a test case template is generated according to interface parameters of a local mapping interface, a data type is specified in the test case template as a character type, and a preset test case is updated according to the test case template, so as to obtain a target test case, the data types of data in the target test case are all character types, and then the target test case can be sent to the interface to be tested, so that an operation terminal can operate the target test case through the interface to be tested, and an operation result corresponding to the target test case is obtained.
Based on the method, the target test case is obtained by updating the preset test case based on the test case template, so that the interface to be tested can normally receive the target test case, and the test of the interface to be tested is realized.
Further, in order to enable the target test case to be normally sent to the interface to be tested, interface registration information of the interface to be tested needs to be acquired, specifically, the target test case is sent to the operation terminal through the local mapping interface, including: acquiring second interface registration information of the interface to be tested through the local mapping interface; calling the interface to be tested according to the second interface registration information, and establishing a transmission channel of the local mapping interface and the interface to be tested; and sending the target test case to the operation terminal through the transmission channel.
The second interface registration information may be understood as interface address information, such as an IP address and a port number of an interface, registered by the interface to be tested in the registration terminal, and the transmission channel may be understood as a channel for performing data transmission between the test terminal and the operation terminal.
In practical application, the test terminal initiates a call to the local mapping interface, at this time, the local mapping terminal obtains second interface registration information of the interface to be tested from the registration terminal, and calls the interface to be tested based on the second interface registration information, at this time, a transmission channel between the local mapping interface and the interface to be tested is established, so that the test terminal transmits the target test case to the interface to be tested through the local mapping interface, and therefore the operation terminal can receive the target test case. In specific implementation, the test terminal initiates a call to the local mapping interface, at this time, the local mapping interface automatically triggers the call to the interface to be tested, in order to call the interface to be tested, the interface registration information of the interface to be tested needs to be acquired from the registration terminal, then the interface to be tested is called based on the interface registration information of the interface to be tested, a transmission channel between the local mapping interface and the interface to be tested is established, and data transmission between the test terminal and the operation terminal is realized.
In a specific embodiment of the present disclosure, referring to the above example, a test terminal, that is, a client, obtains second interface registration information of an interface to be tested through a local mapping interface, where the second interface registration information includes an IP address and a port number of an interface 1, calls the interface 1 according to the second interface registration information, establishes a transmission channel between the local mapping interface and the interface to be tested, and then may transmit a target test case to an operation terminal through the transmission channel, so that the operation terminal operates the target test case based on the interface to be tested.
Based on the method, the test terminal calls the local mapping interface to map to the interface to be tested, so that the remote call of the interface to be tested is completed on the premise of no sense of the test terminal, the actual interface calling process is restored in the test process, and the test accuracy is ensured.
Step 208: and receiving an operation result returned by the operation terminal aiming at the target test instance, and generating the test information of the interface to be tested according to the operation result.
The operation result may be understood as an execution result after the service corresponding to the interface to be tested executes the target test instance, after the operation terminal executes the target test instance through the service corresponding to the interface to be tested, the operation result corresponding to the target test instance may be obtained, and the operation result is returned to the test terminal, so that the test terminal generates test information of the interface to be tested based on the operation result, and the test information of the interface to be tested may be understood as a determination result of whether the test of the interface to be tested is passed by the test terminal based on the operation result.
In a specific embodiment of the present disclosure, a client receives an operation result returned by a server for a target test case, where the operation result includes response information, such as response data, response time, and the like, corresponding to the target test case, and the client generates test information of an interface to be tested based on the operation result, where the test information indicates that the interface to be tested passes the test if the test information passes the test, and indicates that the interface to be tested fails the test if the test information does not pass the test.
Further, in order to correctly generate test information of an interface to be tested based on an operation result, the operation result needs to be compared with an expected operation result, specifically, an operation result returned by the operation terminal for the target test case is received, and the test information of the interface to be tested is generated according to the operation result, including: receiving an operation result returned by the operation terminal aiming at the target test instance; comparing the operation result with a preset operation result corresponding to the target test instance; and under the condition that the comparison results are the same, determining that the test information of the interface to be tested is passed, or under the condition that the comparison results are different, determining that the test information of the interface to be tested is not passed.
The preset operation result may be understood as expected response data carried in the target test case, such as an expected response value, an expected response time, and the like, and whether the interface to be tested passes the test may be determined by comparing the preset operation result with the operation result. If the preset operation result includes an expected response value 200 and an expected response time 5, and the operation result includes an actual response value 300 and an actual response time 4, and the comparison results are the same after the comparison, determining that the test information of the interface to be tested is not passed, otherwise, determining that the test information is passed.
In a specific embodiment of the present disclosure, by comparing the preset operation result with the operation result, the test information of the interface to be tested may be correctly determined, so as to give an accurate test result.
Further, in order to enable the tester to learn the test information of the test result to be tested, the test terminal may generate feedback information based on the test information and return the feedback information to the user terminal, and the method further includes: generating feedback information according to the test information and the interface identification information of the interface to be tested; and sending the feedback information to the user terminal.
The feedback information can be understood as a test result of the interface to be tested, and the feedback information can include information such as interface configuration information, interface identification information, a target test instance, an operation result, test information and the like of the interface to be tested, and a tester can know the current test process through the feedback information, so that subsequent modification and adjustment can be performed on the interface to be tested which does not pass the test according to the test process. The user terminal can be understood as a terminal used by a tester or a user, and in practical application, the test terminal and the user terminal can be used as one terminal, and at the moment, feedback information can be reflected to the user in a page form.
In a specific embodiment of the present disclosure, feedback information is generated according to test information and interface identification information of the interface 1 for a target test case, and the feedback information is sent to the user terminal, so that a tester operating the user terminal can know the test condition of the interface to be tested.
Based on the method, the user can perceive the test result of the interface to be tested by returning the test information of the interface to be tested to the user terminal in the form of feedback information, so that the interface which does not pass the test can be modified and adjusted conveniently.
Further, in order to facilitate subsequent testers to adjust and modify interfaces to be tested which do not pass the test or to issue interfaces to be tested which pass the test online, the interfaces to be tested may be classified according to the test information, and the method further includes: if the test information is passed, adding the interface to be tested to a set of interfaces to be used, wherein the interfaces in the set of interfaces to be used are used for running application examples; and adding the interface to be tested to an interface set to be updated under the condition that the test information does not pass, wherein the interfaces in the interface set to be updated are used for updating parameters.
The interface set to be used can be understood as a set formed by interfaces to be tested passing the test, and the interfaces in the interface set to be used can be directly used by the test; the interface set to be updated can be understood as a set of interfaces to be tested which do not pass the test, the interfaces in the interface set to be updated need to be modified and adjusted again, and then the interface test is continued.
In practical application, the interface identification information of the interface to be tested can be distributed to different sets according to the test information, so that a tester can directly call the interface passing the test for use or adjust and modify the interface failing the test.
In a specific embodiment of the present disclosure, the test result of the interface 1 is passing, and at this time, the interface identification information of the interface 1 is added to the interface set to be used, and the subsequent tester can directly issue the interface 1 on line for use.
In another embodiment of the present disclosure, the test result of the interface 1 is failed, and at this time, the interface identification information of the interface 1 is added to the interface set to be updated, and the subsequent tester can select the interface 1 from the interface set to be updated to adjust.
Based on the method, the interfaces after testing are further processed by subsequent testers by classifying the interfaces according to the testing information, so that the subsequent business processing efficiency is improved.
The interface testing method provided by the specification is applied to a testing terminal and comprises the following steps: acquiring interface configuration information of an interface to be tested of an operation terminal through an agent interface corresponding to the operation terminal; generating a local mapping interface based on the interface configuration information, and determining interface parameters corresponding to the local mapping interface; updating a preset test case into a target test case based on the interface parameters, and sending the target test case to the operation terminal through the local mapping interface; and receiving an operation result returned by the operation terminal aiming at the target test instance, and generating the test information of the interface to be tested according to the operation result. The method and the device have the advantages that interface configuration information of the interface to be tested is obtained through the proxy interface, a local mapping interface is generated according to the interface configuration information, different interface parameters are prevented from being manually input according to different interfaces to be tested, a preset test instance is updated to be a target test instance through the interface parameters of the local mapping interface, the target test instance is sent to the operation terminal through calling the local mapping interface, the interface to be tested is tested based on the target test instance, the remote non-sensing test calling of the interface to be tested is achieved under the condition that the local mapping interface is called by the test terminal, meanwhile, interface test is conducted by utilizing the target test instance generated through updating of the interface parameters, the complexity of interface test is reduced, and the interface test efficiency is improved.
The following describes an example of the application of the interface test method provided in the present specification to remote interface test with reference to fig. 3. Fig. 3 is a flowchart of a processing procedure of an interface testing method according to an embodiment of the present disclosure, which specifically includes the following steps.
Step 302: and determining an interface to be tested of the operation terminal and a proxy interface with a corresponding relation with the interface to be tested.
In one implementation manner, the running terminal is a server providing a data query service, the interface to be tested is an interface a for querying the age of the user, the interface a is determined to be the interface to be tested, and the proxy interface a having a corresponding relation with the interface a is determined.
Step 304: and acquiring first interface registration information corresponding to the proxy interface, calling the proxy interface corresponding to the operation terminal according to the first interface registration information, and acquiring interface configuration information of the interface to be tested of the operation terminal.
In one implementation manner, the IP address and the port number of the proxy interface a are acquired, the proxy interface a is called according to the IP address and the port number of the proxy interface a, and the interface configuration information of the interface a to be tested is acquired, wherein the interface configuration information comprises an interface packet and a dependency packet byte code of the interface a.
Step 306: and loading interface configuration information by using a preset interface generating component, generating a local mapping interface according to a loading result of the preset interface generating component, and determining interface parameters corresponding to the local mapping interface.
In one implementation, the class loader is used for loading interface configuration information, and setting up an environment of the interface is configured at the test terminal according to the loading result, so that the local mapping interface is deployed at the test terminal, and interface parameters corresponding to the local mapping interface are determined.
Step 308: generating a test case template according to the interface parameters, and updating the preset test case according to the test case template to obtain a target test case.
In one implementation manner, a test case template is generated according to interface parameters of a local mapping interface, and a preset test case is updated according to the test case template to obtain a target test case, wherein the target test case comprises test data set according to access parameters of the interface to be tested, such as inquiring the age of a user A.
Step 310: and acquiring second interface registration information of the interface to be tested through the local mapping interface, calling the interface to be tested according to the second interface registration information, establishing a transmission channel of the local mapping interface and the interface to be tested, and sending the target test instance to the operation terminal through the transmission channel.
In one implementation manner, the test terminal invokes the local mapping interface to obtain second interface registration information of the interface to be tested, wherein the second interface registration information comprises an IP address and a port number of the interface A to be tested, and invokes the interface to be tested according to the second interface registration information, so that a transmission channel between the two interfaces is established, and the target test instance is sent to the operation terminal through the transmission channel.
Step 312: and receiving an operation result returned by the operation terminal aiming at the target test instance, and comparing the operation result with a preset operation result corresponding to the target test instance.
In one implementation manner, the receiving server returns an operation result aiming at the target test case, where the operation result includes response data "age of a user a" is: and (3) 18 years old, comparing the operation result with a preset operation result, and if the comparison result is inconsistent, the interface to be tested in the instruction book fails to pass the test, and the test information fails to pass.
Step 314: and generating feedback information according to the test information and the interface identification information of the interface to be tested, and sending the feedback information to the user terminal.
In one implementation manner, according to the test information "failed" and the interface identification information "interface a" of the interface to be tested, generating feedback information "the test result of the interface a is failed", and sending the feedback information to the user terminal. And the interface identification information of the interface A is added into the interface set to be updated, so that a tester can select the interface A from the interface set to be updated to modify and adjust, and the interface A can meet the operation requirement.
The interface testing method provided by the specification is applied to the testing terminal, the interface configuration information of the interface to be tested is obtained through the proxy interface, the local mapping interface is generated according to the interface configuration information, different interface parameters are prevented from being manually input according to different interfaces to be tested, the preset test instance is updated to be the target test instance through the interface parameters of the local mapping interface, the target test instance is sent to the running terminal through calling the local mapping interface, the interface to be tested is tested based on the target test instance, the non-sensing test calling of the remote interface to be tested is achieved under the condition that the local mapping interface is called by the testing terminal, meanwhile, the interface test is conducted by using the target test instance generated through updating of the interface parameters, the complexity of the interface test is reduced, and the interface testing efficiency is improved.
Corresponding to the method embodiment, the present disclosure further provides an interface test system embodiment, and fig. 4 shows a system schematic diagram of an interface test system provided in one embodiment of the present disclosure. As shown in fig. 4, the system includes a test terminal 402 and a run terminal 404, wherein,
The test terminal 402 is configured to obtain, through an agent interface corresponding to the operation terminal, interface configuration information of an interface to be tested of the operation terminal, generate a local mapping interface based on the interface configuration information, determine an interface parameter corresponding to the local mapping interface, update a preset test case to be a target test case based on the interface parameter, and send the target test case to the operation terminal through the local mapping interface;
the operation terminal 404 is configured to operate the target test case through the interface to be tested, obtain an operation result of the target test case, and return the operation result to the test terminal;
the test terminal 402 is configured to generate test information of the interface to be tested according to the operation result.
Optionally, the system further comprises a registration terminal;
the test terminal 402 is configured to send a first acquisition request for the proxy interface to the registration terminal; sending a second acquisition request aiming at the interface to be tested to the registration terminal;
the registration terminal is used for responding to the first acquisition request and sending first interface registration information to the test terminal; responding to the second acquisition request, and sending second interface registration information to the test terminal;
The test terminal 402 is configured to invoke the proxy interface according to the first interface registration information, and obtain interface configuration information of the interface to be tested; and calling the interface to be tested according to the second interface registration information, establishing a transmission channel of the local mapping interface and the interface to be tested, and sending the target test instance to the operation terminal through the transmission channel.
The interface test system comprises a test terminal and an operation terminal, wherein the test terminal is used for acquiring interface configuration information of an interface to be tested of the operation terminal through an agent interface corresponding to the operation terminal, generating a local mapping interface based on the interface configuration information, determining interface parameters corresponding to the local mapping interface, updating a preset test instance into a target test instance based on the interface parameters, and sending the target test instance to the operation terminal through the local mapping interface; the operation terminal is used for operating the target test instance through the interface to be tested, obtaining an operation result of the target test instance and returning to the test terminal; and the test terminal is used for generating the test information of the interface to be tested according to the operation result. The method comprises the steps that interface configuration information of an interface to be tested is obtained through the proxy interface, a local mapping interface is generated according to the interface configuration information, different interface parameters are prevented from being manually input according to different interfaces to be tested, a preset test instance is updated to be a target test instance through the interface parameters of the local mapping interface, the target test instance is sent to an operation terminal through calling the local mapping interface, the interface to be tested is tested based on the target test instance, the remote non-sensing test calling of the interface to be tested is achieved under the condition that the local mapping interface is called by the test terminal, meanwhile, interface testing is conducted through the target test instance generated through updating of the interface parameters, the complexity of interface testing is reduced, and the interface testing efficiency is improved.
The above is a schematic solution of an interface test system of the present embodiment. It should be noted that, the technical solution of the interface test system and the technical solution of the interface test method belong to the same conception, and details of the technical solution of the interface test system, which are not described in detail, can be referred to the description of the technical solution of the interface test method.
Corresponding to the method embodiment, the present disclosure further provides an embodiment of an interface testing device, and fig. 5 shows a schematic structural diagram of an interface testing device provided in one embodiment of the present disclosure. As shown in fig. 5, the apparatus includes:
the acquiring module 502 is configured to acquire interface configuration information of an interface to be tested of the operation terminal through a proxy interface corresponding to the operation terminal;
a determining module 504, configured to generate a local mapping interface based on the interface configuration information, and determine an interface parameter corresponding to the local mapping interface;
an updating module 506, configured to update a preset test case to a target test case based on the interface parameter, and send the target test case to the running terminal through the local mapping interface;
and the generating module 508 is configured to receive an operation result returned by the operation terminal aiming at the target test instance, and generate the test information of the interface to be tested according to the operation result.
Optionally, the acquiring module 502 is further configured to determine an interface to be tested of the operation terminal and a proxy interface having a corresponding relationship with the interface to be tested; acquiring first interface registration information corresponding to the proxy interface; and calling a proxy interface corresponding to the operation terminal according to the first interface registration information to acquire interface configuration information of an interface to be tested of the operation terminal.
Optionally, the determining module 504 is further configured to load the interface configuration information with a preset interface generating component; and generating a local mapping interface according to the loading result of the preset interface generating component.
Optionally, the updating module 506 is further configured to generate a test case template according to the interface parameter; and updating the preset test case according to the test case template to obtain a target test case, wherein the target test case has a unique matching relationship with the interface to be tested.
Optionally, the updating module 506 is further configured to obtain second interface registration information of the interface to be tested through the local mapping interface; calling the interface to be tested according to the second interface registration information, and establishing a transmission channel of the local mapping interface and the interface to be tested; and sending the target test case to the operation terminal through the transmission channel.
Optionally, the generating module 508 is further configured to receive an operation result returned by the operation terminal for the target test case; comparing the operation result with a preset operation result corresponding to the target test instance; and under the condition that the comparison results are the same, determining that the test information of the interface to be tested is passed, or under the condition that the comparison results are different, determining that the test information of the interface to be tested is not passed.
Optionally, the apparatus further includes a feedback module configured to generate feedback information according to the test information and interface identification information of the interface to be tested; and sending the feedback information to the user terminal.
Optionally, the device further includes an adding module configured to add the interface to be tested to a set of interfaces to be used if the test information is passed, where the interfaces in the set of interfaces to be used are used for running application instances; and adding the interface to be tested to an interface set to be updated under the condition that the test information does not pass, wherein the interfaces in the interface set to be updated are used for updating parameters.
The interface testing device provided in the present specification is applied to a testing terminal, and includes: the device comprises an acquisition module, a test module and a test module, wherein the acquisition module is configured to acquire interface configuration information of an interface to be tested of an operation terminal through a proxy interface corresponding to the operation terminal; the determining module is configured to generate a local mapping interface based on the interface configuration information and determine interface parameters corresponding to the local mapping interface; the updating module is configured to update a preset test case into a target test case based on the interface parameters and send the target test case to the running terminal through the local mapping interface; the generating module is configured to receive an operation result returned by the operation terminal aiming at the target test instance, and generate the test information of the interface to be tested according to the operation result. The method comprises the steps that interface configuration information of an interface to be tested is obtained through the proxy interface, a local mapping interface is generated according to the interface configuration information, different interface parameters are prevented from being manually input according to different interfaces to be tested, a preset test instance is updated to be a target test instance through the interface parameters of the local mapping interface, the target test instance is sent to an operation terminal through calling the local mapping interface, the interface to be tested is tested based on the target test instance, the remote non-sensing test calling of the interface to be tested is achieved under the condition that the local mapping interface is called by the test terminal, meanwhile, interface testing is conducted through the target test instance generated through updating of the interface parameters, the complexity of interface testing is reduced, and the interface testing efficiency is improved.
The above is a schematic solution of an interface testing device of this embodiment. It should be noted that, the technical solution of the interface testing device and the technical solution of the interface testing method belong to the same conception, and the details of the technical solution of the interface testing device, which are not described in detail, can be referred to the description of the technical solution of the interface testing method.
Fig. 6 illustrates a block diagram of a computing device 600 provided in accordance with one embodiment of the present description. The components of computing device 600 include, but are not limited to, memory 610 and processor 620. The processor 620 is coupled to the memory 610 via a bus 630 and a database 650 is used to hold data.
Computing device 600 also includes access device 640, access device 640 enabling computing device 600 to communicate via one or more networks 660. Examples of such networks include public switched telephone networks (PSTN, public Switched Telephone Network), local area networks (LAN, local Area Network), wide area networks (WAN, wide Area Network), personal area networks (PAN, personal Area Network), or combinations of communication networks such as the internet. The access device 640 may include one or more of any type of network interface, wired or wireless, such as a network interface card (NIC, network interface controller), such as an IEEE802.11 wireless local area network (WLAN, wireless Local Area Network) wireless interface, a worldwide interoperability for microwave access (Wi-MAX, worldwide Interoperability for Microwave Access) interface, an ethernet interface, a universal serial bus (USB, universal Serial Bus) interface, a cellular network interface, a bluetooth interface, near field communication (NFC, near Field Communication).
In one embodiment of the present description, the above-described components of computing device 600, as well as other components not shown in FIG. 6, may also be connected to each other, such as by a bus. It should be understood that the block diagram of the computing device shown in FIG. 6 is for exemplary purposes only and is not intended to limit the scope of the present description. Those skilled in the art may add or replace other components as desired.
Computing device 600 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., tablet, personal digital assistant, laptop, notebook, netbook, etc.), mobile phone (e.g., smart phone), wearable computing device (e.g., smart watch, smart glasses, etc.), or other type of mobile device, or a stationary computing device such as a desktop computer or personal computer (PC, personal Computer). Computing device 600 may also be a mobile or stationary server.
Wherein the processor 620 is configured to execute computer-executable instructions that, when executed by the processor, perform the steps of the interface testing method described above.
The foregoing is a schematic illustration of a computing device of this embodiment. It should be noted that, the technical solution of the computing device and the technical solution of the interface testing method belong to the same concept, and details of the technical solution of the computing device, which are not described in detail, can be referred to the description of the technical solution of the interface testing method.
An embodiment of the present disclosure also provides a computer-readable storage medium storing computer-executable instructions that, when executed by a processor, implement the steps of the interface test method described above.
The above is an exemplary version of a computer-readable storage medium of the present embodiment. It should be noted that, the technical solution of the storage medium and the technical solution of the interface testing method belong to the same concept, and details of the technical solution of the storage medium which are not described in detail can be referred to the description of the technical solution of the interface testing method.
An embodiment of the present disclosure further provides a computer program, where the computer program, when executed in a computer, causes the computer to perform the steps of the interface test method described above.
The above is an exemplary version of a computer program of the present embodiment. It should be noted that, the technical solution of the computer program and the technical solution of the interface test method belong to the same conception, and details of the technical solution of the computer program, which are not described in detail, can be referred to the description of the technical solution of the interface test method.
The foregoing describes specific embodiments of the present disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims can be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
The computer instructions include computer program code that may be in source code form, object code form, executable file or some intermediate form, etc. The computer readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), an electrical carrier signal, a telecommunications signal, a software distribution medium, and so forth. It should be noted that the content of the computer readable medium can be increased or decreased appropriately according to the requirements of the patent practice, for example, in some areas, according to the patent practice, the computer readable medium does not include an electric carrier signal and a telecommunication signal.
It should be noted that, for simplicity of description, the foregoing method embodiments are all expressed as a series of combinations of actions, but it should be understood by those skilled in the art that the embodiments are not limited by the order of actions described, as some steps may be performed in other order or simultaneously according to the embodiments of the present disclosure. Further, those skilled in the art will appreciate that the embodiments described in the specification are all preferred embodiments, and that the acts and modules referred to are not necessarily all required for the embodiments described in the specification.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and for parts of one embodiment that are not described in detail, reference may be made to the related descriptions of other embodiments.
The preferred embodiments of the present specification disclosed above are merely used to help clarify the present specification. Alternative embodiments are not intended to be exhaustive or to limit the invention to the precise form disclosed. Obviously, many modifications and variations are possible in light of the teaching of the embodiments. The embodiments were chosen and described in order to best explain the principles of the embodiments and the practical application, to thereby enable others skilled in the art to best understand and utilize the invention. This specification is to be limited only by the claims and the full scope and equivalents thereof.

Claims (13)

1. An interface testing method is characterized by being applied to a testing terminal and comprising the following steps:
acquiring interface configuration information of an interface to be tested of an operation terminal through an agent interface corresponding to the operation terminal;
generating a local mapping interface based on the interface configuration information, and determining interface parameters corresponding to the local mapping interface;
updating a preset test case into a target test case based on the interface parameters, and sending the target test case to the operation terminal through the local mapping interface;
and receiving an operation result returned by the operation terminal aiming at the target test instance, and generating the test information of the interface to be tested according to the operation result.
2. The method according to claim 1, wherein obtaining interface configuration information of an interface to be tested of an operation terminal through a proxy interface corresponding to the operation terminal comprises:
determining an interface to be tested of an operation terminal and an agent interface with a corresponding relation with the interface to be tested;
acquiring first interface registration information corresponding to the proxy interface;
and calling a proxy interface corresponding to the operation terminal according to the first interface registration information to acquire interface configuration information of an interface to be tested of the operation terminal.
3. The method of claim 1, wherein generating a local mapping interface based on the interface configuration information comprises:
loading the interface configuration information by using a preset interface generating component;
and generating a local mapping interface according to the loading result of the preset interface generating component.
4. The method of claim 1, wherein updating the preset test case to the target test case based on the interface parameters comprises:
generating a test case template according to the interface parameters;
and updating the preset test case according to the test case template to obtain a target test case, wherein the target test case has a unique matching relationship with the interface to be tested.
5. The method of claim 1, wherein sending the target test case to the running terminal through the local mapping interface comprises:
acquiring second interface registration information of the interface to be tested through the local mapping interface;
calling the interface to be tested according to the second interface registration information, and establishing a transmission channel of the local mapping interface and the interface to be tested;
and sending the target test case to the operation terminal through the transmission channel.
6. The method of claim 1, wherein receiving the operation result returned by the operation terminal for the target test case, generating the test information of the interface to be tested according to the operation result, comprises:
receiving an operation result returned by the operation terminal aiming at the target test instance;
comparing the operation result with a preset operation result corresponding to the target test instance;
and under the condition that the comparison results are the same, determining that the test information of the interface to be tested is passed, or under the condition that the comparison results are different, determining that the test information of the interface to be tested is not passed.
7. The method according to claim 1, wherein the method further comprises:
generating feedback information according to the test information and the interface identification information of the interface to be tested;
and sending the feedback information to the user terminal.
8. The method of claim 6, wherein the method further comprises:
if the test information is passed, adding the interface to be tested to a set of interfaces to be used, wherein the interfaces in the set of interfaces to be used are used for running application examples;
And adding the interface to be tested to an interface set to be updated under the condition that the test information does not pass, wherein the interfaces in the interface set to be updated are used for updating parameters.
9. An interface test system, comprising a test terminal and an operation terminal, wherein,
the test terminal is used for acquiring interface configuration information of an interface to be tested of the operation terminal through an agent interface corresponding to the operation terminal, generating a local mapping interface based on the interface configuration information, determining interface parameters corresponding to the local mapping interface, updating a preset test instance into a target test instance based on the interface parameters, and sending the target test instance to the operation terminal through the local mapping interface;
the operation terminal is used for operating the target test instance through the interface to be tested, obtaining an operation result of the target test instance and returning to the test terminal;
and the test terminal is used for generating the test information of the interface to be tested according to the operation result.
10. The system of claim 9, further comprising a registration terminal;
The test terminal is used for sending a first acquisition request aiming at the proxy interface to the registration terminal; sending a second acquisition request aiming at the interface to be tested to the registration terminal;
the registration terminal is used for responding to the first acquisition request and sending first interface registration information to the test terminal; responding to the second acquisition request, and sending second interface registration information to the test terminal;
the test terminal is used for calling the proxy interface according to the first interface registration information and obtaining interface configuration information of the interface to be tested; and calling the interface to be tested according to the second interface registration information, establishing a transmission channel of the local mapping interface and the interface to be tested, and sending the target test instance to the operation terminal through the transmission channel.
11. An interface testing device, applied to a testing terminal, comprising:
the device comprises an acquisition module, a test module and a test module, wherein the acquisition module is configured to acquire interface configuration information of an interface to be tested of an operation terminal through a proxy interface corresponding to the operation terminal;
the determining module is configured to generate a local mapping interface based on the interface configuration information and determine interface parameters corresponding to the local mapping interface;
The updating module is configured to update a preset test case into a target test case based on the interface parameters and send the target test case to the running terminal through the local mapping interface;
the generating module is configured to receive an operation result returned by the operation terminal aiming at the target test instance, and generate the test information of the interface to be tested according to the operation result.
12. A computing device, comprising:
a memory and a processor;
the memory is configured to store computer executable instructions, and the processor is configured to execute the computer executable instructions, which when executed by the processor, implement the steps of the interface testing method of any one of claims 1 to 8.
13. A computer readable storage medium, characterized in that it stores computer executable instructions which, when executed by a processor, implement the steps of the interface testing method of any one of claims 1 to 8.
CN202310908658.1A 2023-07-24 2023-07-24 Interface testing method and device Active CN116627851B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310908658.1A CN116627851B (en) 2023-07-24 2023-07-24 Interface testing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310908658.1A CN116627851B (en) 2023-07-24 2023-07-24 Interface testing method and device

Publications (2)

Publication Number Publication Date
CN116627851A true CN116627851A (en) 2023-08-22
CN116627851B CN116627851B (en) 2023-10-20

Family

ID=87617443

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310908658.1A Active CN116627851B (en) 2023-07-24 2023-07-24 Interface testing method and device

Country Status (1)

Country Link
CN (1) CN116627851B (en)

Citations (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030208542A1 (en) * 2002-05-01 2003-11-06 Testquest, Inc. Software test agents
CN109062806A (en) * 2018-09-14 2018-12-21 杭州数梦工场科技有限公司 A kind of program testing method, system, device and computer readable storage medium
CN109522228A (en) * 2018-11-15 2019-03-26 深圳乐信软件技术有限公司 Interface automatic test data configuration method, apparatus, platform and storage medium
CN109992508A (en) * 2019-03-22 2019-07-09 恒生电子股份有限公司 Test exemple automation generation method, device and electronic equipment
CN110008125A (en) * 2019-04-01 2019-07-12 中国信息通信研究院 A kind of automated testing method and system for credible performing environment
CN110287093A (en) * 2019-05-20 2019-09-27 平安普惠企业管理有限公司 Mobile terminal, data-interface test method and storage medium
CN110874321A (en) * 2018-09-04 2020-03-10 北京优酷科技有限公司 Remote calling method of test interface, calling packaging engine and remote proxy engine
CN111078562A (en) * 2019-12-18 2020-04-28 广州唯品会研究院有限公司 Interface test method, terminal device and computer readable storage medium
CN111737137A (en) * 2020-06-24 2020-10-02 重庆紫光华山智安科技有限公司 Interface test data generation method and device, host and storage medium
CN111752826A (en) * 2020-06-03 2020-10-09 五八有限公司 Interface testing method and device, electronic equipment and storage medium
CN112527669A (en) * 2020-12-18 2021-03-19 平安银行股份有限公司 Self-testing method and system for local service
CN113282513A (en) * 2021-06-28 2021-08-20 平安消费金融有限公司 Interface test case generation method and device, computer equipment and storage medium
CN113704114A (en) * 2021-08-30 2021-11-26 平安普惠企业管理有限公司 Automatic testing method, device, equipment and medium for functional interface
CN114003451A (en) * 2021-10-27 2022-02-01 苏州浪潮智能科技有限公司 Interface test method, device, system and medium
CN114398293A (en) * 2022-02-25 2022-04-26 阿里云计算有限公司 Interface test case generation method, electronic device and storage medium
CN114637672A (en) * 2022-03-15 2022-06-17 平安国际智慧城市科技股份有限公司 Automatic data testing method and device, computer equipment and storage medium
CN115309660A (en) * 2022-09-14 2022-11-08 平安付科技服务有限公司 Interface testing method and device, storage medium and computer equipment
CN116204438A (en) * 2023-03-09 2023-06-02 恒生电子股份有限公司 Test case generation method, automatic test method and related device
CN116450511A (en) * 2023-04-07 2023-07-18 多点生活(成都)科技有限公司 Information updating method, device, electronic equipment and computer readable medium

Patent Citations (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030208542A1 (en) * 2002-05-01 2003-11-06 Testquest, Inc. Software test agents
CN110874321A (en) * 2018-09-04 2020-03-10 北京优酷科技有限公司 Remote calling method of test interface, calling packaging engine and remote proxy engine
CN109062806A (en) * 2018-09-14 2018-12-21 杭州数梦工场科技有限公司 A kind of program testing method, system, device and computer readable storage medium
CN109522228A (en) * 2018-11-15 2019-03-26 深圳乐信软件技术有限公司 Interface automatic test data configuration method, apparatus, platform and storage medium
CN109992508A (en) * 2019-03-22 2019-07-09 恒生电子股份有限公司 Test exemple automation generation method, device and electronic equipment
CN110008125A (en) * 2019-04-01 2019-07-12 中国信息通信研究院 A kind of automated testing method and system for credible performing environment
CN110287093A (en) * 2019-05-20 2019-09-27 平安普惠企业管理有限公司 Mobile terminal, data-interface test method and storage medium
CN111078562A (en) * 2019-12-18 2020-04-28 广州唯品会研究院有限公司 Interface test method, terminal device and computer readable storage medium
CN111752826A (en) * 2020-06-03 2020-10-09 五八有限公司 Interface testing method and device, electronic equipment and storage medium
CN111737137A (en) * 2020-06-24 2020-10-02 重庆紫光华山智安科技有限公司 Interface test data generation method and device, host and storage medium
CN112527669A (en) * 2020-12-18 2021-03-19 平安银行股份有限公司 Self-testing method and system for local service
CN113282513A (en) * 2021-06-28 2021-08-20 平安消费金融有限公司 Interface test case generation method and device, computer equipment and storage medium
CN113704114A (en) * 2021-08-30 2021-11-26 平安普惠企业管理有限公司 Automatic testing method, device, equipment and medium for functional interface
CN114003451A (en) * 2021-10-27 2022-02-01 苏州浪潮智能科技有限公司 Interface test method, device, system and medium
CN114398293A (en) * 2022-02-25 2022-04-26 阿里云计算有限公司 Interface test case generation method, electronic device and storage medium
CN114637672A (en) * 2022-03-15 2022-06-17 平安国际智慧城市科技股份有限公司 Automatic data testing method and device, computer equipment and storage medium
CN115309660A (en) * 2022-09-14 2022-11-08 平安付科技服务有限公司 Interface testing method and device, storage medium and computer equipment
CN116204438A (en) * 2023-03-09 2023-06-02 恒生电子股份有限公司 Test case generation method, automatic test method and related device
CN116450511A (en) * 2023-04-07 2023-07-18 多点生活(成都)科技有限公司 Information updating method, device, electronic equipment and computer readable medium

Also Published As

Publication number Publication date
CN116627851B (en) 2023-10-20

Similar Documents

Publication Publication Date Title
CN107133180B (en) Dynamic page testing method, testing device and storage medium
CN110008109B (en) Application testing method and device
CN109726108B (en) Front-end code testing method, device, system and medium based on analog data
CN111597110B (en) Page test method and device, electronic equipment and storage medium
US11196728B1 (en) Caching login sessions to access a software testing environment
CN113467780A (en) Data acquisition method and device, electronic equipment and storage medium
CN116627849B (en) System test method, device, equipment and storage medium
CN116700778B (en) Interface difference analysis method, device, storage medium and apparatus
CN116627851B (en) Interface testing method and device
CN112650689A (en) Test method, test device, electronic equipment and storage medium
CN112612706A (en) Automated testing method, computer device and storage medium
CN113114794A (en) Method and device for processing domain name based on secondary proxy
CN112699034A (en) Virtual login user construction method, device, equipment and storage medium
CN109951549B (en) Network page access method and device and computer readable storage medium
CN114885365B (en) Business rule detection method and device, electronic equipment and storage medium
CN111131436B (en) Method and device for quickly searching proxy and readable storage medium
CN112182083A (en) File generation method, device, equipment and storage medium
CN112000313A (en) Request response method, device, equipment and storage medium
CN114338240B (en) Vulnerability scanning method and device
CN113687965B (en) Data interaction method, device, equipment and storage medium
CN117632445B (en) Request processing method and device, task execution method and device
CN116132534B (en) Method, device, equipment and storage medium for storing service request
US11734165B1 (en) Automated verification of visual user interface changes in software applications
CN115914049A (en) Test method, device, system, electronic equipment and readable storage medium
CN112019558A (en) Universal baffle testing method, device, equipment and computer storage medium

Legal Events

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