Interface testing method, device, equipment and computer readable storage medium
By pre-storing simulation services of multiple interfaces in the simulation service database and using custom group names, the problem of difficulty in intrusion and maintenance of RPC protocol interface simulation operation code is solved, and the interface testing method for low-code intrusion and simplified maintenance is realized.
Patent Information
- Application Number
- CN202011012115.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-23
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2040-09-23
AI Technical Summary
The existing RPC protocol-based interface simulation operation code has a high degree of intrusion and is difficult to maintain. The existing technology requires the writing of implementation classes for each interface that needs to be simulated, and it is difficult for testers or developers to maintain.
Provide an interface testing method, by storing simulation services corresponding to multiple interfaces in the simulation service database in advance, each simulation service has a user-set custom group name. When calling the simulation service, only the corresponding interfaces in the code are required. Modify the group name to realize the call operation of the simulated service, without the need to write the simulated service in the code.
It reduces the degree of code intrusion and simplifies the maintenance operation of simulation services, allowing testers or developers to complete maintenance by simply modifying in the simulation service database, improving testing efficiency.
Smart Images

Figure CN113760707B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computers, and in particular to an interface testing method, device, equipment, and computer-readable storage medium. Background Art
[0002] In the process of software interface testing, we often encounter situations such as unstable test environment, undeveloped interface, simulation of certain specific data response return, and complex dependencies of the service to be tested. When the above situations occur, it is impossible to use real services for software interface testing. It is necessary to simulate the interface and perform software interface testing based on the simulated service. However, the existing simulation operation (Mock) technology is only for HTTP protocol and does not support Remote Procedure Call Protocol (RPC protocol).
[0003] In order to solve the above technical problems, the prior art generally uses the Mock function of the existing open source framework, performs parameter configuration to turn on the Mock switch, and writes an implementation class for each Mock interface.
[0004] However, when the above method is used to perform interface simulation operations, the code invasion degree is high. In addition, it is necessary to write an implementation class for each interface that needs to be simulated, which is difficult for testers or developers to maintain. Summary of the invention
[0005] The present invention provides an interface testing method, device, equipment and computer-readable storage medium, which are used to solve the technical problems that the existing interface simulation operation code based on the RPC protocol has a high degree of intrusion and is difficult to maintain.
[0006] A first aspect of the present disclosure is to provide an interface testing method, comprising:
[0007] Obtaining a test request sent by a client, wherein the test request includes at least one identifier of an interface to be edited;
[0008] According to the test request, determining the target group name corresponding to the interface identifier to be edited in a preset group name mapping table, wherein each interface identifier and the corresponding custom group name are stored in association with each other in the group name mapping table;
[0009] According to the target group name in the interface to be edited, calling the RPC protocol-based simulation service corresponding to the target group name from a preset simulation service database;
[0010] An interface test operation is performed according to the simulated service corresponding to the target group name.
[0011] A second aspect of the present disclosure is to provide an interface testing device, comprising:
[0012] A first acquisition module, configured to acquire a test request sent by a client, wherein the test request includes at least one identifier of an interface to be edited;
[0013] A determination module, configured to determine, according to the test request, a target group name corresponding to the interface identifier to be edited in a preset group name mapping table, wherein each interface identifier and a corresponding custom group name are stored in association with each other in the group name mapping table;
[0014] A first calling module is used to call a simulation service based on the RPC protocol corresponding to the target group name in the interface to be edited from a preset simulation service database;
[0015] The test module is used to perform interface test operations according to the simulated service corresponding to the target group name.
[0016] A third aspect of the present disclosure is to provide an interface testing device, comprising: a memory, a processor;
[0017] Memory; Memory for storing instructions executable by the processor;
[0018] The processor is used to call the program instructions in the memory to execute the interface testing method as described in the first aspect.
[0019] A fourth aspect of the present disclosure is to provide a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the interface testing method as described in the first aspect.
[0020] The interface testing method, apparatus, device and computer-readable storage medium provided by the present disclosure store simulation services corresponding to multiple interfaces in a simulation service database in advance, and each simulation service corresponds to a custom group name set by the user. Therefore, when calling a simulation service, it is only necessary to modify the group name corresponding to the interface in the code to implement the calling operation of the simulation service. There is no need to write a simulation service for each interface in the code. Therefore, the degree of code intrusion is not high. Moreover, when the simulation service needs to be modified, it is only necessary to modify the simulation service in the simulation service database, and the maintenance operation of the simulation service by the tester or developer is relatively simple. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present disclosure, and a person skilled in the art can also obtain other drawings based on these drawings.
[0022] Figure 1 A schematic diagram of the network architecture on which the present disclosure is based;
[0023] Figure 2 A flowchart of an interface testing method provided in Embodiment 1 of the present disclosure;
[0024] Figure 3 A flowchart of an interface testing method provided in Embodiment 2 of the present disclosure;
[0025] Figure 4 A schematic diagram of a display interface provided in an embodiment of the present disclosure;
[0026] Figure 5 A flowchart of an interface testing method provided in Embodiment 3 of the present disclosure;
[0027] Figure 6 A schematic diagram of the structure of an interface testing device provided in Embodiment 4 of the present disclosure;
[0028] Figure 7 A schematic diagram of the structure of an interface testing device provided in Embodiment 5 of the present disclosure;
[0029] Figure 8 This is a structural diagram of the interface testing equipment provided in Example 6 of the present disclosure. DETAILED DESCRIPTION
[0030] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all the embodiments. All other embodiments obtained based on the embodiments in the present disclosure belong to the scope of protection of the present disclosure.
[0031] In response to the above-mentioned technical problems that the existing interface simulation operation code based on the RPC protocol has a high degree of intrusion and is difficult to maintain, the present disclosure provides an interface testing method, device, equipment and computer-readable storage medium.
[0032] It should be noted that the interface testing method, apparatus, device and computer-readable storage medium provided by the present disclosure can be used in various Dubbo-based simulation operation scenarios.
[0033] In the process of interface testing, in order to realize the simulation operation based on the RPC protocol, the existing technology generally configures the parameters of the Mock function of the open source framework and adjusts the switch of the Mock function to the on state. For each interface that needs to use a simulation service for test operation, a simulation service is written. However, the above method often has a high degree of code intrusion and is difficult to maintain.
[0034] In the process of solving the above technical problems, the inventors found through research that in order to avoid writing simulation services during each interface test, a simulation service database can be established in advance. The simulation service database stores simulation services corresponding to multiple interfaces, and each simulation service corresponds to a custom group name set by the user. Therefore, when calling the simulation service, it is only necessary to modify the group name corresponding to the interface in the code to implement the call operation of the simulation service. There is no need to write simulation services for each interface in the code. Therefore, the code intrusion level is not high and the maintenance difficulty is not high.
[0035] Figure 1 This is a schematic diagram of the network architecture based on which the present disclosure is based. Figure 1 As shown, the network architecture based on the present disclosure at least includes: a server 11 and a server 2, wherein the server 1 is provided with a client, and the server 2 is provided with an interface test device. The interface test device 2 is written in a language such as C / C++, Java, Shell or Python. The client 1 is connected to the server 2 in communication, so that the client 1 can exchange information with the server 2.
[0036] Figure 2 A flowchart of the interface testing method provided in the first embodiment of the present disclosure is shown in FIG. Figure 2 As shown, the method includes:
[0037] Step 101: Obtain a test request sent by a client, wherein the test request includes at least one interface identifier to be edited.
[0038] The execution subject of this embodiment is an interface testing device, which can be coupled to a server. The server is connected to the server of the client for communication, so as to be able to exchange information with the client.
[0039] In this embodiment, when the tester needs to perform interface testing, a test request can be initiated on the client. Accordingly, the interface testing device can obtain the test request sent by the client, and the test request includes at least one interface identifier to be edited.
[0040] Step 102: According to the test request, determine the target group name corresponding to the interface identifier to be edited in a preset group name mapping table, wherein each interface identifier and the corresponding custom group name are stored in association with each other.
[0041] In actual applications, during the interface testing process, there may be problems such as the real service test environment corresponding to some interfaces is unstable, the interface is not fully developed, specific data responses are returned, or the environment that the real service relies on is relatively complex. In this case, the real service cannot be used for interface testing. Therefore, a mock service corresponding to the real service can be built through mock technology. Then, interface testing operations can be performed based on the mock service.
[0042] In order to avoid the need for maintenance personnel or testers to manually write simulation service implementation classes in code when building simulation services, a simulation service database can be built in advance. After completing the simulation operation of a real service, the simulation service corresponding to the real service can be published to the simulation service database for subsequent calls. The simulation service is a simulation service based on the RPC protocol.
[0043] Accordingly, the group name corresponding to the simulated service may be a user-defined group name, which is different from the group name of the real service. For example, the group name of the real service may be XXXXXA, and the corresponding user-defined group name of the simulated service may be XXXXXB.
[0044] In this embodiment, since the custom group name is different from the group name of the real service, in actual application, the target group name corresponding to the interface identifier to be edited can be determined in the preset group name mapping table according to the test request. By changing the group name, the call operation of the simulated service is realized.
[0045] As an implementable method, the user can manually modify the group name corresponding to each interface to be tested directly in the code according to actual needs.
[0046] Step 103: According to the target group name in the interface to be edited, call the RPC protocol-based simulation service corresponding to the target group name from a preset simulation service database.
[0047] In this implementation, after determining the target group name corresponding to the interface to be edited, the RPC protocol-based simulation service corresponding to the target group name may be called from a preset simulation service database.
[0048] Step 104: Perform an interface test operation according to the simulated service corresponding to the target group name.
[0049] In this embodiment, after obtaining the simulation service corresponding to the real service, the interface test operation can be performed according to the simulation service based on the RPC protocol.
[0050] The interface testing method provided in this embodiment stores simulation services corresponding to multiple interfaces in a simulation service database in advance, and each simulation service corresponds to a custom group name set by the user. Therefore, when calling a simulation service, it is only necessary to modify the group name corresponding to the interface in the code to implement the calling operation of the simulation service. There is no need to write a simulation service for each interface in the code. Therefore, the degree of code intrusion is not high. Moreover, when the simulation service needs to be modified, it is only necessary to modify the simulation service in the simulation service database, and the maintenance operation of the simulation service by the tester or developer is relatively simple.
[0051] Figure 3 This is a flow chart of the interface testing method provided in the second embodiment of the present disclosure, based on the first embodiment, as shown in FIG. Figure 3 As shown, before step 102, the following steps are also included:
[0052] Step 201: Obtain a simulation service creation request sent by a client, wherein the simulation service creation request includes multiple interface identifiers to be simulated.
[0053] Step 202: According to the simulation service creation request, obtain the resource package and dependency information corresponding to each interface to be simulated from a preset data server.
[0054] Step 203: construct a simulation service corresponding to each interface to be simulated according to the resource package and the dependency information.
[0055] Step 204: For each of the simulated services, obtain a custom group name sent by the client, wherein the custom group name is input by the user on the client.
[0056] Step 205: Send the simulation service and the custom group name corresponding to the simulation service to a preset simulation service database for storage.
[0057] In this embodiment, before obtaining a simulated service from a simulated service database and performing interface testing based on the simulated service, it is necessary to construct the simulated service database. Specifically, a simulated service creation request sent by a client may be obtained, wherein the simulated service creation request includes multiple interface identifiers to be simulated. The interface identifier to be simulated is an identifier of an interface that cannot be tested using a real service at present.
[0058] Furthermore, the resource package and dependency information corresponding to each interface to be simulated can be obtained from a preset data server according to the multiple interface identifiers to be simulated, and the simulated service corresponding to the real service to be called by each interface to be simulated is constructed according to the resource package and dependency information.
[0059] For each constructed simulation service, the user can set the group name of the simulation service according to actual needs. Specifically, the custom group name sent by the client can be obtained, and the custom group name is entered by the user on the client. It should be noted that the custom group name is different from the group name of the real service corresponding to the simulation service.
[0060] The simulation service and the custom group name corresponding to the simulation service are sent to a preset simulation service database for storage, thereby completing the construction operation of the simulation service database.
[0061] Specifically, the user can also perform management operations on the simulation services in the simulation service database through a preset console. Figure 4 A schematic diagram of a display interface provided by an embodiment of the present disclosure, such as Figure 4 As shown, the display interface can display all the simulation services in the current simulation service database, and the user can implement management operations on the simulation service through interface interaction. Among them, the management operations can specifically include adding simulation services, deleting simulation services, modifying simulation services, querying simulation services, etc.
[0062] Further, based on the first embodiment, after step 205, the following steps are further included:
[0063] Obtaining template information sent by the client, wherein the template information includes input parameter information and response information corresponding to the simulation service;
[0064] The template information is sent to a preset simulation service database for storage.
[0065] In this embodiment, for each constructed simulation service, the input parameter information and response information corresponding to the simulation service need to be set. During the interface test process, the performance of the interface can be determined based on the response information fed back by the virtual service called by the interface.
[0066] Specifically, the template information sent by the client can be obtained, wherein the template information includes the input parameter information and response information corresponding to the simulation service. The input parameter information and response information are set by the user on the client. The template information is sent to the preset simulation service database and stored in association with the corresponding simulation service. Therefore, the test operation of the interface can be implemented later according to the template information.
[0067] Further, based on the first embodiment, after step 205, the following steps are further included:
[0068] The group name mapping table is established according to the custom group name corresponding to the simulation service and the to-be-simulated interface identifier corresponding to the simulation service.
[0069] In this embodiment, after obtaining the custom group name sent by the client, a group name mapping table can be established according to the custom group name and the interface identifier to be simulated corresponding to the simulated service, so that the target group name can be determined according to the group name mapping table.
[0070] The interface testing method provided in this embodiment obtains the simulated service from the simulated service database and builds a simulated service database before performing interface testing based on the simulated service. In this way, only the group name corresponding to the interface in the code needs to be modified later to implement the calling operation of the simulated service. There is no need to write a simulated service for each interface in the code. Therefore, the code intrusion level is not high.
[0071] Further, based on any of the above embodiments, the test request also includes target input parameter information, and step 104 specifically includes:
[0072] According to the target input parameter information, response information corresponding to the target input parameter information is obtained in a preset data server.
[0073] The response information is sent to the client.
[0074] In this embodiment, the test request may further include target input parameter information. When the interface is tested using a simulation service based on the RPC protocol, response information corresponding to the target input parameter information may be obtained in the data server according to the target input parameter information. The response information is sent to the client, so that the performance of the interface that calls the simulation service may be tested according to the response information.
[0075] The interface testing method provided in this embodiment obtains response information corresponding to the target input parameter information in a preset data server according to the target input parameter information, and sends the response information to the client, thereby realizing the test operation of the interface.
[0076] Further, based on any of the above embodiments, the test request also includes an identifier of the interface to be tested, and after step 101, the following is further included:
[0077] The real service is called according to the interface to be tested corresponding to the interface to be tested identifier, and an interface test operation is performed according to the real service.
[0078] In this embodiment, during the testing process, some interfaces may have been developed and the dependencies of the real services called are not complicated. Therefore, the real services may be directly used to perform interface testing operations.
[0079] Specifically, the test request also includes the interface identifier to be tested. Accordingly, the real service can be directly called according to the interface identifier to be tested, and the test operation of the interface to be tested can be performed according to the real service.
[0080] Figure 5 The flowchart of the interface testing method provided in the third embodiment of the present disclosure is based on any of the above embodiments. Figure 5 As shown, the interface testing operation is performed according to the real service, including:
[0081] Step 301: If it is detected that any real service does not feed back response information for more than a preset time threshold during the test process, then according to the interface to be tested corresponding to the real service, determine the target group name corresponding to the interface to be tested in a preset group name mapping table.
[0082] Step 302: According to the target group name, call the RPC protocol-based simulation service corresponding to the target group name from a preset simulation service database.
[0083] Step 303: Perform an interface test operation according to the simulated service corresponding to the target group name.
[0084] In this embodiment, some real services may fail during the calling process and cannot provide response information in time. At this time, in order to improve the efficiency of the interface test, the simulation service corresponding to the real service can be directly used to perform the interface test operation.
[0085] Specifically, if it is detected that any real service does not feedback response information for more than a preset time threshold during the test process, the target group name corresponding to the interface to be tested is determined in a preset group name mapping table according to the interface to be tested corresponding to the real service. According to the target group name, the RPC protocol-based simulation service corresponding to the target group name is called from a preset simulation service database. The interface test operation is performed according to the simulation service corresponding to the target group name.
[0086] The interface testing method provided in this embodiment can improve the efficiency of interface testing by directly using a simulated service corresponding to the real service to perform interface testing operations when the real service fails during the calling process and cannot give response information in time.
[0087] Figure 6 This is a schematic diagram of the structure of the interface testing device provided in the fourth embodiment of the present disclosure, such as Figure 6As shown, the interface testing device includes: a first acquisition module 41, a determination module 42, a first calling module 43 and a testing module 44, wherein the first acquisition module 41 is used to obtain a test request sent by a client, wherein the test request includes at least one interface identifier to be edited. The determination module 42 is used to determine, according to the test request, a target group name corresponding to the interface identifier to be edited in a preset group name mapping table, wherein the group name mapping table stores in association each interface identifier and a corresponding custom group name. The first calling module 43 is used to call, according to the target group name in the interface to be edited, a simulation service based on the RPC protocol corresponding to the target group name from a preset simulation service database. The testing module 44 is used to perform an interface testing operation according to the simulation service corresponding to the target group name.
[0088] Figure 7 This is a structural diagram of an interface testing device provided in Embodiment 5 of the present disclosure, based on Embodiment 4. Figure 7 As shown, the device also includes: a second acquisition module 51, a third acquisition module 52, a construction module 53, a group name acquisition module 54 and a first storage module 55. Among them, the second acquisition module 51 is used to obtain a simulation service creation request sent by the client, and the simulation service creation request includes multiple interface identifiers to be simulated. The third acquisition module 52 is used to obtain the resource package and dependency information corresponding to each interface to be simulated from a preset data server according to the simulation service creation request. The construction module 53 is used to build a simulation service corresponding to each interface to be simulated according to the resource package and the dependency information. The group name acquisition module 54 is used to obtain the custom group name sent by the client for each simulation service, wherein the custom group name is entered by the user on the client. The first storage module 55 is used to send the simulation service and the custom group name corresponding to the simulation service to a preset simulation service database for storage.
[0089] Furthermore, based on the fourth embodiment, the device further includes:
[0090] A third acquisition module is used to acquire template information sent by the client, wherein the template information includes input parameter information and response information corresponding to the simulation service;
[0091] The second storage module is used to send the template information to a preset simulation service database for storage.
[0092] Furthermore, based on the fourth embodiment, the device further includes:
[0093] An establishing module is used to establish the group name mapping table according to the custom group name corresponding to the simulation service and the to-be-simulated interface identifier corresponding to the simulation service.
[0094] Further, based on the fourth embodiment, the test request also includes target input parameter information, and the test module is used to:
[0095] According to the target input parameter information, obtaining response information corresponding to the target input parameter information in a preset data server;
[0096] The response information is sent to the client.
[0097] Further, based on any of the above embodiments, the test request also includes an identifier of the interface to be tested, and the device further includes:
[0098] The second calling module is used to call the real service according to the interface to be tested corresponding to the interface to be tested identifier, and perform interface testing operation according to the real service.
[0099] Further, based on any of the above embodiments, the second calling module is used to:
[0100] If it is detected that any real service fails to feedback response information for more than a preset time threshold during the test process, then according to the interface to be tested corresponding to the real service, the target group name corresponding to the interface to be tested is determined in a preset group name mapping table;
[0101] According to the target group name, calling the RPC protocol-based simulation service corresponding to the target group name from a preset simulation service database;
[0102] An interface test operation is performed according to the simulated service corresponding to the target group name.
[0103] Figure 8 This is a structural diagram of an interface testing device provided in Embodiment 6 of the present disclosure, such as Figure 8 As shown, the interface testing device includes: a memory 61, a processor 62;
[0104] Memory 61; Memory 61 for storing instructions executable by the processor 62;
[0105] The processor 62 is used to call the program instructions in the memory 61 to execute the interface testing method as described in any of the above embodiments.
[0106] The memory 61 is used to store programs. Specifically, the program may include program codes, and the program codes include computer operation instructions. The memory 61 may include a high-speed RAM memory, and may also include a non-volatile memory, such as at least one disk memory.
[0107] The processor 62 may be a central processing unit (CPU), an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present disclosure.
[0108] Optionally, in a specific implementation, if the memory 61 and the processor 62 are implemented independently, the memory 61 and the processor 62 can be connected to each other through a bus and communicate with each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 8 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0109] Optionally, in a specific implementation, if the memory 61 and the processor 62 are integrated on a chip, the memory 61 and the processor 62 can communicate with each other through an internal interface.
[0110] Yet another embodiment of the present disclosure provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the interface testing method as described in any of the above embodiments.
[0111] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0112] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.
[0113] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present disclosure, rather than to limit them. Although the present disclosure has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein by equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present disclosure.
Claims
1. An interface testing method, characterized in that: include: Obtaining a test request sent by a client, wherein the test request includes at least one identifier of an interface to be edited; According to the test request, determining the target group name corresponding to the interface identifier to be edited in a preset group name mapping table, wherein each interface identifier and the corresponding custom group name are stored in association with each other in the group name mapping table; According to the target group name in the interface to be edited, calling the RPC protocol-based simulation service corresponding to the target group name from a preset simulation service database; Perform interface testing operations according to the simulated service corresponding to the target group name; Before determining the target group name corresponding to the group name in the interface to be edited in a preset group name mapping table according to the test request, the method further includes: obtaining a simulation service creation request sent by a client, wherein the simulation service creation request includes multiple interface identifiers to be simulated; According to the simulation service creation request, obtaining resource packages and dependency information corresponding to each interface to be simulated from a preset data server; Constructing a simulation service corresponding to each interface to be simulated according to the resource package and dependency information; For each of the simulated services, obtaining a custom group name sent by the client, wherein the custom group name is input by the user on the client, and the custom group name is different from the group name of the real service corresponding to the simulated service; The simulation service and the custom group name corresponding to the simulation service are sent to a preset simulation service database for storage.
2. The method according to claim 1, characterized in that After sending the simulation service and the custom group name corresponding to the simulation service to a preset simulation service database for storage, the method further includes: Obtaining template information sent by the client, wherein the template information includes input parameter information and response information corresponding to the simulation service; The template information is sent to a preset simulation service database for storage.
3. The method according to claim 1, characterized in that: After sending the simulation service and the custom group name corresponding to the simulation service to a preset simulation service database for storage, the method further includes: The group name mapping table is established according to the custom group name corresponding to the simulation service and the to-be-simulated interface identifier corresponding to the simulation service.
4. The method according to any one of claims 1 to 3, characterized in that: The test request also includes target input parameter information, and the interface test operation is performed according to the simulated service corresponding to the target group name, including: According to the target input parameter information, obtaining response information corresponding to the target input parameter information in a preset data server; The response information is sent to the client.
5. The method according to any one of claims 1 to 3, characterized in that: The test request also includes an identifier of the interface to be tested. After obtaining the test request sent by the client, the method further includes: The real service is called according to the interface to be tested corresponding to the interface to be tested identifier, and an interface test operation is performed according to the real service.
6. The method according to claim 5, characterized in that The performing of the interface testing operation according to the real service includes: If it is detected that any real service fails to feedback response information for more than a preset time threshold during the test process, then according to the interface to be tested corresponding to the real service, the target group name corresponding to the interface to be tested is determined in a preset group name mapping table; According to the target group name, calling the RPC protocol-based simulation service corresponding to the target group name from a preset simulation service database; An interface test operation is performed according to the simulated service corresponding to the target group name.
7. An interface testing device, characterized in that: include: A first acquisition module, configured to acquire a test request sent by a client, wherein the test request includes at least one identifier of an interface to be edited; A determination module, configured to determine, according to the test request, a target group name corresponding to the interface identifier to be edited in a preset group name mapping table, wherein each interface identifier and a corresponding custom group name are stored in association with each other in the group name mapping table; A first calling module is used to call a simulation service based on the RPC protocol corresponding to the target group name in the interface to be edited from a preset simulation service database; A test module, used to perform interface test operations according to the simulated service corresponding to the target group name; The device also includes: A second acquisition module is used to acquire a simulation service creation request sent by a client, wherein the simulation service creation request includes multiple to-be-simulated interface identifiers; A third acquisition module is used to acquire the resource package and dependency information corresponding to each interface to be simulated from a preset data server according to the simulation service creation request; A construction module, used to construct a simulation service corresponding to each interface to be simulated according to the resource package and dependency information; A group name acquisition module, used for acquiring, for each of the simulated services, a custom group name sent by the client, wherein the custom group name is input by the user on the client, and the custom group name is different from the group name of the real service corresponding to the simulated service; The first storage module is used to send the simulation service and the custom group name corresponding to the simulation service to a preset simulation service database for storage.
8. The device according to claim 7, characterized in that The device also includes: A third acquisition module is used to acquire template information sent by the client, wherein the template information includes input parameter information and response information corresponding to the simulation service; The second storage module is used to send the template information to a preset simulation service database for storage.
9. The device according to claim 7, characterized in that The device also includes: An establishing module is used to establish the group name mapping table according to the custom group name corresponding to the simulation service and the to-be-simulated interface identifier corresponding to the simulation service.
10. The device according to any one of claims 7 to 9, characterized in that: The test request also includes target input parameter information, and the test module is used to: According to the target input parameter information, obtaining response information corresponding to the target input parameter information in a preset data server; The response information is sent to the client.
11. The device according to any one of claims 7 to 9, characterized in that: The test request also includes an identifier of the interface to be tested, and the device also includes: The second calling module is used to call the real service according to the interface to be tested corresponding to the interface to be tested identifier, and perform interface testing operation according to the real service.
12. The device according to claim 11, characterized in that The second calling module is used for: If it is detected that any real service fails to feedback response information for more than a preset time threshold during the test process, then according to the interface to be tested corresponding to the real service, the target group name corresponding to the interface to be tested is determined in a preset group name mapping table; According to the target group name, calling the RPC protocol-based simulation service corresponding to the target group name from a preset simulation service database; An interface test operation is performed according to the simulated service corresponding to the target group name.
13. An interface testing device, characterized in that: include: Memory, processor; Memory; a memory for storing instructions executable by the processor; The processor is used to call the program instructions in the memory to execute the interface testing method as described in any one of claims 1-6.
14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the interface testing method according to any one of claims 1 to 6 when executed by a processor.
