CN112988560A - Method and device for testing system robustness - Google Patents

Method and device for testing system robustness Download PDF

Info

Publication number
CN112988560A
CN112988560A CN201911302996.0A CN201911302996A CN112988560A CN 112988560 A CN112988560 A CN 112988560A CN 201911302996 A CN201911302996 A CN 201911302996A CN 112988560 A CN112988560 A CN 112988560A
Authority
CN
China
Prior art keywords
data
module
tested
service module
service
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201911302996.0A
Other languages
Chinese (zh)
Inventor
蔡亚茹
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology 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 Beijing Jingdong Century Trading Co Ltd, Beijing Wodong Tianjun Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201911302996.0A priority Critical patent/CN112988560A/en
Publication of CN112988560A publication Critical patent/CN112988560A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3664Environments for testing or debugging software
    • GPHYSICS
    • G06COMPUTING; CALCULATING; 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 invention discloses a method and a device for testing the robustness of a system, and relates to the technical field of computers. One embodiment of the method comprises: introducing the online flow into a tested service module of the system; modifying a data request path of a tested service module to point to a pre-deployed data agent module so as to modify data requested by the tested data module and returning the modified data to the tested service module; and in the process of carrying out service processing by the tested service module according to the modified data, acquiring and analyzing the operating data of the tested service module so as to test the robustness of the system. The method and the system can specifically simulate the condition that a certain service module has problems, quickly reproduce the problems after the system is detected to have problems, accurately position the service module with the problems, have strong traceability and reproducibility, and have strong testing flexibility and pertinence.

Description

