Service test method and device, electronic equipment, storage medium and program product

Through the service testing method, simulated services are used to replace unfinished services, which solves the problem of unfinished services in the full-process test, realizes a complete test development process, improves testing efficiency and reduces costs.

CN118779206APending Publication Date: 2024-10-15TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310386152.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-04-03
Publication Date
2024-10-15

AI Technical Summary

Technical Problem

During full-process testing, if some services are not completed, full-process testing cannot be performed, and completed services cannot call unfinished services, making it impossible to test all functions of completed services.

Method used

Through the service test method, the service test request is received, the application program interface is parsed and queried, the simulated service configuration information is obtained, and the simulated service is used to imitate the unfinished service and return test data to achieve a complete test development process.

Benefits of technology

It improves testing efficiency and reduces test development costs. By replacing unfinished services with simulated services, a complete service testing process is realized and dependence on the implementation status of the second service is avoided.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118779206A_ABST
    Figure CN118779206A_ABST
Patent Text Reader

Abstract

The invention provides a service testing method and device, electronic equipment, a storage medium and a program product. The method comprises the steps that a service test request is received, and the service test request is generated through a service test tool and forwarded through a first service; analyzing an application program interface needing to be called by the service test request, and querying a second service bound with the application program interface; querying simulation service configuration information of the second service; in response to the simulation service configuration information representing that the second service is configured with a simulation service, obtaining test data, used for responding to the service test request, of the simulation service, the simulation service being used for simulating the second service; and forwarding the test data to the service test tool through the first service. Through the application, the test development efficiency can be improved, and the test workload can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to computer technology, and in particular to a service testing method, device, electronic device, storage medium, and program product. Background Art

[0002] Program Testing refers to the inspection of a computer program that completes all or part of its functions and modules before it is officially used to ensure that the program can run correctly in the intended manner.

[0003] In the related art, when a full-process test of an application is required, if some services have not been completed, the full-process test cannot be performed, and the completed services cannot call the unfinished services, which means that it is difficult to test all functions of the completed services. Summary of the invention

[0004] The embodiments of the present application provide a service testing method, device, electronic device, computer-readable storage medium, and computer program, which can improve testing efficiency and reduce test development costs.

[0005] The technical solution of the embodiment of the present application is implemented as follows:

[0006] The present application provides a service testing method, the method comprising:

[0007] receiving a service test request, wherein the service test request is generated by a service test tool and forwarded via a first service;

[0008] Parsing the application program interface that needs to be called by the service test request, and querying the second service bound to the application program interface;

[0009] Querying the simulation service configuration information of the second service;

[0010] In response to the simulation service configuration information indicating that the second service is configured with a simulation service, obtaining test data used by the simulation service to respond to the service test request, wherein the simulation service is used to simulate the second service;

[0011] The test data is forwarded to the service testing tool through the first service.

[0012] The present application provides a service testing device, including:

[0013] A request receiving module, configured to receive a service test request, wherein the service test request is generated by a service test tool and forwarded via a first service;

[0014] A parsing and querying module, used to parse out the application program interface that needs to be called by the service test request, and query the second service bound to the application program interface; query the simulation service configuration information of the second service;

[0015] A service response module is used to respond to the simulation service configuration information indicating that the second service is configured with a simulation service, obtain test data used by the simulation service to respond to the service test request, wherein the simulation service is used to simulate the second service; and forward the test data to the service testing tool through the first service.

[0016] In the above scheme, the parsing query module is also used to parse the service test request parameters from the service test request, and based on the service test request parameters, query the test data corresponding to the service test request parameters in the simulation service; in response to no test data corresponding to the service test request parameters being queried from the simulation service, query the default test data configured in the simulation service from the simulation service as test data in response to the service test request.

[0017] In the above scheme, the service response module is also used to query the default test data configured by the simulation service from the simulation service when the service test request parameter is a null value, as test data responding to the service test request.

[0018] In the above scheme, the service response module is also used to query the test data for the service test request parameters configured by the simulation service from the simulation service when the simulation service is used to simulate a normal test scenario, as test data in response to the service test request.

[0019] In the above scheme, the service response module is also used to query the test data configured by the simulation service that does not match the service test request parameters from the simulation service when the simulation service is used to simulate an abnormal test scenario, as test data in response to the service test request.

[0020] In the above scheme, the request accepting module is also used to receive simulation configuration instructions from the development terminal, add a simulation service for the second service; receive service test request parameters sent by the service testing tool for the second service configuration; configure the service test request parameters, and send a configuration response result to the service testing tool.

[0021] In the above scheme, the parsing query module is also used to parse out the test interface name carried by the service test request, and determine the application interface that needs to be called according to the test interface name; query the interface mapping table based on the test interface name, and use the service associated with the queried test interface name as the second service, wherein the interface mapping table includes the mapping relationship between different application interface names and different services.

[0022] In the above scheme, the service response module is also used to, in response to the simulation service configuration information indicating that the second service is not configured with the simulation service, forward the service test request to the second service, so that the second service performs the following processing: parse the service test request parameters from the service test request, generate test data according to the service test request parameters, and send the test data; receive the test data sent by the second service. In the above scheme, the service response module is also used to, in response to the simulation service configuration information indicating that the second service is configured with the simulation service and the second service has not yet been put into operation, query the default test data of the simulation service configuration information from the simulation service as test data in response to the service test request.

[0023] In the above scheme, the service response module is also used to send a configuration information query request to the simulation service configuration platform so that the simulation service configuration platform can parse the simulation service configuration information of the second service; and receive the simulation service configuration information of the second service sent by the simulation service configuration platform.

[0024] An embodiment of the present application provides an electronic device, the electronic device comprising:

[0025] A memory for storing computer executable instructions or computer programs;

[0026] The processor is used to implement the service testing method provided in the embodiment of the present application when executing the computer executable instructions or computer program stored in the memory.

[0027] An embodiment of the present application provides a computer-readable storage medium storing a computer program or computer-executable instructions for implementing the service testing method provided in the embodiment of the present application when executed by a processor.

[0028] An embodiment of the present application provides a computer program product, including a computer program or computer executable instructions. When the computer program or computer executable instructions are executed by a processor, the service testing method provided by the embodiment of the present application is implemented.

[0029] The embodiments of the present application have the following beneficial effects:

