CN115834435A - Interface test method and device, storage medium and electronic device - Google Patents

Interface test method and device, storage medium and electronic device Download PDF

Info

Publication number
CN115834435A
CN115834435A CN202211203451.6A CN202211203451A CN115834435A CN 115834435 A CN115834435 A CN 115834435A CN 202211203451 A CN202211203451 A CN 202211203451A CN 115834435 A CN115834435 A CN 115834435A
Authority
CN
China
Prior art keywords
interface
test
group
interfaces
connectivity
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211203451.6A
Other languages
Chinese (zh)
Inventor
庞晓雷
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Qingdao Haier Technology Co Ltd
Haier Smart Home Co Ltd
Haier Uplus Intelligent Technology Beijing Co Ltd
Original Assignee
Qingdao Haier Technology Co Ltd
Haier Smart Home Co Ltd
Haier Uplus Intelligent Technology Beijing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Qingdao Haier Technology Co Ltd, Haier Smart Home Co Ltd, Haier Uplus Intelligent Technology Beijing Co Ltd filed Critical Qingdao Haier Technology Co Ltd
Priority to CN202211203451.6A priority Critical patent/CN115834435A/en
Publication of CN115834435A publication Critical patent/CN115834435A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application discloses an interface testing method and device, a storage medium and an electronic device, and relates to the technical field of smart homes, wherein the interface testing method comprises the following steps: before a service function test is carried out on a group of interfaces through a test case, analyzing the test case to determine a group of interface data from the test case, wherein each interface data in the group of interface data corresponds to each interface in the group of interfaces one to one; and performing connectivity test on the set of interfaces according to the set of interface data. By adopting the technical scheme, the problem that when the existing automatic test directly carries out the service function test and results in test error reporting, the error reporting reason needs to be analyzed in detail is solved.

Description