Method and device for testing system robustness
Technical Field
The invention relates to the technical field of computers, in particular to a method and a device for testing the robustness of a system.
Background
The robustness of the current test service system is generally to simulate the robustness of the service system when communication abnormity occurs among system modules by simulating ZK (zookeeper, distributed application program coordination service) abnormity; or, a TC (Traffic control, a Traffic control tool) is used to simulate the robustness of the whole service system when network delay occurs or network packet loss occurs during the data interaction between a certain module and other modules. The robustness testing method is to send some requests to the whole service system, check whether the sent requests can be returned normally when ZK abnormity exists or network abnormity exists, and check whether the module without problems still works.
In the process of implementing the invention, the inventor finds that at least the following problems exist in the prior art:
1. the robustness of the system is tested by simulating the ZK abnormity, a certain module can not work at all or one module can not find a downstream module due to some reason, and the problem simulated by the simulation mode is a serious system problem and is rare in practical application;
2. the result is relatively random by TC simulation of network packet loss or delay, and the system problem simulated by the method is relatively difficult to reproduce;
3. the existing method for testing the robustness of the system cannot record the service module with the problem in a targeted manner.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method and an apparatus for testing robustness of a system, which can specifically simulate a situation where a certain service module has a problem, and quickly reproduce the problem after detecting that the system has the problem, so as to accurately locate the service module having the problem, and the method and the apparatus have strong traceability and reproducibility, and are strong in testing flexibility and pertinence.
To achieve the above object, according to an aspect of an embodiment of the present invention, there is provided a method of testing robustness of a system.
A method of testing the robustness of a system, comprising: introducing the online flow into a tested service module of the system; modifying the data request path of the tested service module to point to a pre-deployed data agent module so as to modify the data requested by the tested data module and return the modified data to the tested service module; and in the process of carrying out service processing by the tested service module according to the modified data, acquiring and analyzing the operating data of the tested service module so as to test the robustness of the system.
Optionally, the method further comprises: analyzing a configuration file of the system to obtain a corresponding relation between the service modules and the data modules, wherein each service module corresponds to one or more data modules; and determining the tested service module and the tested data module according to the service requirements.
Optionally, after determining the tested service module and the tested data module according to the service requirement, the method further includes: the deployment of the data agent module is realized by replacing the data module in the data modification logic code of the data agent module with the tested data module and then compiling the code.
Optionally, the module for introducing the online traffic into the tested service of the system includes: and modifying an access path of the online traffic to introduce the online traffic into the tested service module.
Optionally, modifying the data request path of the tested service module to point to a pre-deployed data proxy module includes: and modifying the name space of the tested service module and the name space of the data agent module needing to be accessed so as to modify the data request path of the tested service module to point to the pre-deployed data agent module.
Optionally, modifying the data requested by the data module under test comprises: extracting a data module identifier from the data request of the tested service module; if the data module identification is empty or the data module identification is the same as the identification of the tested data module, generating a random number; and when the random number is a designated value, modifying the data in the data module to be tested.
Optionally, modifying the data requested by the data module under test comprises: extracting a data module identifier from the data request of the tested service module; if the data module identification is empty or the data module identification is the same as the identification of the tested data module, increasing the data request times by 1; and when the data request times reach a specified value, modifying the data in the tested data module.
According to another aspect of the embodiments of the present invention, there is provided an apparatus for testing robustness of a system.
An apparatus for testing the robustness of a system, comprising: the flow introducing unit is used for introducing the online flow into a tested service module of the system; the data modification unit is used for modifying the data request path of the tested service module to point to a pre-deployed data proxy module so as to modify the data requested by the tested data module and return the modified data to the tested service module; and the data monitoring unit is used for collecting and analyzing the operation data of the tested service module in the process of carrying out service processing on the tested service module according to the modified data so as to test the robustness of the system.
According to yet another aspect of an embodiment of the present invention, there is provided an electronic device for testing robustness of a system.
An electronic device for testing system robustness, comprising: one or more processors; a storage device, configured to store one or more programs, which when executed by the one or more processors, cause the one or more processors to implement the method for testing system robustness provided by the embodiments of the present invention.
According to yet another aspect of embodiments of the present invention, a computer-readable medium is provided.
A computer readable medium having stored thereon a computer program which, when executed by a processor, implements a method of testing system robustness as provided by embodiments of the invention.
One embodiment of the above invention has the following advantages or benefits: introducing online flow into a tested service module of the system; modifying a data request path of a tested service module to point to a pre-deployed data agent module so as to modify data requested by the tested data module and returning the modified data to the tested service module; in the process of carrying out service processing by the tested service module according to the modified data, the operation data of the tested service module is collected and analyzed to test the robustness of the system, so that the condition that a certain service module has a problem can be simulated in a targeted manner, the problem can be rapidly reproduced after the system is detected to have the problem, the service module with the problem is accurately positioned, and the traceability and the reproducibility are strong. Moreover, the method for testing the robustness of the system can not only carry out daily regression testing of the robustness of the system, but also meet special robustness testing of the system according to actual testing requirements, can automatically and clearly record the reasons of abnormity in the testing process, accurately simulates specific problems of a certain service module, and has strong testing flexibility and pertinence.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a schematic diagram of the main steps of a method of testing the robustness of a system according to an embodiment of the present invention;
FIG. 2 is an overall flow diagram of testing system robustness of one embodiment of the present invention;
FIG. 3 is a schematic diagram of fetch logic of a conventional data broker module;
FIG. 4 is a schematic diagram of fetch logic for a data agent module according to an embodiment of the present invention;
FIG. 5 is a data modification logic diagram of the data agent module of one embodiment of the present invention;
FIG. 6 is a schematic diagram of the main blocks of an apparatus for testing the robustness of a system according to an embodiment of the present invention;
FIG. 7 is an exemplary system architecture diagram in which embodiments of the present invention may be employed;
fig. 8 is a schematic structural diagram of a computer system suitable for implementing a terminal device or a server according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
In order to solve the problems in the prior art, the invention provides a method and a device for testing the robustness of a system, which can specifically simulate the situation that a certain service module has problems, and test the robustness of the system by collecting and analyzing the operation data of the service module. The method for testing the robustness of the system can quickly reproduce the problem after detecting the problem of the system, accurately position the service module with the problem and have strong traceability. Moreover, the method for testing the robustness of the system can not only carry out daily regression testing of the robustness of the system, but also meet special robustness testing of the system according to actual testing requirements, can accurately simulate specific problems of a certain service module, and has strong testing flexibility and pertinence.
FIG. 1 is a schematic diagram of the main steps of a method for testing the robustness of a system according to an embodiment of the present invention. As shown in fig. 1, the method for testing the robustness of the system according to the embodiment of the present invention mainly includes the following steps S101 to S103.
Step S101: introducing the online flow into a tested service module of the system;
step S102: modifying a data request path of a tested service module to point to a pre-deployed data agent module so as to modify data requested by the tested data module and returning the modified data to the tested service module;
step S103: and in the process of carrying out service processing by the tested service module according to the modified data, acquiring and analyzing the operating data of the tested service module so as to test the robustness of the system.
According to the above steps S101 and S103, the influence on the service module by each data module can be tested, so that the service module of the system and the corresponding data module can be processed to enhance the robustness of the system.
According to an embodiment of the invention, the method for testing the robustness of the system may further comprise:
analyzing a configuration file of the system to obtain a corresponding relation between the service modules and the data modules, wherein each service module corresponds to one or more data modules;
and determining the tested service module and the tested data module according to the service requirements.
According to another embodiment of the present invention, after the tested service module and the tested data module are determined according to the service requirement, the data module in the data modification logic code of the data agent module may be replaced by the tested data module, and then the code compiling is performed to implement the deployment of the data agent module. After the deployment of the data agent module is completed, the data to be acquired by the tested service module can be modified and the like through the data agent module. Generally, when a service module needs to query and acquire data from a database, a data proxy module may be deployed in advance, and is located in an intermediate layer between the service module and the database, and the data proxy module searches for data corresponding to the service module from the database according to a data request of the service module, then modifies the searched data according to a data modification logic of the data proxy module, and returns the modified data to the service module.
According to another embodiment of the present invention, when introducing the online traffic into the tested service module of the system, a specific implementation manner is, for example: and modifying an access path of the online traffic to introduce the online traffic into the tested service module.
According to another embodiment of the present invention, when the data request path of the tested service module is modified to point to the pre-deployed data proxy module, the following specific steps may be performed: and modifying the name space of the tested service module and the name space of the data agent module needing to be accessed so as to modify the data request path of the tested service module to point to the pre-deployed data agent module.
In one embodiment of the present invention, the process of modifying the data requested by the data module under test may include the following steps, for example:
extracting a data module identifier from a data request of a tested service module;
if the data module identification is empty or the data module identification is the same as the identification of the data module to be tested, generating a random number;
when the random number is a designated value, the data in the data module under test is modified.
In one embodiment of the present invention, the process of modifying the data requested by the data module under test may include the following steps, for example:
extracting a data module identifier from a data request of a tested service module;
if the data module identification is empty or the data module identification is the same as the identification of the tested data module, increasing the data request times by 1;
and when the data request times reach a specified value, modifying the data in the tested data module.
FIG. 2 is an overall flow diagram of testing the robustness of the system of one embodiment of the present invention. As shown in fig. 2, when performing the system robustness test, in actual implementation, the following operations are mainly included.
1. And (3) relationship combing: the method is mainly used for acquiring the corresponding relation between the business module and the data module according to the system configuration file. Mainly comprises the following steps:
(1) analyzing a service processing logic configuration file of a service module to obtain the relationship between the service module and the logic processing module, wherein each service module may correspond to one or more logic processing modules;
(2) analyzing the service module configuration file to obtain the relation between logic processing modules and data modules, wherein each logic processing module may correspond to one or more data modules;
(3) obtaining the corresponding relation between the business modules and the data modules according to the results of (1) and (2), wherein each business module corresponds to one or more data modules;
(4) and storing the result of the corresponding relation in a database in a key-value form.
2. Selecting a test object: and selecting a service module to be tested as a tested service module according to the test requirement, selecting a certain corresponding data module as a tested data module according to the corresponding relation between the service module and the data module, and then taking the tested service module and the tested data module as a test object of the test and recording the test object.
3. A deployment data agent module: and obtaining a tested data module according to the selected test object, performing table name replacement and code compilation in the data modification logic according to the identifier of the tested data module (in general, the data module is a data table, so the identifier of the tested data module is, for example, the table name of the tested data module), and after the compilation is successful, replacing the program Lib packet dependent on service operation and the configuration file Config packet dependent on service operation to a specified test machine and deploying the data agent module on the test machine.
FIG. 3 is a schematic diagram of fetch logic of a conventional data broker module. As shown in fig. 3, the data agent module reads the relevant data from the bottom-layer cache and then directly returns the data to the upper-layer tested service module through the interface.
Fig. 4 is a schematic diagram of the fetch logic of the data agent module according to an embodiment of the present invention. As shown in fig. 4, in the embodiment of the present invention, a data modification logic for modifying data is added in the data proxy module, and after the data proxy module reads relevant data from the bottom-layer cache, the read data is modified in a targeted manner according to the data modification logic, and then the modified data is returned to the upper-layer tested service module through the interface.
The data modification logic of the data agent module can be seen in fig. 5. FIG. 5 is a data modification logic diagram of the data agent module of one embodiment of the present invention. As shown in FIG. 5, in one embodiment of the present invention, the data modification logic essentially comprises the following steps:
(1) after receiving the data request, the data proxy module analyzes the data request, and first obtains a table name of a data module corresponding to the data request of the tested service module, namely: acquiring data of which data table is read from a data module of bottom-layer storage data at this time;
(2) acquiring a table name preset in the data modification logic code, if the table name is NULL, not limiting the table name, and the content in any data table may need to be modified;
(3) judging whether the table name of the data module acquired in the step (1) is the same as the table name preset in the data modification logic code, if so, indicating that data modification is required, otherwise, directly acquiring data from the database and outputting an interface message, wherein the interface message comprises returned data;
(4) when the system robustness is tested, if all data stored in one data module is modified, the influence of the data module on the service module when part of data in the data module has a problem cannot be reflected, so that in order to test the influence of part of returned data in the system on the service module when the part of the returned data has the problem, the probability of data modification is limited in a code, for example: assuming that the probability of data modification is set to 5% (if the value is set too large, the modified content is too much, which eventually results in no recall of the relevant logic, and if it is too small, the anomaly is ignored with a greater probability, and the triggering system anomaly probability is smaller, so here, 5% is chosen based on experimental experience). Then, in this embodiment of the present invention, each time data modification is to be performed, the probability of the data modification is limited to about 5% by generating a random number between 1 and 20 and determining whether the value of the random number is equal to 5;
(5) if the value of the random number is equal to 5, modifying the data, generating an interface message according to the modified data, and then outputting the interface message, wherein the interface message comprises the returned modified data.
When data modification is performed, the data modification logic may be a numerical value of modified data, a type of modified data, an operation rule of modified data, or the like. For example: if a certain field "data type" is modified from integer int type to string str type, the service module will prompt that the data type is inconsistent when performing data analysis.
4. The pressure measurement monitoring mainly comprises the following steps:
(1) introducing test traffic
Acquiring the service logic of a test environment according to a tested service module in a selected test object, then introducing flow from the online according to an agreed query rate per second (queries per second), and making some modifications which are in accordance with the test environment on an access path url of the introduced flow to ensure that the introduced flow is sent to the test environment and relevant results are not written into an online log system;
(2) deployment of test environments
In the embodiment, the test adopts an end-to-end test concept, and the deployment of the test environment is completed by modifying the namespace of the tested service module and the namespace of the data agent module needing to be accessed. The deployment can ensure that the tested service module can access the tester deployed by the appointed data agent module, and only bears the appointed introduction flow, and other modules of the system are all configured on line without special deployment;
(3) monitoring and collecting module
After the monitoring and collecting module acquires the tested service module of the test, the external service module and the tested service module end of the system monitor the availability of the tested service module, the CPU, the memory and the network inflow and outflow of the tester deployed by the tested service module, whether the tested service instance is alive, whether the port is monitored, the Young GC (cleaning the pile space of the Young generation) and the Full GC (cleaning the whole pile space including the Young generation and the permanent generation) of the machine, the change of the thread number and the like, and record the relevant results, so that the modification of which data module can influence the availability of the specific service module according to the test result, and the data of which data module has a problem and can influence the whole system, and the like. In the system robustness regression test, test data can be collected every 30 minutes, and data collection is carried out according to a test time period in specific requirements. As shown in table 1 below, when there is a problem in the table data of 61-6, the availability of 61 the service module is affected, but the service module can still work normally.
TABLE 1
FIG. 6 is a schematic diagram of the main blocks of an apparatus for testing the robustness of a system according to an embodiment of the present invention. As shown in fig. 6, the apparatus 600 for testing system robustness according to the embodiment of the present invention mainly includes a traffic introducing unit 601, a data modifying unit 602, and a data monitoring unit 603.
A traffic import unit 601, configured to import online traffic into a tested service module of the system;
a data modification unit 602, configured to modify a data request path of the tested service module to point to a pre-deployed data proxy module, so as to modify data requested by the tested data module, and return the modified data to the tested service module;
and the data monitoring unit 603 is configured to collect and analyze the operation data of the tested service module in the process of performing service processing on the tested service module according to the modified data, so as to test the robustness of the system.
According to an embodiment of the present invention, the apparatus 600 for testing system robustness may further include a test object determining unit (not shown in the figure) for:
analyzing a configuration file of the system to obtain a corresponding relation between the service modules and the data modules, wherein each service module corresponds to one or more data modules;
and determining the tested service module and the tested data module according to the service requirements.
According to another embodiment of the present invention, the apparatus 600 for testing system robustness may further include an agent deploying unit (not shown in the figure) for:
after a tested service module and a tested data module are determined according to service requirements, the data module in the data modification logic code of the data agent module is replaced by the tested data module, and then code compiling is carried out, so that the deployment of the data agent module is realized.
According to yet another embodiment of the present invention, the flow introducing unit 601 may further be configured to:
and modifying an access path of the online traffic to introduce the online traffic into the tested service module.
According to yet another embodiment of the present invention, the data modification unit 602 may be further configured to:
and modifying the name space of the tested service module and the name space of the data agent module needing to be accessed so as to modify the data request path of the tested service module to point to the pre-deployed data agent module.
According to an embodiment of the present invention, the data modification unit 602 may further be configured to:
extracting a data module identifier from the data request of the tested service module;
if the data module identification is empty or the data module identification is the same as the identification of the tested data module, generating a random number;
and when the random number is a designated value, modifying the data in the data module to be tested.
According to yet another embodiment of the present invention, the data modification unit 602 may be further configured to:
extracting a data module identifier from the data request of the tested service module;
if the data module identification is empty or the data module identification is the same as the identification of the tested data module, increasing the data request times by 1;
and when the data request times reach a specified value, modifying the data in the tested data module.
According to the technical scheme of the embodiment of the invention, online flow is introduced into a tested service module of the system; modifying a data request path of a tested service module to point to a pre-deployed data agent module so as to modify data requested by the tested data module and returning the modified data to the tested service module; in the process of carrying out service processing by the tested service module according to the modified data, the operation data of the tested service module is collected and analyzed to test the robustness of the system, so that the condition that a certain service module has a problem can be simulated in a targeted manner, the problem can be rapidly reproduced after the system is detected to have the problem, the service module with the problem is accurately positioned, and the traceability and the reproducibility are strong. Moreover, the method for testing the robustness of the system can not only carry out daily regression testing of the robustness of the system, but also meet special robustness testing of the system according to actual testing requirements, can automatically and clearly record the reasons of abnormity in the testing process, accurately simulates specific problems of a certain service module, and has strong testing flexibility and pertinence.
FIG. 7 illustrates an exemplary system architecture 700 to which the method for testing system robustness or the apparatus for testing system robustness of embodiments of the present invention may be applied.
As shown in fig. 7, the system architecture 700 may include terminal devices 701, 702, 703, a network 704, and a server 705. The network 704 serves to provide a medium for communication links between the terminal devices 701, 702, 703 and the server 705. Network 704 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
A user may use the terminal devices 701, 702, 703 to interact with a server 705 over a network 704, to receive or send messages or the like. The terminal devices 701, 702, 703 may have installed thereon various communication client applications, such as a shopping-like application, a web browser application, a search-like application, an instant messaging tool, a mailbox client, social platform software, etc. (by way of example only).
The terminal devices 701, 702, 703 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 705 may be a server providing various services, such as a background management server (for example only) providing support for shopping websites browsed by users using the terminal devices 701, 702, 703. The backend management server may analyze and perform other processing on the received data such as the product information query request, and feed back a processing result (for example, target push information, product information — just an example) to the terminal device.
It should be noted that the method for testing the robustness of the system provided by the embodiment of the present invention is generally executed by the server 705, and accordingly, the apparatus for testing the robustness of the system is generally disposed in the server 705.
It should be understood that the number of terminal devices, networks, and servers in fig. 7 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 8, shown is a block diagram of a computer system 800 suitable for use with a terminal device or server implementing an embodiment of the present invention. The terminal device or the server shown in fig. 8 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 8, the computer system 800 includes a Central Processing Unit (CPU)801 that can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)802 or a program loaded from a storage section 808 into a Random Access Memory (RAM) 803. In the RAM 803, various programs and data necessary for the operation of the system 800 are also stored. The CPU 801, ROM 802, and RAM 803 are connected to each other via a bus 804. An input/output (I/O) interface 805 is also connected to bus 804.
The following components are connected to the I/O interface 805: an input portion 806 including a keyboard, a mouse, and the like; an output section 807 including a signal such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage portion 808 including a hard disk and the like; and a communication section 809 including a network interface card such as a LAN card, a modem, or the like. The communication section 809 performs communication processing via a network such as the internet. A drive 810 is also connected to the I/O interface 805 as necessary. A removable medium 811 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 810 as necessary, so that a computer program read out therefrom is mounted on the storage section 808 as necessary.
In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication section 809 and/or installed from the removable medium 811. The computer program executes the above-described functions defined in the system of the present invention when executed by the Central Processing Unit (CPU) 801.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units or modules described in the embodiments of the present invention may be implemented by software, or may be implemented by hardware. The described units or modules may also be provided in a processor, and may be described as: a processor includes a traffic introduction unit, a data modification unit, and a data monitoring unit. The names of these units or modules do not in some cases form a limitation on the units or modules themselves, for example, the traffic introduction unit may also be described as "a unit for introducing online traffic into a service module under test of the system".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to comprise: introducing the online flow into a tested service module of the system; modifying the data request path of the tested service module to point to a pre-deployed data agent module so as to modify the data requested by the tested data module and return the modified data to the tested service module; and in the process of carrying out service processing by the tested service module according to the modified data, acquiring and analyzing the operating data of the tested service module so as to test the robustness of the system.
According to the technical scheme of the embodiment of the invention, online flow is introduced into a tested service module of the system; modifying a data request path of a tested service module to point to a pre-deployed data agent module so as to modify data requested by the tested data module and returning the modified data to the tested service module; in the process of carrying out service processing by the tested service module according to the modified data, the operation data of the tested service module is collected and analyzed to test the robustness of the system, so that the condition that a certain service module has a problem can be simulated in a targeted manner, the problem can be rapidly reproduced after the system is detected to have the problem, the service module with the problem is accurately positioned, and the traceability and the reproducibility are strong. Moreover, the method for testing the robustness of the system can not only carry out daily regression testing of the robustness of the system, but also meet special robustness testing of the system according to actual testing requirements, can automatically and clearly record the reasons of abnormity in the testing process, accurately simulates specific problems of a certain service module, and has strong testing flexibility and pertinence.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A method of testing the robustness of a system, comprising:
introducing the online flow into a tested service module of the system;
modifying the data request path of the tested service module to point to a pre-deployed data agent module so as to modify the data requested by the tested data module and return the modified data to the tested service module;
and in the process of carrying out service processing by the tested service module according to the modified data, acquiring and analyzing the operating data of the tested service module so as to test the robustness of the system.
2. The method of claim 1, further comprising:
analyzing a configuration file of the system to obtain a corresponding relation between the service modules and the data modules, wherein each service module corresponds to one or more data modules;
and determining the tested service module and the tested data module according to the service requirements.
3. The method according to claim 1 or 2, wherein after determining the tested service module and the tested data module according to the service requirement, the method further comprises:
the deployment of the data agent module is realized by replacing the data module in the data modification logic code of the data agent module with the tested data module and then compiling the code.
4. The method of claim 1 or 2, wherein introducing the on-line traffic into the system's traffic module under test comprises:
and modifying an access path of the online traffic to introduce the online traffic into the tested service module.
5. The method of claim 1 or 2, wherein modifying the data request path of the tested service module to point to a pre-deployed data broker module comprises:
and modifying the name space of the tested service module and the name space of the data agent module needing to be accessed so as to modify the data request path of the tested service module to point to the pre-deployed data agent module.
6. The method of claim 1, wherein modifying the data requested by the data module under test comprises:
extracting a data module identifier from the data request of the tested service module;
if the data module identification is empty or the data module identification is the same as the identification of the tested data module, generating a random number;
and when the random number is a designated value, modifying the data in the data module to be tested.
7. The method of claim 1, wherein modifying the data requested by the data module under test comprises:
extracting a data module identifier from the data request of the tested service module;
if the data module identification is empty or the data module identification is the same as the identification of the tested data module, increasing the data request times by 1;
and when the data request times reach a specified value, modifying the data in the tested data module.
8. An apparatus for testing system robustness, comprising:
the flow introducing unit is used for introducing the online flow into a tested service module of the system;
the data modification unit is used for modifying the data request path of the tested service module to point to a pre-deployed data proxy module so as to modify the data requested by the tested data module and return the modified data to the tested service module;
and the data monitoring unit is used for collecting and analyzing the operation data of the tested service module in the process of carrying out service processing on the tested service module according to the modified data so as to test the robustness of the system.
9. An electronic device for testing system robustness, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-7.
10. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-7.
CN201911302996.0A 2019-12-17 2019-12-17 Method and device for testing system robustness Pending CN112988560A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911302996.0A CN112988560A (en) 2019-12-17 2019-12-17 Method and device for testing system robustness

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911302996.0A CN112988560A (en) 2019-12-17 2019-12-17 Method and device for testing system robustness