[0030] Targeted test requests can be generated through the test service tool, and forwarded through the first service to simultaneously test whether the data receiving and sending functions of the first service are normal; the second service corresponding to the application interface is queried and bound, and then the simulation service configuration information of the second service is queried, and the second service response to the service test request can be imitated through the simulation service to return the expected test data required by the user for subsequent testing, and the test data is forwarded to the service testing tool through the first service to realize a complete test development process; compared with the related technology that requires the implementation of the second service, the present application can return the expected test data through the simulation service instead of the second service, so that the complete service testing process is not restricted by whether the second service is implemented, thereby improving the test development efficiency and reducing the testing workload. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] Figure 1A is a schematic diagram of the architecture of a service testing system 100 provided in an embodiment of the present application;

[0032] Figure 1B is a schematic diagram of the cluster structure of the server 200 provided in an embodiment of the present application;

[0033] Figure 1C It is a schematic diagram of the relay server architecture provided in an embodiment of the present application;

[0034] Figure 2 is a schematic diagram of the structure of the server 200 provided in an embodiment of the present application;

[0035] FIG. 3A to FIG. 3D It is a flowchart of the service test provided by the embodiment of the present application;

[0036] Figure 4A This is an example diagram of a service test provided by an embodiment of the present application;

[0037] Figure 4B It is a schematic diagram of a relay service simulation test provided in an embodiment of the present application;

[0038] Figure 4C This is a schematic diagram of an abnormal scenario test provided by an embodiment of the present application;

[0039] Figure 4D This is a schematic diagram of an unimplemented service scenario test provided in an embodiment of the present application;

[0040] Figure 5 It is a service test interaction flow chart provided in an embodiment of the present application. DETAILED DESCRIPTION

[0041] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. The described embodiments should not be regarded as limiting the present application. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of this application.

[0042] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it can be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0043] In the following description, the terms "first\second\third" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present application described here can be implemented in an order other than that illustrated or described here.

[0044] It is understandable that in the embodiments of the present application, related data such as user information is involved. When the embodiments of the present application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.

[0045] Unless otherwise defined, all technical and scientific terms used in the embodiments of the present application have the same meanings as those commonly understood by those skilled in the art. The terms used in the embodiments of the present application are only for the purpose of describing the embodiments of the present application and are not intended to limit the present application.

[0046] Before further describing the embodiments of the present application in detail, the nouns and terms involved in the embodiments of the present application are explained. The nouns and terms involved in the embodiments of the present application are subject to the following interpretations.

[0047] 1) Microservices: divide a single application into a group of small services. The services coordinate and cooperate with each other. Each service runs in its own independent process. The services communicate with each other using a lightweight communication mechanism. Each service is built around a specific business and can be independently deployed to a production environment, a quasi-production environment, etc. In the embodiment of the present application, both the first service and the second service can be microservices.

[0048] 2) Relay service: A service used to carry communications between multiple modules in microservices. For example, node A and node B can communicate directly through the network. When using the relay service, nodes A and B no longer communicate directly, but communicate with the relay service, which then forwards the communication data to nodes A and B.

[0049] 3) Unit Testing, also known as module testing, is a test that verifies the correctness of a program module (the smallest unit of software design). Unit testing can simulate a dependent class and can simulate program module behavior through the dependent class.

[0050] 4) Remote Procedure Calls (PRC), an inter-process communication technology used for client-server based applications, also known as subroutine calls or function calls; for example, when an application is deployed on server A, if it needs to call a function or method provided by the application on server B, it cannot be called directly because it is not in the same memory space. It is necessary to express the semantics of the call and convey the call data through the network. The typical RPC framework can be Svrkit.

[0051] 5) Mock service, also known as mock testing, is a test method that uses a virtual object to create a test method for some objects that are not easy to construct or obtain during the test process. For example, a typical mock test framework can be Gmock. For example, during unit testing and module interface testing, when a module needs to rely on another class or other classes, and the module's dependent class has not been completed, you can define a mock service object to simulate the behavior of the dependent class to replace the unfinished class for a complete test process.

[0052] 6) Stub Testing: The typical application scenario of stub testing is when an object needs to fetch data from a database, but does not need to actually interact with the database, but directly returns preset data.

[0053] 7) Integration testing, also known as assembly testing, is the testing work of assembling program modules in a one-time or value-added manner to verify the correctness of the system interface. Integration testing is generally performed after unit testing and before system testing.

[0054] 8) Protocol buffers, a data description language similar to Extensible Markup Language (XML), can serialize structured data and can be used for data storage, communication protocols, etc.

[0055] The embodiments of the present application provide a service testing method, apparatus, device, computer-readable storage medium, and computer program product, which can improve the efficiency of test development and reduce the test workload. The exemplary application of the electronic device provided by the embodiments of the present application is described below. The electronic device provided by the embodiments of the present application can be implemented as a laptop, a tablet computer, a desktop computer, a set-top box, a mobile device (e.g., a mobile phone, a portable music player, a personal digital assistant, a dedicated messaging device, a portable gaming device), or a server. Below, an exemplary application when the device is implemented as a server will be described.

[0056] See also Figure 1A , Figure 1A It is an architectural diagram of the service testing system 100 provided in an embodiment of the present application. To support a service testing application, a terminal (terminal 400-1 and terminal 400-2 are shown as examples) is connected to a server 200 via a network 300. The network 300 may be a wide area network or a local area network, or a combination of the two.

[0057] The terminal (terminal 400-1 and terminal 400-2 are shown as examples) is used to initiate a service test request, server 200 receives the service test request sent by the terminal, parses the service test request, and queries the second service bound to the application interface; server 200 queries the simulation service configuration information of the second service, obtains the test data used by the simulation service to respond to the service test request, server 200 returns the test data to the terminal, and the terminal displays the test data on a graphical interface (graphical interface 410-1 and graphical interface 410-2 are shown as examples).

[0058] refer to Figure 1B , Figure 1B It is a schematic diagram of the cluster structure of the server 200 provided in an embodiment of the present application; the server 200 mentioned above can be implemented by a server cluster, divided into multiple services according to functions, each service is implemented by at least one server, including a simulation service configuration platform service, a service testing tool service, a first service, a relay service, and a second service.

