Method and device for testing system robustness

By introducing online traffic into the service module under test and modifying its data request path, using the data proxy module to simulate a problem with the service module, it solves the problem of reproducing the robustness of the test system in the existing technology, and realizes flexibility and traceability test results.

CN112988560BActive Publication Date: 2024-11-15BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN201911302996.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-12-17
Publication Date
2024-11-15
Estimated Expiration
2039-12-17

AI Technical Summary

Technical Problem

When testing system robustness, the existing technology has difficulty reproducing problems by simulating ZK exceptions or TC to simulate network packet loss/delay, and it is impossible to record problematic business modules in a targeted manner, and the testing flexibility and reproducibility are insufficient.

Method used

By introducing online traffic into the service module under test and modifying its data request path to point to the pre-deployed data proxy module, data modification and collection analysis are carried out to simulate problems in the service module and quickly locate the source of the problem.

Benefits of technology

It realizes targeted and flexible testing of system robustness, can quickly reproduce problems and accurately locate business modules that have problems, and has strong traceability and reproducibility.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112988560B_ABST
    Figure CN112988560B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and device for testing the robustness of a system, and relates to the field of computer technology. A specific implementation of the method includes: introducing online traffic into a tested business module of the system; modifying the data request path of the tested business module to point to a pre-deployed data proxy module to modify the data requested by the tested data module, and returning the modified data to the tested business module; in the process of the tested business module performing business processing according to the modified data, collecting and analyzing the operating data of the tested business module to test the robustness of the system. This implementation can simulate the situation where a problem occurs in a certain business module in a targeted manner, and after detecting a problem with the system, quickly reproduce the problem and accurately locate the business module with the problem, and has strong traceability and reproducibility, and the test flexibility and targeting are very strong.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method and device for testing system robustness. Background Art

[0002] At present, the robustness of the business system is generally tested by simulating ZK (zookeeper, a distributed application coordination service) exceptions to simulate the robustness of the business system when communication anomalies occur between system modules; or by simulating the robustness of the entire business system when network delays or network packet loss occur during data interaction between a module and other modules through TC (Trafficcontrol, a traffic control tool). The robustness test method is to send some requests to the entire business system to check whether the requests sent can be returned normally when there are ZK anomalies or network anomalies, and whether the modules without problems are still working.

[0003] In the process of implementing the present invention, the inventors found that there are at least the following problems in the prior art:

[0004] 1. Test the robustness of the system by simulating ZK anomalies. This simulates a module that is completely unable to work or a module that cannot find its downstream module for some reason. The problems simulated by this simulation method are very serious system problems and are rare in actual applications.

[0005] 2. When TC is used to simulate network packet loss or delay, the results are relatively random. System problems simulated in this way are difficult to reproduce.

[0006] 3. The existing method of testing system robustness cannot specifically record problematic business modules. Summary of the invention

[0007] In view of this, an embodiment of the present invention provides a method and device for testing the robustness of a system, which can simulate the situation where a problem occurs in a certain business module in a targeted manner, and after detecting a problem with the system, quickly reproduce the problem and accurately locate the business module where the problem occurs. It has strong traceability and reproducibility, and the test flexibility and targeting are very strong.

[0008] To achieve the above objective, according to one aspect of an embodiment of the present invention, a method for testing system robustness is provided.

[0009] A method for testing system robustness, comprising: introducing online traffic into a tested business module of the system; modifying the data request path of the tested business module to point to a pre-deployed data proxy module to modify the data requested by the tested data module, and returning the modified data to the tested business module; while the tested business module performs business processing according to the modified data, collecting and analyzing the operating data of the tested business module to test the system robustness.

[0010] Optionally, the method further includes: parsing a configuration file of the system to obtain a correspondence between business modules and data modules, wherein each business module corresponds to one or more data modules; and determining a tested business module and a tested data module according to business requirements.