Publications (1)

Publication Number Publication Date
CN112988560A true CN112988560A (en) 2021-06-18

Family

ID=76342315

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911302996.0A Pending CN112988560A (en) 2019-12-17 2019-12-17 Method and device for testing system robustness

Country Status (1)

Country Link
CN (1) CN112988560A (en)

Similar Documents

Publication Publication Date Title
US20060085420A1 (en) Method and apparatus for monitoring real users experience with a website
US9003235B2 (en) Indicating coverage of web application testing
CN108304410A (en) A kind of detection method, device and the data analysing method of the abnormal access page
CN111625473A (en) Interface test case generation method and device, storage medium and electronic equipment
US10775751B2 (en) Automatic generation of regular expression based on log line data
CN110750458A (en) Big data platform testing method and device, readable storage medium and electronic equipment
CN109829121B (en) Method and device for reporting click behavior data
CN110928934A (en) Data processing method and device for business analysis
US20080162687A1 (en) Data acquisition system and method
CN107391528B (en) Front-end component dependent information searching method and equipment
CN112988560A (en) Method and device for testing system robustness
CN109862074B (en) Data acquisition method and device, readable medium and electronic equipment
CN113326188A (en) Browser testing method and device
CN112579428A (en) Interface testing method and device, electronic equipment and storage medium
CN113254325A (en) Test case processing method and device
CN109376066A (en) A kind of automatic test approach and device
CN112749078A (en) Buried point testing method and device
CN111767447A (en) Method and device for determining user traffic path
CN111666201A (en) Regression testing method, device, medium and electronic equipment
CN113448985A (en) API (application program interface) interface generation method, calling method and device and electronic equipment
CN112783754A (en) Method and device for testing page
CN110858172A (en) Automatic test code generation method and device
CN111767486A (en) Method, device, electronic equipment and computer readable medium for displaying page
CN112035425A (en) Log storage method and device and computer system
CN113760715A (en) Method and device for testing system

Legal Events

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