[0059] The simulation service configuration platform service is used to receive the simulation service configuration instructions sent by the terminal to configure the simulation service of the corresponding service and the simulation service configuration information; the service testing tool service is used to respond to the service testing instructions of the terminal and send a service testing request to the first service, wherein the service testing request content is to call the second service through the first service to query the service testing parameters and return the results; the first service receives the service testing request and forwards the service testing request to the relay service to call the second service through the relay service. Here, the relay service does not directly call the second service, but queries the simulation service configuration platform service whether there is a simulation service configured for the second service. When a simulation service exists, the relay service does not need to call the second service but obtains the predetermined test data through the simulation service, and returns the predetermined test data to the first service as the return result of the second service in response to the service testing instruction; the test data is then forwarded to the service testing tool service through the first service to complete the complete testing process, and the service testing tool service returns the service test results to the terminal through the network.

[0060] It should be noted that the first service or the second service can be a microservice, a mini-program, etc.; the relay service is used to carry communication between multiple services.

[0061] refer to Figure 1C , Figure 1C It is a schematic diagram of the relay server architecture provided in an embodiment of the present application, including a relay server, a first server, a second server, and a third server.

[0062] like Figure 1C As shown, the first server, the second server, and the third server can be indirectly connected through the relay server, that is, when the communication connection between electronic devices is too complicated or cannot be directly established, the connection can be established by forwarding data through the relay service (the data forwarded by the relay service has been encrypted to ensure data security); for example, the first service running on the mobile terminal using the mobile 4G network and the personal computer (Personal Computer, PC) using the local area network are usually unable to establish a direct connection. At this time, a relay service is needed to forward data. The relay server simplifies the communication process between the first server, the second server, and the third server, and provides a more reliable and secure connection. The relay server can be used as a secure channel to transmit data. The relay server can also handle firewall and router restrictions and provide Network Address Translation (NAT) penetration services to allow direct communication between multiple electronic devices.

[0063] In some embodiments, the server 200 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms. The terminal and the server may be directly or indirectly connected via wired or wireless communication, which is not limited in the embodiments of the present application.

[0064] See also Figure 2 , Figure 2 is a schematic diagram of the structure of the server 200 provided in an embodiment of the present application, Figure 2 The server 200 shown may be the terminal or server described above. The server 200 includes: at least one processor 210 and a memory 250. The various components in the server 200 are coupled together via a bus system 240. It is understood that the bus system 240 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 240 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, the bus system 240 is not described in detail. Figure 2 Various buses are labeled as bus system 240 .

[0065] The processor 210 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc., where the general-purpose processor can be a microprocessor or any conventional processor, etc.

[0066] The memory 250 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state memory, hard disk drives, optical disk drives, etc. The memory 250 may optionally include one or more storage devices that are physically remote from the processor 210.

[0067] The memory 250 includes a volatile memory or a non-volatile memory, and may also include both volatile and non-volatile memories. The non-volatile memory may be a read-only memory (ROM), and the volatile memory may be a random access memory (RAM). The memory 250 described in the embodiment of the present application is intended to include any suitable type of memory.

[0068] In some embodiments, memory 250 can store data to support various operations, examples of which include programs, modules, and data structures, or a subset or superset thereof, as exemplarily described below.

[0069] Operating system 251, including system programs for processing various basic system services and performing hardware-related tasks, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and processing hardware-based tasks;

[0070] A network communication module 252, used to reach other electronic devices via one or more (wired or wireless) network interfaces 220, exemplary network interfaces 220 include: Bluetooth, Wireless Compatibility Certification (WiFi), and Universal Serial Bus (USB), etc.;

[0071] In some embodiments, the audio transmission device provided in the embodiments of the present application can be implemented in software. Figure 2 The service testing device 255 stored in the memory 250 is shown, which can be software in the form of a program and a plug-in, etc., including the following software modules: a request receiving module 2551, a parsing query module 2552 and a service response module 2553. These modules are logical, so they can be arbitrarily combined or further split according to the functions implemented. The functions of each module will be explained below.

[0072] The service testing method provided in the embodiments of the present application will be described in conjunction with the exemplary application and implementation of the electronic device provided in the embodiments of the present application.

[0073] The following describes the service testing method provided by the embodiment of the present application. As mentioned above, the electronic device implementing the service testing method of the embodiment of the present application may be the server of the relay service described above. Therefore, the execution subject of each step will not be repeatedly described below.

[0074] See also Figure 3A , Figure 3A This is a flow chart of the service test provided by the embodiment of the present application, which will be combined with Figure 3A The steps shown are explained.

[0075] In step 101, a service test request is received.

[0076] Illustratively, the service test request is generated by a service test tool and forwarded via the first service.

[0077] In some examples, the service testing tool responds to a service testing instruction sent by the terminal, and the service testing tool generates a service testing request for the service testing instruction, wherein the service testing request queries the service testing request parameters by calling the second service through the first service.

[0078] Here, the first service does not directly call the second service to query the service test request parameters, but forwards the service test request parameters to the relay service, and performs subsequent service tests through the relay service module.

[0079] Through the embodiments of the present application, the service testing tool can respond to the user's service testing instructions, generate a corresponding service testing request, and forward it to the relay service through the first service, so as to indirectly test whether the function of the first service is normal.

[0080] In step 102, the application program interface that needs to be called by the service test request is parsed, and the second service bound to the application program interface is queried.

[0081] For example, the service test request includes service test request parameters and an application interface name.

[0082] In some embodiments, reference Figure 3B , Figure 3A The illustrated step 102 may be implemented by following the steps 1021 to 1022, which are described in detail below.

[0083] In step 1021, the test interface name carried in the service test request is parsed, and the application program interface to be called is determined according to the test interface name.

[0084] For example, the service test request may be in the form of program editing code, such as the following code:

[0085] message GetUserInfoReqTest interface name

[0086] {

[0087] optional uint32 user_id=1; service test request parameter

[0088] }

[0089] In step 1022, the interface mapping table is searched based on the test interface name, and the service associated with the searched test interface name is used as the second service.

[0090] For example, the interface mapping table includes mapping relationships between different application interface names and different services.

[0091] In some examples, a mapping is used to associate a program interface with a corresponding service. A mapping can also be a collection of keyword / value pairs; that is, given a keyword, the value corresponding to the keyword can be obtained. Keywords and values ​​are both objects, and each keyword / value pair is used as an item in the interface mapping table, where keywords must be unique, but values ​​can be repeated, and some values ​​or keywords can be null.