Interface test method and device, storage medium and electronic device
Technical Field
The application relates to the technical field of smart homes, in particular to an interface testing method and device, a storage medium and an electronic device.
Background
With the rapid development of the society, more and more application programs appear, before the application programs are online, the application programs are often required to be tested in order to verify the reliability of the application programs, but in the existing automatic testing process, testers write test cases to perform service function tests of interfaces, when the real parameter information of the interfaces is inconsistent with the data provided for the testers, a large number of test cases can be reported by mistake, and the testers need to check the report information to further analyze the reasons.
Aiming at the problem that in the related art, when the existing automatic test directly carries out the service function test and causes the test error report, the error report reason needs to be analyzed in detail, and an effective solution is not provided at present.
Accordingly, there is a need for improvement in the related art to overcome the disadvantages of the related art.
Disclosure of Invention
The embodiment of the invention provides an interface testing method and device, a storage medium and an electronic device, which at least solve the problem that when the existing automatic test directly performs a service function test and causes a test error, the error reason needs to be analyzed in detail.
According to an aspect of an embodiment of the present invention, there is provided an interface testing method, including: before a service function test is carried out on a group of interfaces through a test case, analyzing the test case to determine a group of interface data from the test case, wherein each interface data in the group of interface data corresponds to each interface in the group of interfaces one to one; and performing connectivity test on a group of interfaces according to the group of interface data.
In an exemplary embodiment, performing connectivity testing on a set of interfaces based on the set of interface data includes: determining a group of network services corresponding to the group of interfaces according to the group of interface data; testing service connectivity for each network service in the set of network services.
In an exemplary embodiment, determining a set of network services corresponding to the set of interfaces according to the set of interface data includes: determining an Internet Protocol (IP) address and a port number corresponding to each interface in the group of interfaces according to the group of interface data; and determining the group of network services according to the IP address and the port number corresponding to each interface.
In an exemplary embodiment, performing connectivity testing on a set of interfaces based on the set of interface data includes: determining interface data corresponding to each interface in the group of interfaces according to the group of interface data, wherein the interface data comprises: IP address, port number, uniform resource locator URL, request mode, protocol; and performing interface connectivity test on each interface according to the interface data of each interface.
In an exemplary embodiment, before performing the interface connectivity test on each interface according to the interface data of each interface, the method further includes: determining the network service corresponding to each interface according to the interface data corresponding to each interface; testing the service connectivity of the network service corresponding to each interface; performing an interface connectivity test on each interface according to the interface data of each interface, including: and under the condition that the service connectivity test of the network service corresponding to each interface passes, performing an interface connectivity test on each interface according to the interface data of each interface.
In an exemplary embodiment, after performing connectivity tests on a set of interfaces according to the set of interface data, the method further comprises: under the condition that the connectivity test of the group of interfaces passes, performing service function test on the group of interfaces through the test case to obtain a test result; and under the condition that the test result is in error, determining that each interface in the group of interfaces has no connectivity error, and indicating that business logic errors corresponding to one or more interfaces exist in the group of interfaces.
In an exemplary embodiment, parsing the test case includes: prompting a target object to perform connectivity test, and analyzing the test case in response to a test instruction of the target object under the condition of acquiring the test instruction; or analyzing the test case under the condition of acquiring the test case.
According to another aspect of the embodiments of the present invention, there is also provided an interface testing apparatus, including: the device comprises a determining module, a judging module and a judging module, wherein the determining module is used for analyzing a test case to determine a group of interface data from the test case before the service function test is carried out on a group of interfaces through the test case, and each interface data in the group of interface data corresponds to each interface in the group of interfaces one to one; and the testing module is used for carrying out connectivity test on the group of interfaces according to the group of interface data.
In an exemplary embodiment, the test module is further configured to determine, according to the set of interface data, a set of network services corresponding to the set of interfaces; testing service connectivity for each network service in the set of network services.
In an exemplary embodiment, the testing module is further configured to determine, according to the set of interface data, an internet protocol IP address and a port number corresponding to each interface in the set of interfaces; and determining the group of network services according to the IP address and the port number corresponding to each interface.
In an exemplary embodiment, the test module is further configured to determine, according to the set of interface data, interface data corresponding to each interface in the set of interfaces, where the interface data includes: IP address, port number, uniform resource locator URL, request mode, protocol; and performing interface connectivity test on each interface according to the interface data of each interface.
In an exemplary embodiment, the testing module is further configured to determine, before performing an interface connectivity test on each interface according to the interface data of each interface, a network service corresponding to each interface according to the interface data corresponding to each interface; testing the service connectivity of the network service corresponding to each interface; and the testing module is further used for performing interface connectivity test on each interface according to the interface data of each interface under the condition that the service connectivity test of the network service corresponding to each interface passes.
In an exemplary embodiment, the test module is further configured to, after performing connectivity test on a group of interfaces according to the group of interface data, perform a service function test on the group of interfaces through a test case when the connectivity test of the group of interfaces passes, so as to obtain a test result; and under the condition that the test result is in error, determining that each interface in the group of interfaces has no connectivity error, and indicating that business logic errors corresponding to one or more interfaces exist in the group of interfaces.
In an exemplary embodiment, the determining module is further configured to prompt a target object to perform connectivity test, and analyze the test case in response to a test instruction of the target object when the test instruction is obtained; or analyzing the test case under the condition of acquiring the test case.
According to another aspect of the embodiments of the present invention, there is also provided a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the above interface testing method when running.
According to another aspect of the embodiments of the present invention, there is also provided an electronic apparatus, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the interface testing method through the computer program.
According to the invention, before the service function test is carried out on a group of interfaces through the test case, the test case is analyzed so as to determine a group of interface data from the test case, and the connectivity test is carried out on the group of interfaces according to the group of interface data. That is to say, before a group of interfaces are subjected to a service function test, connectivity is performed on the group of interfaces in advance, so that a fault report of the service function test due to the problem of interface connectivity can be avoided, the fault report of the service function test can only be due to a service logic fault of the interfaces, and the problem that when the service function test is directly performed by the existing automatic test, the fault report reason needs to be analyzed in detail is solved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application.
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious for those skilled in the art to obtain other drawings without inventive labor.
FIG. 1 is a schematic diagram of a hardware environment of an interface testing method according to an embodiment of the present application;
FIG. 2 is a flow chart of a method of interface testing according to an embodiment of the invention;
FIG. 3 is a schematic diagram of interface information definition according to an embodiment of the present invention;
FIG. 4 is a schematic flow diagram of a prior art automated test;
FIG. 5 is a schematic flow diagram of automated testing according to an embodiment of the present invention;
FIG. 6 is a test staging schematic for automated testing according to an embodiment of the present invention;
FIG. 7 is a schematic diagram of a service connectivity test according to an embodiment of the present invention;
FIG. 8 is a schematic diagram of an interface connectivity test according to an embodiment of the present invention;
fig. 9 is a block diagram of an interface test apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only partial embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of this application and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
According to one aspect of the embodiments of the present application, there is provided an interface testing method. The interface testing method is widely applied to full-house intelligent digital control application scenes such as Smart homes (Smart Home), intelligent homes, intelligent household equipment ecology, intelligent house (Intellignee House) ecology and the like. Alternatively, in this embodiment, the interface testing method may be applied to a hardware environment formed by the terminal device 102 and the server 104 as shown in fig. 1. As shown in fig. 1, the server 104 is connected to the terminal device 102 through a network, and may be configured to provide a service (e.g., an application service) for the terminal or a client installed on the terminal, set a database on the server or independent of the server, and provide a data storage service for the server 104, and configure a cloud computing and/or edge computing service on the server or independent of the server, and provide a data operation service for the server 104.
The network may include, but is not limited to, at least one of: wired networks, wireless networks. The wired network may include, but is not limited to, at least one of: wide area networks, metropolitan area networks, local area networks, which may include, but are not limited to, at least one of the following: WIFI (Wireless Fidelity), bluetooth. Terminal equipment 102 can be and not be limited to PC, the cell-phone, the panel computer, intelligent air conditioner, intelligent cigarette machine, intelligent refrigerator, intelligent oven, intelligent kitchen range, intelligent washing machine, intelligent water heater, intelligent washing equipment, intelligent dish washer, intelligent projection equipment, the intelligent TV, intelligent clothes hanger, intelligent (window) curtain, intelligence audio-visual, smart jack, intelligent stereo set, intelligent audio amplifier, intelligent new trend equipment, intelligent kitchen guarding's equipment, intelligent bathroom equipment, the intelligence robot of sweeping the floor, the intelligence robot of wiping the window, intelligence robot of mopping the floor, intelligent air purification equipment, intelligent steam ager, intelligent microwave oven, intelligent kitchen guarding, intelligent clarifier, intelligent water dispenser, intelligent lock etc..
In order to solve the above problem, in this embodiment, an interface testing method is provided, including but not limited to being applied in an automated testing script, and fig. 2 is a flowchart of an interface testing method according to an embodiment of the present invention, where the flowchart includes the following steps:
step S202, before a service function test is carried out on a group of interfaces through a test case, the test case is analyzed so as to determine a group of interface data from the test case, wherein each interface data in the group of interface data corresponds to each interface in the group of interfaces one to one;
it should be noted that, the service function test is to test whether the service function required to be completed by the interface is in accordance with the expectation, for example, in the case that the service function of an interface is to calculate the average temperature in a future period, the performance of the interface is tested through the service function test.
Fig. 3 is a schematic diagram illustrating interface information definition according to an embodiment of the present invention, and as shown in fig. 3, when defining an interface, a Uniform Resource Identifier (Uniform Resource Identifier, abbreviated as URI) and other related parameters need to be defined. The URI includes a Uniform Resource Locator (URL), a server Internet Protocol (IP) address and a port.
That is, the interface data for each interface includes, but is not limited to: a URI and a parameter. Wherein the URI comprises: URL, server IP address and port number.
And step S204, performing connectivity test on a group of interfaces according to the group of interface data.
That is, in the present embodiment, the automated test includes: service function test and connectivity test.
It should be noted that the connectivity test is to test the connectivity of the interface (e.g. whether the service is normally accessible or not, and whether the interface is normally accessible or not), and the connectivity test includes: service connectivity test, interface connectivity test.
The service connectivity test is to test whether the domain name or the IP port of the network service can be normally accessed; for example, when an interface needs weather data, the weather service needs to be accessed through an IP address and a port corresponding to the weather service to obtain the weather data, and the service connectivity test for the interface is to test whether the interface can normally access the weather service (specifically, the weather service is tested through the IP port corresponding to the weather service). The interface connectivity test is to test whether the interface can be accessed normally.
It should be noted that, in the case that the test for the interface connectivity of an interface passes, the service connectivity of the interface also necessarily passes, but in the case that the test for the service connectivity of an interface passes, the interface connectivity of the interface does not necessarily pass.
In an exemplary embodiment, before a service function test is performed on a group of interfaces through a test case, a target object is prompted to perform a connectivity test, and the test case is analyzed in response to a test instruction of the target object under the condition that the test instruction of the target object is obtained; or analyzing the test case under the condition of acquiring the test case.
That is to say, in the embodiment of the application, after the case writing is completed, the user is actively prompted to perform the connectivity test, and then the user manually judges whether to perform the service connectivity test and the interface connectivity test in advance, so that repeated work in the test process is reduced, and the test efficiency is improved. In addition, the user can be allowed to set that the connectivity test is automatically executed by default each time, and the testing efficiency is further improved.
Through the steps, before the service function test is carried out on the group of interfaces through the test case, the test case is analyzed so as to determine the group of interface data from the test case, and the connectivity test is carried out on the group of interfaces according to the group of interface data. That is to say, before a group of interfaces are subjected to a service function test, connectivity is performed on the group of interfaces in advance, so that a fault report of the service function test due to the problem of interface connectivity can be avoided, the fault report of the service function test can only be due to a service logic fault of the interfaces, and the problem that when the service function test is directly performed by the existing automatic test, the fault report reason needs to be analyzed in detail is solved.
That is to say, in this embodiment, during the automated test, the service connectivity test or the interface connectivity test is performed in advance, and the service connectivity problem or the interface connectivity problem is found in advance, so that when the service function test fails due to the connectivity problem, a tester analyzes the problem and executes cases for multiple times, and the test efficiency is improved.
In an exemplary embodiment, a service connectivity test may be performed on a set of interfaces according to a set of interface data, and step S204 may be implemented by the following steps S11 to S12:
step S11: determining a group of network services corresponding to the group of interfaces according to the group of interface data;
in an exemplary embodiment, the step S11 may be implemented as follows: determining an Internet Protocol (IP) address and a port number corresponding to each interface in the group of interfaces according to the group of interface data; and determining the group of network services according to the IP address and the port number corresponding to each interface.
It should be noted that the web service refers to a service-oriented software module based on a distributed program that runs on a network. In this embodiment, a combination of an IP address and a port number is equivalent to a network service, and each interface has a corresponding network service, that is, the IP address and the port number are defined, and each interface corresponds to one network service. In a group of interfaces of the test case, the IP addresses and port numbers corresponding to different interfaces may be the same (i.e., the network services are the same), and further, in order to avoid repeated service connectivity tests, a group of network services is determined according to the IP address and the port number corresponding to each interface in the group of interfaces, where two identical network services do not exist in the group of network services.
Step S12: testing service connectivity for each network service in the set of network services.
For example, as shown in fig. 7, when a group of interfaces corresponding to a test case corresponds to two services, service connectivity tests may be performed on the two services through telnet commands, and test results are collected. The test results show that the test passed or failed.
In the embodiment, the service connectivity problem of the interface can be found in advance by performing the service connectivity test on the interface, so that the interface error report caused by the service connectivity problem can be avoided, and the subsequent test efficiency is improved.
In an exemplary embodiment, the interface connectivity test may be performed on a set of interfaces according to a set of interface data, and performing step S204 described above may be implemented by steps S21-S22 as follows:
step S21: determining interface data corresponding to each interface in the group of interfaces according to the group of interface data, wherein the interface data comprises: IP address, port number, uniform resource locator URL, request mode, protocol;
the above protocol is a network communication protocol used by the interface.
Step S22: and performing interface connectivity test on each interface according to the interface data of each interface.
Illustratively, the interface connectivity of the interface may be tested via a curl command to determine if it is normally accessible. It should be noted that, when the state code obtained by the test result is 200, the interface connectivity test is successful, and when the state code obtained by the test result is 405, the interface connectivity test is failed.
In the embodiment, the interface connectivity problem of the interface can be found in advance by performing the interface connectivity test on the interface, so that the interface error report caused by the interface connectivity problem can be avoided, and the subsequent test efficiency is improved.
In an exemplary embodiment, before performing step S22, the network service corresponding to each interface may also be determined according to the interface data corresponding to each interface; testing the service connectivity of the network service corresponding to each interface; and under the condition that the service connectivity test of the network service corresponding to each interface in a group of interfaces passes, performing the interface connectivity test on each interface according to the interface data of each interface.
It should be noted that, when the connectivity test of an interface fails, the interface connectivity test of the interface also inevitably fails. The failure of the interface connectivity test of the interface does not necessarily lead to the failure of the service connectivity test, but the service connectivity test can be performed in advance before the interface connectivity test is performed, so that the service connectivity problem of the interface is eliminated under the condition of the failure of the interface connectivity test. In addition, because the network services used by the plurality of interfaces may be the same in a group of interfaces corresponding to the test case, if the network services are not communicated, the plurality of interfaces report errors simultaneously, and further, the reasons for error reporting need to be analyzed one by one, which wastes time, the service connectivity test can be performed in advance before the interface connectivity test is performed, thereby improving the test efficiency.
In an exemplary embodiment, after performing connectivity test on a group of interfaces according to the group of interface data, if the connectivity test of the group of interfaces passes, performing service function test on the group of interfaces through a test case to obtain a test result; and under the condition that the test result is in error, determining that each interface in the group of interfaces has no connectivity error, and indicating that business logic errors corresponding to one or more interfaces exist in the group of interfaces.
It should be noted that, after the service function test is performed, if the test result is reported incorrectly, the connectivity problem of the interface may be possible or not. Furthermore, after the connectivity test is performed in advance, the service function test error caused by the connectivity problem can be eliminated, and the test efficiency is improved.
It should be noted that, if only the service connectivity test is performed before the service function test is performed, the error of the service function test due to the service connectivity problem of the interface can only be eliminated. Only before the service function test, the interface connectivity test is carried out, so that the error report of the service function test which is not caused by the interface connectivity problem can be eliminated.
In an exemplary embodiment, during testing, multiple functions may be tested, that is, multiple test cases may be used for testing, and in the multiple test cases, a repetitive interface may be used (that is, one interface may appear in the multiple test cases), so as to perform connectivity testing on the interface in advance, thereby avoiding that multiple test cases report errors simultaneously due to the connectivity problem of the interface.
It is to be understood that the above-described embodiments are only a few, but not all, embodiments of the present invention. For better understanding of the above method, the following describes the above process with reference to an embodiment, but the method is not limited to the technical solution of the embodiment of the present invention, and specifically:
fig. 4 is a schematic flow chart of an existing automation test, specifically, the existing automation test directly performs a functional test or a business test (equivalent to the business function test in the above embodiment), and further when an IP address of a real service and a URI (including an IP address, a port number, and a uniform resource locator URL) of a port or an interface (equivalent to the request method in the above embodiment) are inconsistent with a method and a network communication protocol of the interface and data provided to a tester, a large number of test cases may be reported by mistake, and the tester needs to check error information. The reason of error reporting is analyzed, so that the testing efficiency is low.
Furthermore, the embodiment of the application can carry out service connectivity test and interface connectivity test in advance, find the service connectivity problem and the interface connectivity problem in advance, avoid repeated labor of testing personnel caused by the service connectivity problem and the interface connectivity problem when the service function test is wrong, and improve the testing efficiency.
For example, fig. 5 is a schematic flow chart of an automated test according to an embodiment of the present invention, after a case is written, a user may control the service connectivity test or the interface connectivity test by himself or herself, or may set the default to automatically execute the connectivity test, so that the service function test may be performed only after the connectivity test is passed.
Fig. 6 is a schematic diagram illustrating test phase division of an automation test according to an embodiment of the present invention, that is, the automation test is divided into a service connectivity test, an interface connectivity test, and a service function test according to the embodiment of the present application.
(1) Service connectivity testing
In the embodiment of the application, an independent service connectivity test is provided, an IP address and a port number defined by a user are collected (local definition in a use case + common definition with exception), a connectivity test is performed through a telnet command, and a test result is collected. The test result is returned to the page, and the test result shows the access pass/fail, as shown in fig. 7.
(2) Interface connectivity testing
In the embodiment of the application, an independent interface connectivity test is provided, and an IP address, a port number, a URL, a request mode method and a protocol of an interface in a use case are collected. And testing whether the interface can be normally accessed through a curl command. As shown in FIG. 8, where HTTP/1.1 is followed by a status code, status code 200 indicates success. Others indicate failure. That is to say, when the state code obtained by the test result is 200, the interface connectivity test is successful, and when the state code obtained by the test result is 405, the interface connectivity test is failed.
That is to say, the embodiment of the application improves the automatic test, so that the automatic test comprises a service connectivity test, an interface connectivity test and a service function test. And further, whether service connectivity test and interface connectivity test are performed in advance can be judged, repeated work in the test process is reduced, and test efficiency is improved.
Through the description of the foregoing embodiments, it is clear to those skilled in the art that the method according to the foregoing embodiments may be implemented by software plus a necessary general hardware platform, and certainly may also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (such as a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
In this embodiment, an interface testing apparatus is further provided, and the apparatus is used to implement the foregoing embodiments and preferred embodiments, and the description of the apparatus is omitted for brevity. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementations in hardware or a combination of software and hardware are also possible and contemplated.
Fig. 9 is a block diagram of an interface test apparatus according to an embodiment of the present invention, the apparatus including:
a determining module 92, configured to parse a test case to determine a set of interface data from the test case before performing a service function test on a set of interfaces through the test case, where each interface data in the set of interface data corresponds to each interface in the set of interfaces one to one;
a testing module 94, configured to perform connectivity testing on a set of interfaces according to the set of interface data.
By the device, before the service function test is carried out on the group of interfaces through the test case, the test case is analyzed so as to determine the group of interface data from the test case, and the connectivity test is carried out on the group of interfaces according to the group of interface data. That is to say, before a group of interfaces are subjected to a service function test, connectivity is performed on the group of interfaces in advance, so that a fault report of the service function test due to the problem of interface connectivity can be avoided, the fault report of the service function test can only be due to a service logic fault of the interfaces, and the problem that when the service function test is directly performed by the existing automatic test, the fault report reason needs to be analyzed in detail is solved.
In an exemplary embodiment, the testing module 94 is further configured to determine a set of network services corresponding to the set of interfaces according to the set of interface data; testing service connectivity for each network service in the set of network services.
In an exemplary embodiment, the testing module 94 is further configured to determine, according to the set of interface data, an internet protocol IP address and a port number corresponding to each interface in the set of interfaces; and determining the group of network services according to the IP address and the port number corresponding to each interface.
In an exemplary embodiment, the testing module 94 is further configured to determine interface data corresponding to each interface in the set of interfaces according to the set of interface data, where the interface data includes: IP address, port number, uniform resource locator URL, request mode, protocol; and performing interface connectivity test on each interface according to the interface data of each interface.
In an exemplary embodiment, the testing module 94 is further configured to determine, before performing the interface connectivity test on each interface according to the interface data of each interface, a network service corresponding to each interface according to the interface data corresponding to each interface; testing the service connectivity of the network service corresponding to each interface; and the testing module is further used for performing interface connectivity test on each interface according to the interface data of each interface under the condition that the service connectivity test of the network service corresponding to each interface passes.
In an exemplary embodiment, the testing module 94 is further configured to, after performing connectivity test on a group of interfaces according to the group of interface data, perform a service function test on the group of interfaces through a test case when the connectivity test of the group of interfaces passes, so as to obtain a test result; and under the condition that the test result is in error, determining that each interface in the group of interfaces has no connectivity error, and indicating that business logic errors corresponding to one or more interfaces exist in the group of interfaces.
In an exemplary embodiment, the determining module 92 is further configured to prompt a target object to perform a connectivity test, and analyze the test case in response to a test instruction of the target object when the test instruction is obtained; or analyzing the test case under the condition of acquiring the test case.
An embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to perform the steps in any of the above method embodiments when executed.
Alternatively, in the present embodiment, the storage medium may be configured to store a computer program for executing the steps of:
s1, before a service function test is carried out on a group of interfaces through a test case, the test case is analyzed to determine a group of interface data from the test case, wherein each interface data in the group of interface data corresponds to each interface in the group of interfaces one to one;
and S2, performing connectivity test on the group of interfaces according to the group of interface data.
In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to: various media capable of storing computer programs, such as a usb disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk.
For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary embodiments, and details of this embodiment are not repeated herein.
Embodiments of the present invention also provide an electronic device comprising a memory having a computer program stored therein and a processor arranged to run the computer program to perform the steps of any of the above method embodiments.
Optionally, in this embodiment, the processor may be configured to execute the following steps by a computer program:
s1, before a service function test is carried out on a group of interfaces through a test case, the test case is analyzed to determine a group of interface data from the test case, wherein each interface data in the group of interface data corresponds to each interface in the group of interfaces one to one;
and S2, performing connectivity test on the group of interfaces according to the group of interface data.
In an exemplary embodiment, the electronic apparatus may further include a transmission device and an input/output device, wherein the transmission device is connected to the processor, and the input/output device is connected to the processor.
For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary embodiments, and details of this embodiment are not repeated herein.
It will be apparent to those skilled in the art that the various modules or steps of the invention described above may be implemented using a general purpose computing device, they may be centralized on a single computing device or distributed across a network of computing devices, and they may be implemented using program code executable by the computing devices, such that they may be stored in a memory device and executed by the computing device, and in some cases, the steps shown or described may be performed in an order different than that described herein, or they may be separately fabricated into various integrated circuit modules, or multiple ones of them may be fabricated into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
The foregoing is only a preferred embodiment of the present application and it should be noted that those skilled in the art can make several improvements and modifications without departing from the principle of the present application, and these improvements and modifications should also be considered as the protection scope of the present application.

Claims (10)

1. An interface testing method, comprising:
before a service function test is carried out on a group of interfaces through a test case, analyzing the test case to determine a group of interface data from the test case, wherein each interface data in the group of interface data corresponds to each interface in the group of interfaces one to one;
and performing connectivity test on the set of interfaces according to the set of interface data.
2. The method of claim 1, wherein performing connectivity testing on a set of interfaces based on the set of interface data comprises:
determining a group of network services corresponding to the group of interfaces according to the group of interface data;
testing service connectivity for each network service in the set of network services.
3. The method of claim 2, wherein determining a set of network services corresponding to the set of interfaces according to the set of interface data comprises:
determining an Internet Protocol (IP) address and a port number corresponding to each interface in the group of interfaces according to the group of interface data;
and determining the group of network services according to the IP address and the port number corresponding to each interface.
4. The method of claim 1, wherein performing connectivity testing on a set of interfaces based on the set of interface data comprises:
determining interface data corresponding to each interface in the group of interfaces according to the group of interface data, wherein the interface data comprises: IP address, port number, uniform resource locator URL, request mode, protocol;
and performing interface connectivity test on each interface according to the interface data of each interface.
5. The method of claim 4,
before performing an interface connectivity test on each interface according to the interface data of each interface, the method further includes:
determining the network service corresponding to each interface according to the interface data corresponding to each interface;
testing the service connectivity of the network service corresponding to each interface;
performing an interface connectivity test on each interface according to the interface data of each interface, including:
and under the condition that the service connectivity test of the network service corresponding to each interface passes, performing interface connectivity test on each interface according to the interface data of each interface.
6. The method of claim 1, wherein after performing connectivity testing on a set of interfaces based on the set of interface data, the method further comprises:
under the condition that the connectivity test of the group of interfaces passes, performing service function test on the group of interfaces through the test case to obtain a test result;
and under the condition that the test result is in error, determining that each interface in the group of interfaces has no connectivity error, and indicating that business logic errors corresponding to one or more interfaces exist in the group of interfaces.
7. The method of claim 1, wherein parsing the test case comprises:
prompting a target object to perform connectivity test, and analyzing the test case in response to a test instruction of the target object under the condition of acquiring the test instruction; or
And analyzing the test case under the condition of acquiring the test case.
8. An interface testing apparatus, comprising:
the device comprises a determining module, a judging module and a judging module, wherein the determining module is used for analyzing a test case to determine a group of interface data from the test case before the service function test is carried out on a group of interfaces through the test case, and each interface data in the group of interface data corresponds to each interface in the group of interfaces one to one;
and the testing module is used for carrying out connectivity test on the group of interfaces according to the group of interface data.
9. A computer-readable storage medium, comprising a stored program, wherein the program when executed performs the method of any of claims 1 to 7.
10. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to execute the method of any of claims 1 to 7 by means of the computer program.
CN202211203451.6A 2022-09-29 2022-09-29 Interface test method and device, storage medium and electronic device Pending CN115834435A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211203451.6A CN115834435A (en) 2022-09-29 2022-09-29 Interface test method and device, storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211203451.6A CN115834435A (en) 2022-09-29 2022-09-29 Interface test method and device, storage medium and electronic device

Publications (1)

Publication Number Publication Date
CN115834435A true CN115834435A (en) 2023-03-21

Family

ID=85524226

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211203451.6A Pending CN115834435A (en) 2022-09-29 2022-09-29 Interface test method and device, storage medium and electronic device

Country Status (1)

Country Link
CN (1) CN115834435A (en)

Similar Documents

Publication Publication Date Title
CN109995614B (en) Alpha testing method and device
CN112835802A (en) Equipment testing method, device, equipment and storage medium
CN109802842A (en) The generation method and relevant device of applied topology
CN113794602A (en) Equipment testing method and device, terminal equipment and storage medium
CN112019405B (en) Automatic testing method and system
CN115934523A (en) Target test data generation method and device, storage medium and electronic device
CN109787865B (en) Method, system, switch and storage medium for verifying upgrading condition
CN115834435A (en) Interface test method and device, storage medium and electronic device
CN115454851A (en) Interface regression testing method and device, storage medium and electronic device
CN115687806A (en) Method and device for determining target equipment list, storage medium and electronic device
CN112650666B (en) Software testing system, method, device, control equipment and storage medium
CN115878448A (en) Database test method, distributed database and storage medium
US9490995B1 (en) Simulation system for network devices in a network
CN115629961A (en) Method and device for determining debugging result, storage medium and electronic device
CN115865650A (en) Service deployment method and device, storage medium and electronic device
CN114760235B (en) Method and device for executing dial testing task, storage medium and electronic device
CN115695233B (en) Link testing device, method, electronic equipment and computer program product
CN113094281B (en) Test method and device for hybrid App
CN115357446A (en) Device testing method and device, storage medium and electronic device
CN115733879A (en) Target page pushing method and device, storage medium and electronic device
CN114999494A (en) Voice interaction function testing method and device, storage medium and electronic device
CN115827102A (en) Interface calling method and device, storage medium and electronic device
CN115460117A (en) Device testing method and apparatus, storage medium, and electronic apparatus
CN115297096A (en) Resource package deployment method and device, storage medium and electronic device
CN115358296A (en) Log clustering method and device, storage medium and electronic device

Legal Events

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