[0011] Optionally, after determining the tested business module and the tested data module according to business requirements, it also includes: replacing the data module in the data modification logic code of the data proxy module with the tested data module, and then compiling the code to implement the deployment of the data proxy module.

[0012] Optionally, introducing the online traffic into the tested service module of the system includes: introducing the online traffic into the tested service module by modifying an access path of the online traffic.

[0013] Optionally, modifying the data request path of the business module under test to point to a pre-deployed data proxy module includes: modifying the data request path of the business module under test to point to a pre-deployed data proxy module by modifying the namespace of the business module under test and the namespace of the data proxy module to be accessed.

[0014] Optionally, modifying the data requested by the data module under test includes: extracting a data module identifier from the data request of the business module under test; if the data module identifier is empty or the data module identifier is the same as the identifier of the data module under test, generating a random number; when the random number is a specified value, modifying the data in the data module under test.

[0015] Optionally, modifying the data requested by the data module under test includes: extracting a data module identifier from the data request of the business module under test; if the data module identifier is empty or the data module identifier is the same as the identifier of the data module under test, increasing the number of data requests by 1; when the number of data requests reaches a specified value, modifying the data in the data module under test.

[0016] According to another aspect of an embodiment of the present invention, a device for testing system robustness is provided.

[0017] A device for testing the robustness of a system, comprising: a traffic introduction unit, used to introduce online traffic into a tested business module of the system; a data modification unit, used to modify the data request path of the tested business 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 business module; a data monitoring unit, used to collect and analyze the operating data of the tested business module during the process of the tested business module performing business processing according to the modified data, so as to test the robustness of the system.

[0018] According to yet another aspect of an embodiment of the present invention, an electronic device for testing system robustness is provided.

[0019] An electronic device for testing system robustness, comprising: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors implement the method for testing system robustness provided by an embodiment of the present invention.

[0020] According to yet another aspect of an embodiment of the present invention, a computer readable medium is provided.

[0021] A computer readable medium stores a computer program, which, when executed by a processor, implements a method for testing system robustness provided by an embodiment of the present invention.

[0022] An embodiment of the above invention has the following advantages or beneficial effects: by introducing online traffic into the tested business module of the system; modifying the data request path of the tested business module to point to the pre-deployed data proxy module to modify the data requested by the tested data module, and returning the modified data to the tested business module; in the process of the tested business module performing business processing according to the modified data, collecting and analyzing the operation data of the tested business module to test the system robustness, it can specifically simulate the situation where a certain business module has a problem, and after detecting that the system has a problem, quickly reproduce the problem, accurately locate the business module with the problem, and have strong traceability and reproducibility. In addition, the method for testing the robustness of the system of the present invention can not only perform daily system robustness regression testing, but also meet special system robustness testing according to actual testing requirements, and can automatically and clearly record the causes of abnormalities in the test process, accurately simulate specific problems that occur in a certain business module, and have strong test flexibility and pertinence.

[0023] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.

[0025] Figure 1 is a schematic diagram of main steps of a method for testing system robustness according to an embodiment of the present invention;

[0026] Figure 2 It is a schematic diagram of the overall process of testing the robustness of a system according to an embodiment of the present invention;

[0027] Figure 3 It is a logical diagram of data acquisition of the existing data proxy module;

[0028] Figure 4 is a schematic diagram of data acquisition logic of a data proxy module according to an embodiment of the present invention;

[0029] Figure 5 is a data modification logic diagram of a data proxy module according to an embodiment of the present invention;

[0030] Figure 6 is a schematic diagram of main modules of a device for testing system robustness according to an embodiment of the present invention;

[0031] Figure 7 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;

[0032] Figure 8 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION

[0033] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0034] In order to solve the problems existing in the prior art, the present invention provides a method and device for testing the robustness of a system, which can specifically simulate the situation where a problem occurs in a certain business module, and test the robustness of the system by collecting and analyzing the operation data of the business module. The method for testing the robustness of a system of the present invention can quickly reproduce the problem after detecting that a problem occurs in the system, and accurately locate the business module where the problem occurs, and has strong traceability. In addition, the method for testing the robustness of a system of the present invention can be used for daily system robustness regression testing, and can also meet special system robustness testing according to actual testing requirements, and can accurately simulate specific problems that occur in a certain business module, and the test flexibility and pertinence are very strong.

[0035] Figure 1 FIG. 1 is a schematic diagram of the main steps of a method for testing system robustness according to an embodiment of the present invention. Figure 1 As shown, the method for testing system robustness according to the embodiment of the present invention mainly includes the following steps S101 to S103.

[0036] Step S101: introducing online traffic into the tested service module of the system;

[0037] Step S102: modifying the data request path of the tested business module to point to the pre-deployed data proxy module, so as to modify the data requested by the tested data module, and returning the modified data to the tested business module;

[0038] Step S103: While the tested service module is processing services according to the modified data, the operation data of the tested service module is collected and analyzed to test the robustness of the system.

[0039] According to the above-mentioned step S101 and step S103, the influence of each data module on the business module can be tested, so that the business module of the system and the corresponding data module can be processed to enhance the robustness of the system.

[0040] According to one embodiment of the present invention, the method for testing system robustness may further include:

[0041] The corresponding relationship between the business module and the data module is obtained by parsing the configuration file of the system, wherein each business module corresponds to one or more data modules;

[0042] Determine the business module and data module to be tested based on business requirements.

[0043] According to another embodiment of the present invention, after determining the tested business module and the tested data module according to business requirements, the data module in the data modification logic code of the data proxy module can be replaced with the tested data module, and then the code is compiled to realize the deployment of the data proxy module. After the deployment of the data proxy module is completed, the data to be obtained by the tested business module can be modified and processed by the data proxy module. Generally, when the business module needs to query and obtain data from the database, a data proxy module can be pre-deployed, located in the middle layer between the business module and the database, and the corresponding required data is found from the database according to the data request of the business module, and then the found data is modified according to the data modification logic of the data proxy module, and the modified data is returned to the business module.

[0044] According to another embodiment of the present invention, when introducing online traffic into the tested service module of the system, a specific implementation method is, for example, to introduce the online traffic into the tested service module by modifying the access path of the online traffic.

[0045] According to another embodiment of the present invention, when the data request path of the business module under test is modified to point to a pre-deployed data proxy module, specifically: by modifying the namespace of the business module under test and the namespace of the data proxy module that needs to be accessed, the data request path of the business module under test is modified to point to the pre-deployed data proxy module.

[0046] In one embodiment of the present invention, the process of modifying the data requested by the tested data module may include the following steps:

[0047] Extracting a data module identifier from a data request of the business module under test;

[0048] If the data module identifier is empty or the data module identifier is the same as the identifier of the data module being tested, a random number is generated;

[0049] When the random number is a specified value, the data in the tested data module is modified.

[0050] In one embodiment of the present invention, the process of modifying the data requested by the tested data module may include the following steps:

[0051] Extracting a data module identifier from a data request of the business module under test;

[0052] If the data module identifier is empty or the data module identifier is the same as the identifier of the data module being tested, the number of data requests is increased by 1;

[0053] When the number of data requests reaches a specified value, the data in the data module under test is modified.

[0054] Figure 2 FIG. 1 is a schematic diagram of the overall process of testing the robustness of a system according to an embodiment of the present invention. Figure 2 As shown, when conducting system robustness testing, in actual execution, it mainly includes the following operations.

[0055] 1. Relationship sorting: mainly used to obtain the corresponding relationship between business modules and data modules according to system configuration files. The main steps are as follows:

[0056] (1) By analyzing the business processing logic configuration files of the business modules, the relationship between the business modules and the logic processing modules is obtained, wherein each business module may correspond to one or more logic processing modules;

[0057] (2) By analyzing the business module configuration file, the relationship between the logic processing module and the data module is obtained, where each logic processing module may correspond to one or more data modules;