[0092] Here, the application interface and service can also be a client and server structure (Client / Server, C / S), which is directly connected to the server corresponding to the service through the application interface, making full use of the advantages of the hardware environment on both ends of the application and the server, and reasonably allocating tasks to the client and server to achieve, thereby reducing the communication overhead of the system and achieving a faster response speed.

[0093] Through the embodiments of the present application, the test interface name and service test request parameters in the service test request can be parsed to determine the second service associated with the application interface, and perform subsequent tests based on the service test parameters.

[0094] Continue to refer Figure 3A In step 103, the simulation service configuration information of the second service is queried.

[0095] In some embodiments, reference Figure 3C , Figure 3A The step 103 shown can be implemented by following the steps 1031 to 1032, which are described in detail below.

[0096] In step 1031, a configuration information query request is sent to the simulation service configuration platform, so that the simulation service configuration platform parses the simulation service configuration information of the second service;

[0097] For example, a configuration information query request for the second service is sent to the simulation service configuration platform through a relay service, and the simulation service configuration information of the second service is parsed by the simulation configuration platform; the simulation service configuration information here can be whether the second service is configured with a simulation service; when the second service is configured with a simulation service, the test data pre-set in the simulation service for responding to service test requests, etc.

[0098] In step 1032, simulation service configuration information of the second service sent by the simulation service configuration platform is received.

[0099] For example, the simulated service configuration information for the second service sent by the simulated service configuration information is received through the relay service.

[0100] In some embodiments, the simulation service configuration information is configured by the simulation service configuration platform in the following manner:

[0101] The simulation service configuration platform receives the simulation configuration instruction sent by the development terminal, and adds a simulation service of the second service. The simulation service configuration platform receives the service test request parameters for the second service configuration sent by the service test tool, configures the service test request parameters, and sends a configuration response result to the service test tool.

[0102] In some embodiments, the simulation service configuration platform can automatically detect unimplemented or faulty services in the microservice architecture on a regular basis, automatically record service exception status, and configure simulation services that simulate unimplemented or faulty service functions, thereby avoiding test users from manually detecting service exceptions and configuring simulation services; here, the simulation service configuration platform's automatic detection function for microservices can be enabled by default, or users can be supported to manually enable or disable it in the simulation service configuration platform.

[0103] In some embodiments, the simulation service configuration platform can configure the test data of all test scenarios in the corresponding simulation service configuration information based on the test scenarios of the service (e.g., abnormal test scenarios, normal test scenarios), or, based on the test scenarios selected by the user in the simulation service configuration platform, configure the test data of the corresponding test scenarios in the corresponding simulation service (rather than the test data of all test scenarios), thereby saving storage resources.

[0104] In some embodiments, for the services running in the microservice scenario, the simulation service configuration platform can provide functional options for configuring the corresponding simulation services, so that in the service operation scenario, the simulation service can replace the running service to return response test data for the service test parameters, so as to achieve the testing of the overall function or part of the function of the service without affecting the normal operation of the service.

[0105] Through the embodiments of the present application, it is possible to query the simulation service configuration information for the second service in the simulation service configuration platform, so as to perform subsequent service testing by replacing (simulating) the second service with the simulation service.

[0106] Continue to refer Figure 3A In step 104, in response to the simulation service configuration information indicating that the second service is configured with a simulation service, test data used by the simulation service to respond to the service test request is obtained.

[0107] Illustratively, the mock service is used to mock the second service.

[0108] In some embodiments, reference Figure 3D , Figure 3A The step 104 shown can be implemented by following the steps 1041 to 1043, which are described in detail below.

[0109] In step 1041, the service test request parameters are parsed from the service test request.

[0110] For example, the relay service parses the service test request parameters from the service test request. Here, the service test request content generated by the service test tool is to call the second service through the first service to query the service test request parameters; the service test request parameters can be user serial number, user name, etc., and the second service can query the complete user information corresponding to the user serial number through the service test request parameters.

[0111] In some embodiments, assuming that the function provided by the second service is to query user information, the application interface definition corresponding to the second service can be implemented by the following code:

[0112]

[0113] Here, when there is no simulation service, the service request parameter received by the second service is the user ID, and the information returned through the second service application interface may be the corresponding user name, user gender, etc.

[0114] In step 1042, based on the service test request parameters, the test data corresponding to the service test request parameters in the simulation service is queried.

[0115] For example, the relay service queries the test data corresponding to the service test request parameters in the simulation service based on the service test request parameters. It should be noted that in the simulation service configuration information, one service test request parameter corresponds to at least one test data, and the service test request parameter can be an empty value. In different test scenarios, the simulation service can return test data corresponding to the test requirements according to the simulation service configuration information.

[0116] In some embodiments, when the service test request parameter is a null value, default test data configured for the mock service is queried from the mock service as test data in response to the service test request.

[0117] Here, according to normal service testing logic, when the second service receives a service test request parameter with a null value (null), it is usually unable to query the null value, and thus returns prompts such as "query abnormality" and "please enter correct query characters" to remind the test user to reset the search keywords; in an embodiment of the present application, when the service test request parameter is a null value, the relay service is called to query the default test data through a simulated service as the test data in response to the service test request; to simulate the test situation of an abnormal second service request.

[0118] For example, taking the second service as a retrieval service, when the matching relationship between the search keywords and the search results in the second service is incorrect, specific or random search results can be obtained even if a null value is entered. In the embodiment of the present application, a simulation service can be used to return default test data when the service test request parameter is a null value to simulate the query exception scenario during the actual operation of the second service; this allows the test user to set up a repair plan in advance and deploy it in the second service for specific exception scenarios when the second service is not fully developed, so that the repair plan can be directly applied when the corresponding exception occurs, thereby improving the fault tolerance of the application microservice.

[0119] In some embodiments, when the simulation service is used to simulate a normal test scenario, test data for service test request parameters configured by the simulation service is queried from the simulation service as test data in response to the service test request.

[0120] Through the embodiments of the present application, it is possible to simulate an incomplete service according to the corresponding service test parameters and return preset test data for subsequent testing without waiting for the application program interface of the real server to be developed before testing, thereby improving service testing efficiency.

[0121] In some embodiments, when the simulation service is used to simulate an abnormal test scenario, test data configured by the simulation service that does not match the service test request parameters is queried from the simulation service as test data in response to the service test request.

