CN106970873B - On-line mock testing method, device and system - Google Patents

On-line mock testing method, device and system Download PDF

Info

Publication number
CN106970873B
CN106970873B CN201710015723.2A CN201710015723A CN106970873B CN 106970873 B CN106970873 B CN 106970873B CN 201710015723 A CN201710015723 A CN 201710015723A CN 106970873 B CN106970873 B CN 106970873B
Authority
CN
China
Prior art keywords
mock
request
server
application server
response
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710015723.2A
Other languages
Chinese (zh)
Other versions
CN106970873A (en
Inventor
付宇
刘银
蒋丰杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ant Fortune Shanghai Financial Information Service Co ltd
Original Assignee
Advanced New Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Advanced New Technologies Co Ltd filed Critical Advanced New Technologies Co Ltd
Priority to CN201710015723.2A priority Critical patent/CN106970873B/en
Publication of CN106970873A publication Critical patent/CN106970873A/en
Application granted granted Critical
Publication of CN106970873B publication Critical patent/CN106970873B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

Abstract

The embodiment of the application provides an online mock testing method, device and system. The application server is used for providing a request to the mock server when receiving the request carrying the use case identifier; when a mock response provided by the mock server is received, the mock response is returned as a response of the request; and the mock server is used for matching the corresponding mock object from the built-in mock object set according to the use case identifier, simulating the processing request based on the mock object, and providing the processed mock response to the application server. According to the embodiment of the application, the mock testing cost can be reduced, and the mock testing efficiency is improved.

Description

On-line mock testing method, device and system
Technical Field
The application relates to the technical field of system automation test, in particular to an online mock test method, device and system.
Background
During the offline test or online drilling process of the system, objects and services needing attention often depend on a plurality of internal methods and/or external interface services, and the mock test simulates the dependence of the internal methods and/or the external interface services in a controllable manner so as to verify whether the objects to be tested can provide stable and reliable services under various possible states.
Currently, mock testing for internal methods is generally implemented by a mockito, powermock, jmoclit, and other frameworks. However, these frameworks are driven by test cases and cannot drive mock testing by rpc (Remote Procedure Call Protocol) Remote Call mode. The current mock test for the external interface service generally needs an external server and deploys mock service logic on the external server, so that the method needs to occupy additional external servers.
In order to solve the above problems, currently, the on-line mock test can be implemented by directly modifying the system code of the application system to be tested. However, in this way, regardless of whether the on-line mock test is implemented or the system recovery after the on-line mock test is implemented, the system code of the application system to be tested needs to be modified, which causes a large intrusion to the application system to be tested, and may seriously affect the normal operation of the application system to be tested.
Disclosure of Invention
An object of the embodiments of the present application is to provide an online mock testing method, apparatus, and system, so as to implement online mock testing by using an application system to be tested without affecting normal operation of the application system to be tested, thereby achieving the purpose of reducing mock testing cost.
In order to achieve the above object, in one aspect, an embodiment of the present application provides an online mock testing system, including an application server to be tested, where the application server to be tested includes an application server and a mock server that is dynamically injected into the application server to be tested in advance, where:
the application server is used for providing the request to the mock server when receiving the request carrying the use case identification; when a mock response provided by the mock server is received, returning the mock response as the response of the request;
and the mock server is used for matching a corresponding mock object from a built-in mock object set according to the use case identifier, simulating and processing the request based on the mock object, and providing a mock response obtained after processing for the application server.
On the other hand, the embodiment of the application also provides an online mock testing method, which comprises the following steps:
when a request carrying a use case identifier is received, providing the request to the mock server;
and when a mock response provided by the mock server is received, returning the mock response as the response of the request.
In another aspect, an embodiment of the present application further provides an application server, including:
the request forwarding module is used for providing the request to the mock server side when receiving the request carrying the use case identification;
and the response returning module is used for returning the mock response as the response of the request when receiving the mock response provided by the mock server.
On the other hand, the embodiment of the application also provides another online mock testing method, which comprises the following steps:
receiving a request carrying a use case identifier provided by an application server;
matching corresponding mock objects from a built-in mock object set according to the use case identification;
and simulating and processing the request based on the mock object, and providing a mock response obtained after processing for the application server.
In another aspect, an embodiment of the present application further provides a mock server, including:
the request receiving module is used for receiving a request which is provided by the application server and carries a use case identifier;
the object matching module is used for matching a corresponding mock object from a built-in mock object set according to the use case identifier;
and the service simulation module is used for simulating and processing the request based on the mock object and providing the processed mock response to the application server.
In the embodiment of the application, the mock server is pre-stored in the application server to be tested in a dynamic injection mode, so that the embodiment of the application does not need an additional server to deploy the mock server, and does not need to modify the code of the application system to be tested; therefore, the on-line mock test is carried out by using the application system to be tested while the normal operation of the application system to be tested is not influenced, the mock test cost is reduced, and the mock test efficiency is improved. In addition, in the embodiment of the application, the received request can be distinguished as a mock request or a service request through the use case identification, so that the isolation of the on-line mock test and the normal service is realized; and the use case identification can be used for distinguishing each mock request, so that the application example can effectively support the mock test of multiple concurrent scenes.
Drawings
The accompanying drawings, which are included to provide a further understanding of the embodiments of the disclosure, are incorporated in and constitute a part of this disclosure. In the drawings:
FIG. 1 is a block diagram of an inline mock testing system according to an embodiment of the present application;
fig. 2 is a block diagram of an application server according to an embodiment of the present application;
fig. 3 is a block diagram of a mock server according to an embodiment of the present application;
fig. 4 is an interaction flowchart of an application server and a mock server in an online mock testing system according to an embodiment of the present application;
FIG. 5 is a flowchart of an inline mock testing method according to an embodiment of the present application;
fig. 6 is a flowchart of an inline mock testing method according to another embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application more apparent, the embodiments of the present application are described in further detail below with reference to the embodiments and the accompanying drawings. The exemplary embodiments and descriptions of the embodiments are provided to explain the embodiments and should not be construed as limiting the embodiments.
Referring to fig. 1, an online mock test system according to the embodiment of the present application includes an application server 1 to be tested, where the application server 1 to be tested includes an application server 11 and a mock server 12 that is dynamically injected into the application server 1 to be tested in advance, where:
the application server 11 is configured to provide a request to the mock server 11 when receiving the request carrying the use case identifier; when receiving a mock response provided by the mock server 12, returning the mock response as a response of the request;
and the mock server 12 is configured to match a corresponding mock object from a built-in mock object set according to the use case identifier, perform simulation processing on the request based on the mock object, and provide a mock response obtained after the processing to the application server 11.
In an embodiment of the present application, the mock server 12 may be injected into the application server 1 to be tested in advance through a dynamic injection agent module (agent program) deployed in the application server 1 to be tested. The dynamic injection agent module can be used for receiving a mock server injection instruction. For example, the application system to be tested runs on the linux system, a specified jar package (agent program) can be uploaded on the linux system, and the dynamic injection agent module is started through java-jar agent. Of course, in the embodiment of the present application, the above-mentioned launching of the state injection agent module by using java-jar agent. In other embodiments of the present application, the dynamic injection agent module deployed in the application system to be tested may also be a script program (such as a shell) implemented based on other languages. In addition, in another embodiment of the present application, it may be considered that the dynamic injection proxy module is automatically deployed through a paas (Platform-as-a-Service) Platform when conditions allow.
In an embodiment of the present application, the mock server 12 may be sent to the dynamic injection agent module through a preset platform in advance. For example, after the dynamic injection agent module is deployed in an application system to be tested, a mock server injection instruction can be sent to the dynamic injection agent module through the mock platform; in this case, the dynamic injection agent module and the mock platform can communicate with each other by using a protocol such as socket; in addition, the dynamic injection agent module can be remotely connected through a local IDE (Integrated Development Environment) platform; in this case, the dynamic injection agent module and the IDE platform may communicate using a protocol such as RMI (Remote Method Invocation). In an exemplary embodiment of the present application, the IDE platform may be Eclipse or Intellij ideal, for example.
In one embodiment of the application, some tool classes can be used for generating mock server injection instructions. For example, if it is desired to simulate the response time of some external dependency interface for more than 5 seconds, the java code of the external dependency interface can be edited in the local IDE to obtain the corresponding java byte code or java class file. The java file can be obtained by using a dynamic editing interface of java or a java command; the java byte code can be obtained through other frameworks (such as ASM byte code plug-in).
In an embodiment of the present application, after receiving the mock server injection instruction, the dynamic injection agent module may extract the mock server 12 from information (such as bytecode to be injected or class to be replaced) in the mock server injection instruction, and then may dynamically inject the mock server 12 into the application server 1 to be tested through the java instrumentation interface. In addition, no matter the mock object is directed at an internal method or the mock object is directed at an external interface service, the dynamic injection can be realized through a dynamic injection agent module in the embodiment of the application; of course, after the mock test is completed, the mock server 12 can be deleted in the normal operation process of the application system to be tested by sending the restoring instruction to the dynamic injection agent module, so that the application system to be tested is restored. Therefore, the embodiment of the application also facilitates the unified management of the mock test.
In an embodiment of the present application, the mock server 12 may include a mock object set, where the mock object set is a set of correspondence between use case identifiers and mock objects, and the mock objects in the mock object set may be internal business logic and/or external business logic, and the number of the mock objects may be determined according to specific needs. The correspondence between the use case identifier and the mock object can be shown in the following table 1:
TABLE 1
Use case identification mock object
001 X1
002 X2
Therefore, the mock server 12 can match the corresponding mock object for the mock request corresponding to the use case identifier according to the corresponding relationship between the use case identifier and the mock object, so as to perform service simulation.
In the embodiment of the present application, the dynamic injection refers to injecting the mock server 12 into the application server 1 to be tested during the normal operation of the application system to be tested, and the mock server can take effect without restarting the application server 1 to be tested.
As shown in fig. 2, the application server 11 of the online mock testing system may include:
the request forwarding module 111 may be configured to provide the request to the mock server when receiving the request carrying the use case identifier;
the response returning module 112 may be configured to, when receiving a mock response provided by the mock server, return the mock response as the response of the request.
As shown in fig. 3, the mock server 12 of the online mock testing system may include:
a request receiving module 121, configured to receive a request carrying a use case identifier provided by an application server;
an object matching module 122, configured to match a corresponding mock object from a built-in mock object set according to the use case identifier;
and the service simulation module 123 is configured to simulate and process the request based on the mock object, and provide a mock response obtained after processing to the application server.
The following describes the interaction flow of the application server 11 and the mock server 12 with reference to fig. 4:
step 1, the application server 11 receives a request sent by a request sender. The request sender may be an upstream system or a client of the application server 11.
In this embodiment of the application, the request sender may send the request to the application server 11 in a context transparent transmission manner. For example, in an exemplary embodiment of the present application, the method may be implemented by a tracker component under a sofa (service organized Fabric architecture) development framework, that is, the sent request may be a transparent tracker context, and the tracker context includes a use case identifier.
And 2, the application server 11 judges whether the request carries a use case identifier. If the request carries the use case identifier, the request is a mock request, and then step 3a is executed.
In an embodiment of the application, the use case identifier in the mock request can be embedded in the mock request in advance in a point embedding manner. The buried point can be realized by a tool class, so that corresponding codes do not need to be written aiming at the mock logic realization, and the development cost and the maintenance cost of the codes are saved.
In an embodiment of the present application, for the application server 11, the use case identifier may be used to distinguish whether the received request is a mock request or a service request, thereby implementing on-line mock test and isolation of normal service.
In an embodiment of the application, for the mock server 12, the use case identifier can also be used for distinguishing each mock request, so that the mock server 12 can select a corresponding mock object for the corresponding mock request according to each use case identifier, and the mock test of multiple concurrent scenes can be effectively supported.
And 3a, the application server 11 transmits the request carrying the use case identifier to the mock server 12.
Step 4a, after receiving a mock request carrying a use case identifier provided by the application server 11, the mock server 12 matches a corresponding mock object from a built-in mock object set according to the use case identifier; and then, simulating and processing the mock request based on the mock object to obtain a mock response.
And step 5a, the mock server 12 provides the mock response to the application server 11.
And 6a, after receiving the mock response provided by the mock server 12, the application server 11 returns the mock response to the request sender as the response of the mock request.
In the embodiment of the present application, after step 2, the following steps may also be included:
and 3b, when the application server 11 receives a request which does not carry a use case identifier, indicating that the request is a normal service request. Therefore, the application server 11 may process the service request according to a preset service logic, and obtain a service result.
And 4b, the application server 11 encapsulates the service result into service and correspondingly returns the service result to the request sender.
In the embodiment of the application, the mock server is pre-stored in the application server to be tested in a dynamic injection mode, so that the embodiment of the application does not need an additional server to deploy the mock server, and does not need to modify the code of the application system to be tested; therefore, the on-line mock test is realized by using the application system to be tested while the normal operation of the application system to be tested is not influenced, and the mock test cost is low. In addition, in the embodiment of the application, the received request can be distinguished as a mock request or a service request through the use case identification, so that the isolation of the on-line mock test and the normal service is realized; and the use case identification can be used for distinguishing each mock request, so that the application example can effectively support the mock test of multiple concurrent scenes.
Referring to fig. 5, an inline mock testing method according to an embodiment of the present application may include the following steps:
step S501, when a request carrying a use case identifier is received, providing the request to the mock server.
And step S502, when a mock response provided by the mock server is received, returning the mock response as the response of the request.
For details of each step in the online mock testing method according to the embodiment of the present application, please refer to an interaction flow of the application server 11 and the mock server 12 shown in fig. 4, which is not described herein again.
In the embodiment of the application, the mock server is pre-stored in the application server to be tested in a dynamic injection mode, so that the embodiment of the application does not need an additional server to deploy the mock server, and does not need to modify the code of the application system to be tested; therefore, the on-line mock test is carried out by using the application system to be tested while the normal operation of the application system to be tested is not influenced, the mock test cost is reduced, and the mock test efficiency is improved. In addition, in the embodiment of the application, the received request can be distinguished as a mock request or a service request through the use case identification, so that the isolation of the on-line mock test and the normal service is realized; and the use case identification can be used for distinguishing each mock request, so that the application example can effectively support the mock test of multiple concurrent scenes.
Referring to fig. 6, the on-line mock testing method according to the embodiment of the present application may include the following steps:
step S601, receiving a request carrying a use case identifier provided by an application server;
step S602, matching corresponding mock objects from a built-in mock object set according to the use case identifiers;
and S603, simulating and processing the request based on the mock object, and providing the processed mock response to the application server.
For details of each step in the online mock testing method according to the embodiment of the present application, please refer to an interaction flow of the application server 11 and the mock server 12 shown in fig. 4, which is not described herein again.
In the embodiment of the application, the mock server is pre-stored in the application server to be tested in a dynamic injection mode, so that the embodiment of the application does not need an additional server to deploy the mock server, and does not need to modify the code of the application system to be tested; therefore, the on-line mock test is carried out by using the application system to be tested while the normal operation of the application system to be tested is not influenced, the mock test cost is reduced, and the mock test efficiency is improved. In addition, in the embodiment of the application, the received request can be distinguished as a mock request or a service request through the use case identification, so that the isolation of the on-line mock test and the normal service is realized; and the use case identification can be used for distinguishing each mock request, so that the application example can effectively support the mock test of multiple concurrent scenes.
Although the process flows described in the above method embodiments include a number of operations occurring in a particular order, it should be appreciated that the processes may include more or fewer operations, which may be performed sequentially or in parallel (e.g., using parallel processors or a multi-threaded environment).
In the 90 s of the 20 th century, improvements in a technology could clearly distinguish between improvements in hardware (e.g., improvements in circuit structures such as diodes, transistors, switches, etc.) and improvements in software (improvements in process flow). However, as technology advances, many of today's process flow improvements have been seen as direct improvements in hardware circuit architecture. Designers almost always obtain the corresponding hardware circuit structure by programming an improved method flow into the hardware circuit. Thus, it cannot be said that an improvement in the process flow cannot be realized by hardware physical modules. For example, a Programmable Logic Device (PLD), such as a Field Programmable Gate Array (FPGA), is an integrated circuit whose Logic functions are determined by programming the Device by a user. A digital system is "integrated" on a PLD by the designer's own programming without requiring the chip manufacturer to design and fabricate application-specific integrated circuit chips. Furthermore, nowadays, instead of manually making an Integrated Circuit chip, such Programming is often implemented by "logic compiler" software, which is similar to a software compiler used in program development and writing, but the original code before compiling is also written by a specific Programming Language, which is called Hardware Description Language (HDL), and HDL is not only one but many, such as abel (advanced Boolean Expression Language), ahdl (alternate Hardware Description Language), traffic, pl (core universal Programming Language), HDCal (jhdware Description Language), lang, Lola, HDL, laspam, hardward Description Language (vhr Description Language), vhal (Hardware Description Language), and vhigh-Language, which are currently used in most common. It will also be apparent to those skilled in the art that hardware circuitry that implements the logical method flows can be readily obtained by merely slightly programming the method flows into an integrated circuit using the hardware description languages described above.
The controller may be implemented in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, an Application Specific Integrated Circuit (ASIC), a programmable logic controller, and an embedded microcontroller, examples of which include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320, the memory controller may also be implemented as part of the control logic for the memory. Those skilled in the art will also appreciate that, in addition to implementing the controller as pure computer readable program code, the same functionality can be implemented by logically programming method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers and the like. Such a controller may thus be considered a hardware component, and the means included therein for performing the various functions may also be considered as a structure within the hardware component. Or even means for performing the functions may be regarded as being both a software module for performing the method and a structure within a hardware component.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
For convenience of description, the above devices are described as being divided into various units by function, and are described separately. Of course, the functionality of the units may be implemented in one or more software and/or hardware when implementing the present application.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The application may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The application may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above-mentioned embodiments are intended to illustrate the objects, technical solutions and advantages of the present application in further detail, and it should be understood that the above-mentioned embodiments are only examples of the embodiments of the present application and are not intended to limit the scope of the present application, and any modifications, equivalents, improvements and the like made within the spirit and principle of the present application should be included in the scope of the present application.

Claims (13)

1. The utility model provides an online mock test system which characterized in that, includes the application server that awaits measuring, the application server that awaits measuring includes application server, dynamic injection in advance to the mock server in the application server that awaits measuring, and advance dispose to the dynamic injection agent module in the application server that awaits measuring, wherein:
the application server is used for receiving the request; when the request carries a use case identifier, providing the request to the mock server; when a mock response provided by the mock server is received, returning the mock response as the response of the request; when the request does not carry a case identifier, processing the request according to preset service logic to obtain a service result; returning the service result as the response of the request;
the mock server is used for matching a corresponding mock object from a built-in mock object set according to the use case identifier, simulating and processing the request based on the mock object, and providing a mock response obtained after processing for the application server;
and the dynamic injection agent module is used for injecting the mock server into the application server to be tested after receiving an injection instruction, and deleting the mock server after receiving a reduction instruction.
2. The system of claim 1, wherein the request is transmitted to the application server in a context pass-through manner.
3. The system of claim 1, wherein the use case identifier is pre-embedded in the request by way of an embedding point.
4. The on-line mock test system according to claim 1, wherein said mock server is previously sent to said dynamic injection agent module through a preset platform.
5. The on-line mock test system according to claim 4, wherein said preset platform comprises:
an integrated development environment IDE platform, or mock platform.
6. An online mock testing method is characterized by being applied to an application server and comprising the following steps:
receiving a request;
when the request carries a use case identifier, providing the request to a mock server; when a mock response provided by the mock server is received, returning the mock response as the response of the request; the mock server is dynamically injected into an application server to be tested in advance, and the application server to be tested comprises the application server and the mock server;
when the request does not carry a case identifier, processing the request according to preset service logic to obtain a service result; and returning the service result as the response of the request.
7. The method of claim 6, wherein the request is transmitted to the application server in a context pass-through manner.
8. The method of claim 6, wherein the use case id is embedded in the request by embedding points in advance.
9. An application server, comprising:
a receiving module for receiving a request;
the request forwarding module is used for providing the request to the mock server side when the request carries a use case identifier; the mock server is dynamically injected into an application server to be tested in advance, and the application server to be tested comprises the application server and the mock server;
a first response returning module, configured to, when receiving a mock response provided by the mock server, return the mock response as a response to the request;
the processing module is used for processing the request according to preset service logic to obtain a service result when the request does not carry a case identifier;
and the second response returning module is used for returning the service result as the response of the request.
10. An online mock testing method is characterized by being applied to a mock server side, wherein the mock server side is arranged on an application server to be tested in a dynamic injection mode, and the method comprises the following steps:
receiving a request carrying a use case identifier provided by an application server;
matching corresponding mock objects from a built-in mock object set according to the use case identification;
and simulating and processing the request based on the mock object, and providing a mock response obtained after processing for the application server.
11. The method of claim 10, wherein the request is transmitted to the application server in a context pass-through manner.
12. The method of claim 10, wherein the use case id is embedded in the request by embedding points in advance.
13. The mock server side is characterized in that the mock server side is arranged on an application server to be tested in a dynamic injection mode, and comprises:
the request receiving module is used for receiving a request which is provided by the application server and carries a use case identifier;
the object matching module is used for matching a corresponding mock object from a built-in mock object set according to the use case identifier;
and the service simulation module is used for simulating and processing the request based on the mock object and providing the processed mock response to the application server.
CN201710015723.2A 2017-01-10 2017-01-10 On-line mock testing method, device and system Active CN106970873B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710015723.2A CN106970873B (en) 2017-01-10 2017-01-10 On-line mock testing method, device and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710015723.2A CN106970873B (en) 2017-01-10 2017-01-10 On-line mock testing method, device and system

Publications (2)

Publication Number Publication Date
CN106970873A CN106970873A (en) 2017-07-21
CN106970873B true CN106970873B (en) 2021-07-09

Family

ID=59334467

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710015723.2A Active CN106970873B (en) 2017-01-10 2017-01-10 On-line mock testing method, device and system

Country Status (1)

Country Link
CN (1) CN106970873B (en)

Families Citing this family (29)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107395420B (en) * 2017-07-26 2020-11-24 携程计算机技术(上海)有限公司 Server performance testing method and system, electronic device and storage medium
CN107733866A (en) * 2017-09-12 2018-02-23 阿里巴巴集团控股有限公司 RPC requests, RPC request processing methods, device and equipment
CN107832218B (en) * 2017-11-10 2019-03-12 平安科技(深圳)有限公司 A processing method, device and computer equipment are buried in dynamic page
CN107977316B (en) * 2017-12-21 2021-08-31 创新先进技术有限公司 Method, client and system for simulating remote procedure call
CN108345535B (en) * 2017-12-26 2022-03-04 创新先进技术有限公司 mock testing method, device and equipment
CN110032454A (en) * 2018-01-12 2019-07-19 北京京东尚科信息技术有限公司 Remote invocation method, system and relevant device and computer readable storage medium
CN108170612B (en) * 2018-01-23 2021-01-15 百度在线网络技术(北京)有限公司 Automatic testing method and device and server
CN108427644A (en) * 2018-03-27 2018-08-21 深圳市买买提信息科技有限公司 Service test method, service testing system and service testing device
CN108600255B (en) * 2018-05-07 2022-02-01 平安普惠企业管理有限公司 Mock service management method, device, computer equipment and storage medium
CN109101430B (en) * 2018-08-24 2022-08-09 创新先进技术有限公司 Test method, device and equipment
CN109359149B (en) * 2018-10-08 2021-03-05 网宿科技股份有限公司 Simulation test method and related device
CN109344075A (en) * 2018-10-19 2019-02-15 网宿科技股份有限公司 Configuration method, test method, configuration server and service node device
CN111382062B (en) * 2018-12-30 2023-09-15 贝壳技术有限公司 Joint debugging test method and device for real estate transaction system and external institution business system
CN111625442B (en) * 2019-02-28 2024-03-26 顺丰科技有限公司 Mock testing method and device
CN111722995B (en) * 2019-03-18 2023-08-15 杭州淘票票影视文化有限公司 Data processing method and device
CN110191013A (en) * 2019-04-19 2019-08-30 深圳壹账通智能科技有限公司 Electronic device, the Mock test method of more capital's interfaces and storage medium
CN110362472A (en) * 2019-05-31 2019-10-22 口碑(上海)信息技术有限公司 MOCK test method, device and equipment
CN110362491B (en) * 2019-07-17 2020-02-21 广州市有车以后信息科技有限公司 Mock testing method and testing device based on man-in-the-middle agent technology
CN110532184B (en) * 2019-08-29 2023-06-30 深圳前海环融联易信息科技服务有限公司 Method, device, computer equipment and storage medium for multi-scene simulation response
CN111367792A (en) * 2020-02-24 2020-07-03 天津满运软件科技有限公司 Test method, test device, storage medium and electronic equipment
CN113535538B (en) * 2020-04-21 2023-06-16 网联清算有限公司 Method, device, electronic equipment and storage medium for automatically testing application full link
CN111752837B (en) * 2020-06-24 2024-01-12 北京百度网讯科技有限公司 View library system test method, device, equipment and storage medium
CN111782535A (en) * 2020-06-30 2020-10-16 京东数字科技控股股份有限公司 Test method and device
CN112052172B (en) * 2020-09-04 2024-01-30 云账户技术(天津)有限公司 Rapid test method and device for third-party channel and electronic equipment
CN113760707A (en) * 2020-09-23 2021-12-07 北京沃东天骏信息技术有限公司 Interface testing method, device, equipment and computer readable storage medium
CN112306864A (en) * 2020-10-19 2021-02-02 北京健康之家科技有限公司 Method and system for testing Mock based on microservice, storage medium and computing equipment
CN114448857A (en) * 2022-01-29 2022-05-06 北京字节跳动网络技术有限公司 Method, device, storage medium and system for processing Mock service
CN114928556A (en) * 2022-03-22 2022-08-19 中国人寿保险股份有限公司 Interface service test method and related equipment
CN116303062B (en) * 2023-03-27 2023-12-19 广州钛动科技股份有限公司 Service interface testing method and device, terminal equipment and readable storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104899142A (en) * 2015-06-10 2015-09-09 北京嘀嘀无限科技发展有限公司 Remote mock testing method and device
CN105138448A (en) * 2014-06-05 2015-12-09 北京畅游天下网络技术有限公司 Method and device for page test at front end
CN105335281A (en) * 2014-07-30 2016-02-17 阿里巴巴集团控股有限公司 Method and device for automatic mock of external dependency
CN106294113A (en) * 2015-06-03 2017-01-04 阿里巴巴集团控股有限公司 A kind of creation method based on programmable type testing service and device
CN106294106A (en) * 2015-05-27 2017-01-04 航天信息股份有限公司 The method of testing of Web application system and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9396091B2 (en) * 2014-09-29 2016-07-19 Sap Se End-to end, lifecycle aware, API management

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105138448A (en) * 2014-06-05 2015-12-09 北京畅游天下网络技术有限公司 Method and device for page test at front end
CN105335281A (en) * 2014-07-30 2016-02-17 阿里巴巴集团控股有限公司 Method and device for automatic mock of external dependency
CN106294106A (en) * 2015-05-27 2017-01-04 航天信息股份有限公司 The method of testing of Web application system and device
CN106294113A (en) * 2015-06-03 2017-01-04 阿里巴巴集团控股有限公司 A kind of creation method based on programmable type testing service and device
CN104899142A (en) * 2015-06-10 2015-09-09 北京嘀嘀无限科技发展有限公司 Remote mock testing method and device

Also Published As

Publication number Publication date
CN106970873A (en) 2017-07-21

Similar Documents

Publication Publication Date Title
CN106970873B (en) On-line mock testing method, device and system
CN108345535B (en) mock testing method, device and equipment
CN107122289B (en) Method, device and system for system regression testing
CN106909498B (en) Method and system for injecting fault into Java program
CN103177210B (en) A kind of method implanting dynamic stain analysis module in Android
CN109542506B (en) System capable of flexibly configuring interface and rapidly delivering service
CN107038041B (en) Data processing method, error code dynamic compatibility method, device and system
CN106294113B (en) creation method and device based on programmable test service
CN107203465B (en) System interface testing method and device
CN111399840B (en) Module development method and device
CN109241026B (en) Data management method, device and system
CN108400902B (en) Method, device and equipment for gray level test
CN108268289B (en) Parameter configuration method, device and system for web application
CN107479868B (en) Interface loading method, device and equipment
CN112597013A (en) Online development and debugging method and device
CN111459724A (en) Node switching method, device, equipment and computer readable storage medium
CN108304313B (en) Device, client and method for data testing
CN111159040A (en) Test data generation method, device, equipment and storage medium
CN110471828B (en) Operating system testing method, device and equipment thereof
CN109284222B (en) Software unit, project testing method, device and equipment in data processing system
CN111338655A (en) Installation package distribution method and system
CN111399926A (en) Method and device for downloading starting program
CN114238934A (en) Equipment information acquisition method, device, equipment and medium
CN111796864A (en) Data verification method and device
CN109144575A (en) Device, method, electronic equipment and the memory of cross operating system operation application

Legal Events

Date Code Title Description
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20201016

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Applicant after: Innovative advanced technology Co.,Ltd.

Address before: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Applicant before: Advanced innovation technology Co.,Ltd.

Effective date of registration: 20201016

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Applicant after: Advanced innovation technology Co.,Ltd.

Address before: Greater Cayman, British Cayman Islands

Applicant before: Alibaba Group Holding Ltd.

GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20220415

Address after: Room 602, No. 618 Wai Road, Huangpu District, Shanghai

Patentee after: Ant fortune (Shanghai) Financial Information Service Co.,Ltd.

Address before: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Patentee before: Innovative advanced technology Co.,Ltd.