[0058] (3) Based on the results of (1) and (2), the corresponding relationship between the business modules and the data modules is obtained, and each business module corresponds to one or more data modules;

[0059] (4) The above correspondence results are saved in the database in the form of key-value.

[0060] 2. Select the test object: According to the test requirements, select the business module to be tested as the business module to be tested, and according to the correspondence between the business module and the data module, select a corresponding data module as the data module to be tested, and then use the business module to be tested and the data module to be tested as the test objects of this test and record the test objects.

[0061] 3. Deploy the data proxy module: Get the data module to be tested according to the selected test object, and replace the table name in the data modification logic and compile the code according to the identifier of the data module to be tested (generally, the data module is the data table, so the identifier of the data module to be tested is, for example, the table name of the data module to be tested). After successful compilation, replace the program Lib package that the service depends on and the configuration file Config package that the service depends on to the specified test machine and deploy the data proxy module on the test machine.

[0062] Figure 3 This is a schematic diagram of the data acquisition logic of the existing data proxy module. Figure 3 As shown, after the data proxy module reads the relevant data from the bottom cache, it directly returns the data to the upper-layer tested business module through the interface.

[0063] Figure 4FIG. 1 is a schematic diagram of the data acquisition logic of the data proxy module in an embodiment of the present invention. Figure 4 As shown, in an embodiment of the present invention, a data modification logic for modifying data is added to the data proxy module. When the data proxy module reads relevant data from the underlying cache, it first performs targeted modifications on the read data according to the data modification logic, and then returns the modified data to the upper-level business module under test through the interface.

[0064] The data modification logic of the data proxy module can be found in Figure 5 . Figure 5 FIG. 1 is a schematic diagram of data modification logic of a data proxy module according to an embodiment of the present invention. Figure 5 As shown, in one embodiment of the present invention, the data modification logic mainly includes the following steps:

[0065] (1) After receiving the data request, the data proxy module parses the data request and first obtains the table name of the data module corresponding to the data request of the business module under test, that is, obtains the data table whose data is read from the data module storing the underlying data;

[0066] (2) Get the table name preset in the data modification logic code. If the table name is NULL, the table name is not limited and the content in any data table may need to be modified.

[0067] (3) determining whether the table name of the data module obtained in step (1) is the same as the table name preset in the data modification logic code; if they are the same, data modification is required; otherwise, data is directly obtained from the database and an interface message is output, which includes the returned data;

[0068] (4) When performing system robustness testing, if all the data stored in a data module are modified, it is impossible to reflect the impact of the data module on the business module when problems occur in some of the data in the data module. Therefore, in order to test the impact of problems on the business module when some of the returned data in the system has problems, the probability of data modification is limited in the code. For example, assume that the probability of data modification is set to 5% (if the value is too large, too much content will be modified, which will eventually lead to no recall of related logic. If it is too small, the probability of the exception being ignored is high and the probability of triggering a system exception is low. Therefore, 5% is selected here based on experimental experience). Then, in this embodiment of the present invention, each time data modification is to be performed, a random number between 1 and 20 is generated, and it is determined whether the value of the random number is equal to 5. In this way, the probability of data modification can be limited to about 5%;

[0069] (5) If the value of the random number is equal to 5, the data is modified, and an interface message is generated according to the modified data, and then the interface message is output. The interface message includes the returned modified data.

[0070] When modifying data, the data modification logic can be to modify the value of the data, the type of the data, the operation rule of the data, etc. For example, if a field "data type" is changed from an integer int type to a string str type, the business module will prompt that the data type does not match when parsing the data.

[0071] 4. Stress testing monitoring mainly includes the following steps:

[0072] (1) Introducing test traffic

[0073] According to the tested business module in the selected test object, the business logic of the test environment is obtained. Then, traffic is introduced from the online system according to the agreed query rate per second (qps). The access path URL of the introduced traffic is modified to conform to the test environment to ensure that the introduced traffic hits the test environment and the relevant results are not written into the online log system.