[0122] In some embodiments, the relay service can call a simulation service to return predetermined exception test data to simulate a response exception caused by a second service load exceeding a tolerance threshold (the tolerance threshold can be set according to the usage rate of the server core processor) or an application running error; thereby, the test user can determine the abnormal state of the second service based on the abnormal test data, and set up a patch program in advance to respond to the corresponding abnormal state; so that in a real second service operation scenario, when the second service returns specific exception data, the relay service can be called to automatically apply the patch program, so as to achieve automatic application of the patch program based on the exception data responded by the second service without manual intervention to repair the abnormal state in the second service, so as to improve the stability of applying the second service.

[0123] In step 1043, in response to not finding test data corresponding to the service test request parameters from the simulation service, default test data of the simulation service configuration information is queried from the simulation service as test data in response to the service test request.

[0124] For example, in response to the simulation service failing to find test data corresponding to the service test request parameters from the simulation service configuration information, the relay service calls the simulation service to query the simulation service configuration information for default test data, and uses the default test data as test data for responding to the service test request.

[0125] In some embodiments, the service test request includes service test request parameters. The relay service responds to the simulation service configuration information indicating that the second service is not configured with a simulation service. The relay service directly sends a service test request generated by a service test tool and forwarded via the first service to the second service. Here, the service test request content is to call the second service through the first service to query the service test request parameters. The second service receives the service test request, parses the service test request parameters from the service test request, and generates test data based on the service test request parameters. The test data is sent to the relay service through the second service. The relay service receives the test data sent by the second service and returns the test data to the first service as a response result to the service test request.

[0126] In some embodiments, in response to the simulation service configuration information indicating that the second service is configured with a simulation service and the second service has not yet been put into operation, the relay service queries the default test data of the simulation service configuration from the simulation service as test data in response to the service test request.

[0127] Through the embodiments of the present application, it is possible to use a simulation service to test service request parameters and return expected test data in response to service test requests according to the simulation service configuration information in different test scenarios, thereby improving service testing efficiency. By calling the simulation service through a relay service, the simulation service simulates the return of a response result by a second service, thereby eliminating the need to access the second service, which can significantly reduce the testing workload and be applicable to more test scenarios.

[0128] Continue to refer Figure 3A In step 105, the test data is forwarded to the service testing tool through the first service.

[0129] For example, the relay service sends the test data returned by the simulation service in response to the service test request to the first service as a response result of the service test request, and forwards the response result of the service test request to the test tool through the first service.

[0130] Through the embodiments of the present application, targeted test requests can be generated based on the test service tool, and forwarded through the first service to simultaneously test whether the data receiving and sending functions of the first service are normal; the second service corresponding to the application interface is queried and bound, and then the simulation service configuration information of the second service is queried, and the second service response to the service test request can be imitated through the simulation service to return the expected test data required by the user for subsequent testing. The test data is forwarded to the service testing tool through the first service to realize a complete test development process, which can improve the test development efficiency and reduce the testing workload.

[0131] The following is an explanation of an exemplary application of an embodiment of the present application in a practical application scenario.

[0132] The embodiments of the present application can be applied to software testing scenarios in a microservice environment. The embodiments of the present application provide a stub interface testing solution based on a relay service, which can very conveniently perform service testing on unimplemented program interfaces or program interfaces in abnormal scenarios, so as to improve the testing efficiency in a complex microservice environment and reduce the test development cost.

[0133] In the related technology, when testing the corresponding function of service A, service B is called through service A so that service B queries the relevant user information according to the request information; however, if service B has not been fully developed or put into use, service A cannot call service B normally. At this time, the test service for service A cannot be completed.

[0134] Through the embodiments of the present application, before testing the corresponding functions of service A, simulated service configuration information is added to service B in advance through the test service configuration platform, and a simulated response result is added to the simulated service configuration information; in the corresponding process of testing service A, service A calls service B through the relay service, and in response to the calling instruction of service A, the relay service queries the test service configuration platform to obtain the simulated service configuration information of service B; the relay service returns a preset response result to service A based on the simulated response result of service B. Therefore, when service B has not been fully developed or enabled, the response result of service B can also be simulated through the relay service, and the corresponding functions of service A can also be tested without calling the real service B.

[0135] In the related technology, when testing the corresponding function of service A, service B is called through service A. At this time, service A needs to call service B to query data and make service B return error data to perform an abnormal test on service A. However, since service B is in a normal state, even if it receives erroneous query information, it cannot return the expected error data, and can only prompt that the query is wrong or the data does not exist, that is, the abnormal test of service A cannot be completed.

[0136] Through the embodiments of the present application, before testing the corresponding functions of service A, the simulation service configuration information is added to service B in advance through the test service configuration platform; the simulated response results are added to the simulation service configuration information. For example, in the user information query scenario, if the query information is "user id = 1", then "user name = Li" is returned; otherwise, "user name = Zhang" is returned. At this time, an exception test is performed on service A. When the query information "user id = 2" is input, service A calls service B through the relay service. The relay service responds to the call instruction of service A, obtains the simulation service configuration information of service B, and based on the query information of service A, returns the preset configuration information "user name = Zhang" to service A based on the simulated response result of service B. Thus, the relay service simulates service B to return the expected error data, and the exception test of service A is completed without calling the real service B.

[0137] Unit testing, also known as module testing, is a testing task for verifying the correctness of program modules (the smallest unit of software design). Unit testing can simulate a dependent class and can simulate the behavior of program modules through the dependent class.

[0138] In the related art, the application interface of service B can be simulated and set parameters can be returned through unit testing or integration testing. For example, based on the programming language (C++), the application interface of service B is simulated through unit testing (gmock) and the specified response result is returned. However, the granularity of unit testing is relatively small, and it only targets individual modules or functions for testing, and cannot perform application programming interface (API) testing or full-process testing.

[0139] Reference Figure 4A , Figure 4A is the service test example diagram provided by the embodiments of the present application; it includes a transfer service and downstream services; among them, the downstream services exemplarily show services A, B, C, and E.

[0140] For example, a complete transfer function requires 10 related downstream services. If you need to test whether the transfer function is normal, the most efficient way is to directly test the transfer interface. However, because service B is not implemented, the transfer interface cannot be called. If the transfer function is tested by writing unit tests based on relevant technologies, it is necessary to simulate the application interface of service B to associate with the application interfaces of all other downstream services. At this time, by simulating the calling process of the application interface of service B and other application services through unit tests, it is impossible to determine whether the related downstream services are functioning normally. Too many simulated services in unit tests cannot achieve the overall functional testing effect of the application, and the workload of unit tests is too large.

[0141] Through the embodiments of the present application, before testing the transfer function, various response data of service B are pre-set through the test service configuration platform, and in response to the call instructions of other services to service B, the simulated service configuration information of service B is obtained through the relay service. The relay service simulates service B according to the call instructions and returns the preset service configuration information to support program interface testing or full-process testing, return specified request results for unimplemented services, and can also return specified exception data for abnormal test scenarios.

[0142] refer to Figure 5 , Figure 5 This is a service test interaction flow chart provided in the embodiment of the present application, which will be combined with Figure 5 The steps shown are detailed.

[0143] In step 301, the test service configuration configures a simulation test service in response to a configuration instruction.

[0144] For example, in response to a configuration virtual service instruction input by a user, the test service configuration simulates the addition of a test service.

[0145] Here, the test service configuration is equivalent to the simulation service configuration platform mentioned above, and the simulation test service is equivalent to the simulation service mentioned above.

[0146] In some examples, the test service configuration adds a simulation test service for a second service, configures the specified request information of the simulation test service of the second service as "user_id=12345", and configures the response results as "user_name=Li Si" and "user_name=Zhang San"; here, when the simulation test service of the second service receives the specified request information of "user_id=12345", if the simulation test service of the second service has a corresponding response result, the simulation test service will replace (simulate) the second service to return the response result "user_name=Li Si"; if the simulation test service of the second service does not have a response result corresponding to the specified request information of "user_id=12345", the simulation test service will replace the second service to return the response result "user_name=Zhang San" as the default simulation test data.

[0147] Here, when the second service is not configured with a simulation test service, the service request parameter received by the second service is a user ID, and the information returned by the second service application interface may be a corresponding user name, user gender, etc., which can be implemented by the following program code:

[0148]

[0149] At this time, if the query information is "user_id=1", the second service can return the corresponding test result, that is, "user_name=1, gender=2".

[0150] In step 302, the test service sends a test service request to the first service in response to the test instruction.

[0151] Here, the test service is equivalent to the service testing tool mentioned above.

[0152] In response to the test instruction sent by the user, the test service sends a test service request to the first service. For example, the test service request may be "call the second service through the first service, query the specified request information, and return the corresponding response result", and the specified request information is "user_id=12345". The test service request includes the name of the request application interface and the specified request information (equivalent to the test interface name and test service request parameters mentioned above).

[0153] In step 303, the first service receives the test service request, and the first service forwards the test service request to the relay service.

[0154] The first service receives the test service request sent by the test service. Here, the first service does not directly call the second service to query the specified request information, but forwards the specified request information to the relay service to complete the query of the specified request information through the relay service.

[0155] Relay service can carry the communication between multiple services in microservices. For example, node A and node B can communicate directly with each other. When using relay service, the communication (request) between node A and node B will be forwarded through the relay service.

[0156] In step 304, the relay service performs a remote procedure call based on the test service request to determine the requested service.

[0157] For example, remote procedure call refers to the communication between processes running on different machines. For example, a process running on one machine can call a service on a remote machine just like accessing a local service without knowing the underlying communication details.

[0158] Here, the relay service queries the service to be requested based on the application interface name carried in the test service request and the interface query mapping table (interface-service). The interface query mapping table records the mapping relationship between the application interface name and the actual running service, and the interface query mapping table will be dynamically updated according to the update of the service.

[0159] In some examples, the relay service determines that the requested service is the second service based on the application interface name "second service" in the test service request, specifies the request information "user_id=12345", calls the second service and queries the specified request information "user_id=12345".

[0160] In step 305, the relay service reads the test service configuration and detects whether the second service has a simulated test service.

[0161] The relay service reads the test service configuration based on the application interface name in the test service request and obtains the simulation test service of the corresponding application service;

[0162] In some examples, the relay service reads a simulated test service for the second service in the test service configuration based on the application interface name "second service" in the test service request, and detects whether a simulated test service exists for the second service.

[0163] If the second service has been configured with a simulation test service, step 306 is executed.

[0164] If the second service is not configured with a simulation test service, execute step 308

[0165] In step 306, in response to the existence of the simulation test service of the second service, the relay service reads the simulation test service of the second service and detects whether there is a simulation response result corresponding to the specified request information.

[0166] The relay service queries whether there is a simulated response result corresponding to the specified request information "user_id = 12345" in the simulated test service of the second service in the test service configuration based on the specified request information of the test service request.

[0167] In step 307, the relay service reads the corresponding simulated response result in the simulated test service of the second service based on the specified request information.

[0168] When there is a simulated response result corresponding to the specified request information in the second service in the test service configuration information, the relay service reads the simulated test service of the second service based on the specified request information "user_id = 12345" of the test service request, and obtains the simulated response result "user_name = Li Si" that exactly matches the specified request information "user_id = 12345".

[0169] Since there is a simulated test service for the second service, the simulated test service will replace (simulate) the second service to return the response result. The relay service directly returns the response result "user_name = Li Si" of the preset test service request in the simulated test service to the first service, instead of requesting the real second service.

[0170] When there is no simulated response result corresponding to the specified request information in the second service in the test service configuration, the relay service reads the simulated test service of the second service based on the specified request information "user_id = 12345" of the test service request. Here, the response result of the specified request information "user_id = 12345" is not matched for the simulated response result, and the default simulated response result, that is, "user_name = Zhang San" is returned as the response result.

[0171] Since there is a simulated test service for the second service, the simulated test service will replace (simulate) the second service to return the response result. The relay service directly returns the response result "user_name = Zhang San" of the preset test service request in the simulated test service to the first service, instead of requesting the real second service.

[0172] In step 308, the relay service directly calls the second service to query the specified request information.

[0173] In response to the relay service reading the test service configuration and not querying the simulated test service of the second service, the relay service directly calls the second service to query the response result based on the specified request information of the test service request.

[0174] In some embodiments, if the second service needs to call the third service, steps 303 to 308 are repeated, which will not be elaborated here.

[0175] Reference Figure 4B , Figure 4B is a schematic diagram of the relay service simulation test provided by an embodiment of the present application.

[0176] Here, the first service invokes the relay service to request the second service.