[0074] (2) Deployment of the test environment

[0075] In this embodiment, the test adopts the end-to-end test concept, and the test environment is deployed by modifying the namespace of the tested business module and the namespace of the data proxy module that needs to be accessed. This deployment can ensure that the tested business module can access the test machine where the specified data proxy module is deployed, and only accept the specified incoming traffic. The rest of the modules in the system can be configured online without special deployment.

[0076] (3) Monitoring and collection module

[0077] After the monitoring and collection module obtains the tested business module of this test, it monitors the availability of the tested business module, the CPU, memory, network inflow and outflow of the test machine deployed by the tested business module, whether the tested business instance is alive, whether the port is listening, the machine's Young GC (refers to cleaning the young generation heap space) and Full GC (refers to cleaning the entire heap space - including the young generation and permanent generation), and changes in the number of threads from the system external service module and the tested business module, and records the relevant results. In this way, it is possible to find out which data module modification will affect the availability of the specific business module based on the test results, which data module has a problem with the data, and will affect the entire system, etc. In the system robustness regression test, test data can be collected every 30 minutes, and data collection can be performed according to the test time period in specific requirements. As shown in Table 1 below, when there is a problem with the table data of the data module 61-6, the availability of the business module 61 will be affected, but the business module can still work normally.

[0078] Table 1

[0079]

[0080]

[0081] Figure 6 Schematic diagram of the main modules of the apparatus for testing system robustness according to an embodiment of the present invention. Figure 6 As shown, the device 600 for testing system robustness according to the embodiment of the present invention mainly includes a traffic introduction unit 601 , a data modification unit 602 and a data monitoring unit 603 .

[0082] Traffic introduction unit 601, used to introduce online traffic into the tested service module of the system;

[0083] The data modification unit 602 is used to modify the data request path of the tested business module to point to the 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 business module;

[0084] The data monitoring unit 603 is used to collect and analyze the operation data of the tested service module when the tested service module performs service processing according to the modified data, so as to test the robustness of the system.

[0085] According to an embodiment of the present invention, the apparatus 600 for testing system robustness may further include a test object determination unit (not shown in the figure) for:

[0086] The corresponding relationship between the business module and the data module is obtained by parsing the configuration file of the system, wherein each business module corresponds to one or more data modules;

[0087] Determine the business module and data module to be tested based on business requirements.

[0088] According to another embodiment of the present invention, the apparatus 600 for testing system robustness may further include an agent deployment unit (not shown in the figure) for:

[0089] After determining the business module to be tested and the data module to be tested according to business requirements, the data module in the data modification logic code of the data proxy module is replaced with the data module to be tested, and then the code is compiled to implement the deployment of the data proxy module.

[0090] According to yet another embodiment of the present invention, the flow introduction unit 601 may also be used for:

[0091] The online traffic is introduced into the tested business module by modifying the access path of the online traffic.

[0092] According to yet another embodiment of the present invention, the data modification unit 602 may also be used to:

[0093] By modifying the namespace of the tested service module and the namespace of the data proxy module to be accessed, the data request path of the tested service module is modified to point to the pre-deployed data proxy module.

[0094] According to one embodiment of the present invention, the data modification unit 602 may also be used to:

[0095] Extracting a data module identifier from a data request of the tested service module;

[0096] If the data module identifier is empty or the data module identifier is the same as the identifier of the data module under test, a random number is generated;

[0097] When the random number is a specified value, the data in the tested data module is modified.

[0098] According to yet another embodiment of the present invention, the data modification unit 602 may also be used to:

[0099] Extracting a data module identifier from a data request of the tested service module;

[0100] If the data module identifier is empty or the data module identifier is the same as the identifier of the data module under test, the number of data requests is increased by 1;

[0101] When the number of data requests reaches a specified value, the data in the tested data module is modified.