[0177] The relay service reads the simulation test service of the second service. If there is no simulation test service for the second service, the relay service directly requests the second service and sends the specified request information "user_id = 12345" to the second service; in response to the specified request information "user_id = 12345", the second service feeds back the real response result to the relay service, and the relay service forwards the real response result to the first service and ends the service test status.

[0178] If there is a simulation test service for the second service, the relay service directly reads the simulation test service instead of requesting the second service and performs matching processing based on the specified request information "user_id = 12345"; when there is specified simulation test data (simulated response result) corresponding to the specified request information "user_id = 12345" in the simulation test service, the relay service returns the specified simulation test data "user_id = Li Si" as the response result to the first service; when there is no specified simulation test data corresponding to the specified request information "user_id = 12345" in the simulation test service, the relay service returns the default simulation test data "user_id = Zhang San" as the response result to the first service and ends the service test status.

[0179] It should be noted that here, before the service test, the simulation test service can specifically set the simulation test data for different services. The specific process refers to step 301 and will not be elaborated here.

[0180] Reference Figure 4C , Figure 4C is a schematic diagram of the abnormal scenario test provided by an embodiment of the present application; it includes service A, relay service, simulation test service environment, and real test environment.

[0181] In the test of the abnormal scenario, a response result that does not match the request information can be returned through the simulation test service environment for error testing.

[0182] For example, service A sends the request information (user_id = 12345) to the relay service, and the relay service will invoke the simulation test service environment of service B. Among them, the error response result for the request information is preset in the simulation test service environment of service B, and the simulation test service environment of service B returns the preset error response information (user_name = Wang Wu) to the relay service; to replace the invocation of the real test environment of service B.

[0183] Reference Figure 4D , Figure 4D is a schematic diagram of an unimplemented service scenario test provided by an embodiment of the present application; it includes Service A, a relay service, an unimplemented service environment, and a simulated test service environment.

[0184] In the unimplemented service scenario test, default simulated test data can be returned through the simulated test service environment, that is, no matter what parameters Service A requests with, the simulated test service environment of Service B will return default simulated test data to simulate the response result of Service B in the unimplemented service environment and perform subsequent other test processes.

[0185] For example, Service A sends a request message (user_id = 1357) to the relay service, and the relay service will call the simulated test service environment of Service B. Among them, the default response result is preset in the simulated test service environment of Service B, and the simulated test service environment of Service B returns the preset default response result (user_name = Liang Liu) to the relay service; to replace the call to the unimplemented service environment of Service B.

[0186] Through the embodiment of the present application, the development and test efficiency can be improved. By combining the relay service with the simulated test service, the entire test process does not need to wait for all services to be fully implemented or does not need to rely on specific services; for abnormal scenarios or un-developed scenarios, specified response results can be returned, and it is very convenient to test unimplemented interfaces or interfaces in abnormal scenarios to improve the test efficiency in a complex microservice environment and reduce the test development cost.

[0187] Next, continue to describe the exemplary structure of the service test device 255 provided by the embodiment of the present application as a software module. In some embodiments, as Figure 2 shown, the software module in the service test device 255 stored in the memory 250 may include:

[0188] A request receiving module 2551, configured to receive a service test request, where the service test request is generated by a service test tool and forwarded via a first service; a parsing and querying module 2552, configured to parse out the application programming interface that the service test request needs to call and query the second service bound to the application programming interface; query the simulated service configuration information of the second service; a service response module 2553, configured to, in response to the simulated service configuration information indicating that the second service is configured with a simulated service, obtain the test data used by the simulated service to respond to the service test request, where the simulated service is used to simulate the second service; forward the test data to the service test tool via the first service.

[0189] In some embodiments, the parsing query module 2552 is also used to parse the service test request parameters from the service test request, and based on the service test request parameters, query the test data of the corresponding service test request parameters in the simulation service; in response to the test data of the corresponding service test request parameters not being queried from the simulation service, query the default test data of the simulation service configuration from the simulation service as the test data in response to the service test request.

[0190] In some embodiments, the service response module 2553 is further used to query the default test data configured for the simulation service from the simulation service when the service test request parameter is a null value, as test data for responding to the service test request.

[0191] In some embodiments, the service response module 2553 is also used to query the test data for the service test request parameters configured by the simulation service from the simulation service when the simulation service is used to simulate a normal test scenario, as test data in response to the service test request.

[0192] In some embodiments, the service response module 2553 is also used to query the simulation service for test data that does not match the service test request parameters configured by the simulation service as test data in response to the service test request when the simulation service is used to simulate an abnormal test scenario.

[0193] In some embodiments, the request receiving module 2551 is also used to receive simulation configuration instructions from the development terminal, add a simulation service for the second service; receive service test request parameters sent by the service testing tool for the second service configuration; configure the service test request parameters, and send a configuration response result to the service testing tool.

[0194] In some embodiments, the parsing query module 2552 is also used to parse out the test interface name carried in the service test request, and determine the application interface that needs to be called based on the test interface name; query the interface mapping table based on the test interface name, and use the service associated with the queried test interface name as the second service, wherein the interface mapping table includes a mapping relationship between different application interface names and different services.

[0195] In some embodiments, the request receiving module 2551 is also used to forward the service test request to the second service in response to the simulation service configuration information indicating that the second service is not configured with a simulation service, so that the second service performs the following processing: parse the service test request parameters from the service test request, generate test data according to the service test request parameters, and send the test data; receive the test data sent by the second service.

[0196] In some embodiments, the parsing query module 2552 is also used to query the default test data of the simulation service configuration information from the simulation service in response to the simulation service configuration information indicating that the second service is configured with a simulation service and the second service has not yet been put into operation, as test data for responding to the service test request.

[0197] In some embodiments, the parsing query module 2552 is also used to send a configuration information query request to the simulation service configuration platform so that the simulation service configuration platform can parse the simulation service configuration information of the second service; and receive the simulation service configuration information of the second service sent by the simulation service configuration platform.

[0198] The embodiment of the present application provides a computer program product, which includes a computer program or a computer executable instruction, and the computer program or the computer executable instruction is stored in a computer-readable storage medium. The processor of the electronic device reads the computer executable instruction from the computer-readable storage medium, and the processor executes the computer executable instruction, so that the electronic device executes the service testing method described in the embodiment of the present application.

[0199] The embodiment of the present application provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions or computer programs are stored. When the computer-executable instructions or computer programs are executed by a processor, the processor will be caused to execute the service testing method provided by the embodiment of the present application, for example, FIG. 3A to FIG. 3D The service test method is shown.

[0200] In some embodiments, the computer-readable storage medium may be a memory such as RAM, ROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or may be various devices including one or any combination of the above memories.

[0201] In some embodiments, computer executable instructions may be in the form of a program, software, software module, script or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine or other unit suitable for use in a computing environment.

[0202] As an example, computer-executable instructions may, but need not, correspond to a file in a file system, may be stored as part of a file that stores other programs or data, such as in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files storing one or more modules, subroutines, or code portions).

[0203] As an example, computer executable instructions may be deployed to be executed on one electronic device, or on multiple electronic devices located at one site, or on multiple electronic devices distributed at multiple sites and interconnected by a communication network.

[0204] To summarize, through the embodiment of the present application, a targeted test request can be generated through a test service tool, which can be forwarded through the first service to simultaneously test whether the data receiving and sending functions of the first service are normal; the second service corresponding to the application interface is queried and bound, and then the simulation service configuration information of the second service is queried, and the second service response to the service test request can be imitated through the simulation service to return the expected test data required by the user for subsequent testing, and the test data is forwarded to the service testing tool through the first service to realize a complete test development process. Compared with the related technology that requires the implementation of the second service, the present application can return the expected test data through the simulation service instead of the second service, so that the complete service testing process is not restricted by whether the second service is implemented, thereby improving the test development efficiency and reducing the testing workload.

[0205] The above is only an embodiment of the present application and is not intended to limit the protection scope of the present application. Any modifications, equivalent substitutions and improvements made within the spirit and scope of the present application are included in the protection scope of the present application.

Claims

1. A service testing method, characterized in that: The method comprises: receiving a service test request, wherein the service test request is generated by a service test tool and forwarded via a first service; Parsing the application program interface that needs to be called by the service test request, and querying the second service bound to the application program interface; Querying simulation service configuration information of the second service; In response to the simulation service configuration information indicating that the second service is configured with a simulation service, obtaining test data used by the simulation service to respond to the service test request, wherein the simulation service is used to simulate the second service; The test data is forwarded to the service testing tool through the first service.

2. The method according to claim 1, characterized in that The service test request includes service test request parameters; The obtaining of test data used by the simulation service to respond to the service test request includes: Parsing the service test request parameters from the service test request, and querying the simulation service for test data corresponding to the service test request parameters based on the service test request parameters; In response to not finding test data corresponding to the service test request parameters from the mock service, querying the mock service for default test data configured in the mock service as test data in response to the service test request.

3. The method according to claim 2, characterized in that The querying, based on the service test request parameters, of the test data corresponding to the service test request parameters in the simulation service includes: When the service test request parameter is a null value, default test data configured by the simulation service is queried from the simulation service to serve as test data in response to the service test request.

4. The method according to claim 2, characterized in that The querying, based on the service test request parameters, of the test data corresponding to the service test request parameters in the simulation service includes: When the simulation service is used to simulate a normal test scenario, the test data configured by the simulation service for the service test request parameters is queried from the simulation service as test data in response to the service test request.

5. The method according to claim 2, characterized in that The querying, based on the service test request parameters, of the test data corresponding to the service test request parameters in the simulation service includes: When the simulation service is used to simulate an abnormal test scenario, test data configured by the simulation service that does not match the service test request parameters is queried from the simulation service as test data in response to the service test request.

6. The method according to claim 1, wherein The simulation service configuration information is configured by the simulation service configuration platform in the following manner: receiving a simulation configuration instruction from the development terminal and adding a simulation service for the second service; receiving a service test request parameter for the second service configuration sent by the service test tool; Configure the service test request parameters and send a configuration response result to the service test tool.

7. The method according to claim 1, characterized in that The service test request includes a test interface name; The step of parsing the application program interface required to be called for the service test request includes: Parsing the test interface name carried in the service test request, and determining the application program interface to be called according to the test interface name; The querying of the second service bound to the application program interface includes: An interface mapping table is queried based on the test interface name, and a service associated with the queried test interface name is used as a second service, wherein the interface mapping table includes mapping relationships between different application interface names and different services.

8. The method according to any one of claims 1 to 7, characterized in that The service test request includes service test request parameters; The method further comprises: In response to the mock service configuration information indicating that the second service is not configured with the mock service, forwarding the service test request to the second service, so that the second service performs the following processing: parsing the service test request parameters from the service test request, generating test data according to the service test request parameters, and sending the test data; Receive the test data sent by the second service.

9. The method according to any one of claims 1 to 7, characterized in that The method further comprises: In response to the simulation service configuration information indicating that the second service is configured with the simulation service and the second service has not yet been put into operation, default test data of the simulation service configuration information is queried from the simulation service as test data in response to the service test request.

10. The method according to any one of claims 1 to 7, characterized in that The querying of the simulation service configuration information of the second service includes: Sending a configuration information query request to the simulation service configuration platform, so that the simulation service configuration platform parses the simulation service configuration information of the second service; Receive simulation service configuration information of the second service sent by the simulation service configuration platform.

11. A service testing device, characterized in that: The device comprises: a request receiving module, configured to receive a service test request, wherein the service test request is generated by a service test tool and forwarded via the first service; A parsing and querying module, configured to parse the application program interface to be called by the service test request, and query the second service bound to the application program interface; and query the simulation service configuration information of the second service; A service response module is used to respond to the simulation service configuration information indicating that the second service is configured with a simulation service, obtain test data used by the simulation service to respond to the service test request, wherein the simulation service is used to simulate the second service; and forward the test data to the service testing tool through the first service.

12. An electronic device, characterized in that: The electronic device comprises: a memory for storing computer-executable instructions or computer programs; The processor is configured to implement the service testing method according to any one of claims 1 to 10 when executing the computer executable instructions or computer program stored in the memory.

13. A computer-readable storage medium storing computer-executable instructions or a computer program, characterized in that: When the computer executable instructions or computer program are executed by a processor, the service testing method according to any one of claims 1 to 10 is implemented.

14. A computer program product comprising computer executable instructions or a computer program, characterized in that When the computer executable instructions or computer program are executed by a processor, the service testing method according to any one of claims 1 to 10 is implemented.