[0102] According to the technical solution of the embodiment of the present invention, by introducing online traffic into the tested business module of the system; modifying the data request path of the tested business module to point to the pre-deployed data proxy module, modifying the data requested by the tested data module, and returning the modified data to the tested business module; in the process of the tested business module performing business processing according to the modified data, collecting and analyzing the operation data of the tested business module to test the system robustness, it is possible to simulate the situation where a certain business module has a problem in a targeted manner, and after detecting that the system has a problem, quickly reproduce the problem, and accurately locate the business module with the problem, which has strong traceability and reproducibility. In addition, the method for testing the robustness of the system of the present invention can not only perform daily system robustness regression testing, but also meet special system robustness testing according to actual testing requirements, and can automatically and clearly record the causes of abnormalities during the test process, accurately simulate specific problems that occur in a certain business module, and have strong test flexibility and pertinence.

[0103] Figure 7 An exemplary system architecture 700 is shown to which a method for testing system robustness or an apparatus for testing system robustness according to an embodiment of the present invention can be applied.

[0104] like Figure 7 As shown, system architecture 700 may include terminal devices 701, 702, 703, network 704 and server 705. Network 704 is used to provide a medium for communication links between terminal devices 701, 702, 703 and server 705. Network 704 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0105] Users can use terminal devices 701, 702, and 703 to interact with server 705 through network 704 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 701, 702, and 703, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only examples).

[0106] The terminal devices 701 , 702 , and 703 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers.

[0107] The server 705 may be a server that provides various services, such as a backend management server (only for example) that supports shopping websites browsed by users using the terminal devices 701, 702, and 703. The backend management server may analyze and process the received data such as product information query requests, and feed back the processing results (such as target push information, product information - only for example) to the terminal device.

[0108] It should be noted that the method for testing the robustness of a system provided in the embodiment of the present invention is generally executed by the server 705 , and accordingly, the device for testing the robustness of a system is generally disposed in the server 705 .

[0109] It should be understood that Figure 7 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0110] Reference below Figure 8 , which shows a schematic diagram of the structure of a computer system 800 of a terminal device or server suitable for implementing an embodiment of the present invention. Figure 8 The terminal device or server shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0111] like Figure 8 As shown, the computer system 800 includes a central processing unit (CPU) 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage part 808 into a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the system 800 are also stored. The CPU 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.

[0112] The following components are connected to the I / O interface 805: an input section 806 including a keyboard, a mouse, etc.; an output section 807 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card such as a LAN card, a modem, etc. 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 needed. A removable medium 811, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 810 as needed, so that a computer program read therefrom is installed into the storage section 808 as needed.

[0113] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 809, and / or installed from the removable medium 811. When the computer program is executed by the central processing unit (CPU) 801, the above-mentioned functions defined in the system of the present invention are executed.

[0114] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0115] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0116] The units or modules involved in the embodiments of the present invention may be implemented in software or hardware. The units or modules described may also be provided in a processor. For example, they may be described as follows: 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, constitute limitations on the units or modules themselves. For example, the traffic introduction unit may also be described as a "unit for introducing online traffic into the system's tested business module."

[0117] As another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiment; or it may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes: introducing online traffic into the tested business module of the system; modifying the data request path of the tested business module to point to a pre-deployed data proxy module to modify the data requested by the tested data module, and returning the modified data to the tested business module; in the process of the tested business module performing business processing according to the modified data, collecting and analyzing the operating data of the tested business module to test the robustness of the system.

[0118] According to the technical solution of the embodiment of the present invention, by introducing online traffic into the tested business module of the system; modifying the data request path of the tested business module to point to the pre-deployed data proxy module, modifying the data requested by the tested data module, and returning the modified data to the tested business module; in the process of the tested business module performing business processing according to the modified data, collecting and analyzing the operation data of the tested business module to test the system robustness, it is possible to simulate the situation where a certain business module has a problem in a targeted manner, and after detecting that the system has a problem, quickly reproduce the problem, and accurately locate the business module with the problem, which has strong traceability and reproducibility. In addition, the method for testing the robustness of the system of the present invention can not only perform daily system robustness regression testing, but also meet special system robustness testing according to actual testing requirements, and can automatically and clearly record the causes of abnormalities during the test process, accurately simulate specific problems that occur in a certain business module, and have strong test flexibility and pertinence.

[0119] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for testing system robustness, It is characterized in that include: Introduce online traffic into the system's business module under test; Modify the data request path of the tested business module to point to a pre-deployed data proxy module to modify the data requested by the tested data module, and return the modified data to the tested business module; In the process of the tested service module performing service processing according to the modified data, the operation data of the tested service module is collected and analyzed to test the robustness of the system; Among them, modifying the data request path of the tested business module to point to a pre-deployed data proxy module to modify the data requested by the tested data module includes: replacing the data module in the data modification logic code of the data proxy module with the tested data module, and then compiling the code to realize the deployment of the data proxy module; when the tested business module queries and obtains data from the database, the data proxy module searches for the corresponding required data from the database according to the data request of the tested business module; and modifying the found data according to the data modification logic of the data proxy module.

2. The method according to claim 1, It is characterized in that The method further comprises: The corresponding relationship between the business module and the data module is obtained by parsing the configuration file of the system, wherein each business module corresponds to one or more data modules; Determine the business module and data module to be tested based on business requirements.

3. The method according to claim 2, It is characterized in that After determining the business module and data module to be tested according to business requirements, it also includes: The data proxy module is deployed by replacing the data module in the data modification logic code of the data proxy module with the data module under test and then compiling the code.

4. The method according to claim 1 or 2, It is characterized in that The business modules under test that introduce online traffic into the system include: The online traffic is introduced into the tested business module by modifying the access path of the online traffic.

5. The method according to claim 1 or 2, It is characterized in that Modifying the data request path of the tested service module to point to a pre-deployed data proxy module includes: By modifying the namespace of the tested service module and the namespace of the data proxy module to be accessed, the data request path of the tested service module is modified to point to the pre-deployed data proxy module.

6. The method according to claim 1, It is characterized in that Modifying the data requested by the tested data module includes: Extracting a data module identifier from a data request of the tested service module; If the data module identifier is empty or the data module identifier is the same as the identifier of the data module under test, a random number is generated; When the random number is a specified value, the data in the tested data module is modified.

7. The method according to claim 1, It is characterized in that Modifying the data requested by the tested data module includes: Extracting a data module identifier from a data request of the tested service module; If the data module identifier is empty or the data module identifier is the same as the identifier of the data module under test, the number of data requests is increased by 1; When the number of data requests reaches a specified value, the data in the tested data module is modified.

8. A device for testing the robustness of a system, It is characterized in that include: Traffic introduction unit, used to introduce online traffic into the tested business module of the system; A data modification unit, used for modifying the data request path of the tested business 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 business module; wherein, modifying the data request path of the tested business module to point to a pre-deployed data proxy module, so as to modify the data requested by the tested data module, comprises: replacing the data module in the data modification logic code of the data proxy module with the tested data module, and then compiling the code to implement the deployment of the data proxy module; when the tested business module queries and obtains data from a database, the data proxy module searches for the corresponding required data from the database according to the data request of the tested business module; and modifying the found data according to the data modification logic of the data proxy module; The data monitoring unit is used to collect and analyze the operation data of the tested business module during the process of the tested business module performing business processing according to the modified data, so as to test the robustness of the system.

9. An electronic device for testing the robustness of a system. It is characterized in that include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 7.

10. A computer readable medium having a computer program stored thereon, It is characterized in that When the program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Beta testing method and device

    CN106484610A

  • System and method of data brokering

    US20060277313A1

  • Business process evolution

    US20070265900A1

  • Automated client-based web server stress tool simulating simultaneous multiple user server accesses

    US6157940A