Stress testing method, device, equipment and computer readable storage medium
By automatically obtaining and analyzing real user behavior data in the business analysis system, generating test scenario information and scripts, the problem of cumbersome and inaccurate manual input of existing stress tests is solved, and more efficient and accurate stress testing is achieved.
Patent Information
- Application Number
- CN201910546667.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-06-21
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2039-06-21
AI Technical Summary
The existing stress testing schemes rely on human experience to input use case data, which is cumbersome and can easily lead to inaccurate test results, and cannot effectively simulate actual business scenarios.
By obtaining the real user behavior data in the pre-analyzed business analysis system, automatically generate corresponding test scenario information and test scripts to achieve automated stress testing.
Improve the efficiency and accuracy of stress testing, make the test results more in line with the actual business scenarios, and reduce human errors.
Smart Images

Figure CN110245089B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of financial technology (Fintech), and in particular to a stress testing method, device, equipment and computer-readable storage medium. Background Art
[0002] With the development of computer technology, more and more technologies (big data, distributed, blockchain, artificial intelligence, etc.) are being applied in the financial field. The traditional financial industry is gradually transforming to financial technology (Fintech). However, due to the security and real-time requirements of the financial industry, higher requirements are also placed on technology.
[0003] In the current financial field, stress testing is a test that needs to be done before every Web application goes online. It can help us find bottleneck problems in the system and reduce the chance of problems after being released to the production environment. However, the use case data input of existing stress testing solutions is manually written and input by testers based on their experience. Not only is the operation cumbersome and time-consuming, but the data input based on human experience often deviates from the actual business scenario, and it is easy to miss the data in the actual complex business scenario, resulting in inaccurate final stress testing results. Summary of the invention
[0004] The main purpose of the present invention is to provide a stress testing method, device, equipment and computer-readable storage medium, aiming to improve the efficiency of stress testing and the accuracy of stress testing results.
[0005] To achieve the above object, the present invention provides a method, which comprises the following steps:
[0006] When a stress test request is received, obtaining pre-saved test scenario information corresponding to the stress test request, wherein the test scenario information is obtained by pre-analyzing real user behavior data in the business analysis system;
[0007] Obtaining a pre-generated test script corresponding to the test scenario information;
[0008] Perform stress testing according to the test script.
[0009] Preferably, before the step of obtaining pre-saved test scenario information corresponding to the stress test request when the stress test request is received, the method further includes:
[0010] When a test scenario creation request is received, real user behavior data within a first preset time period is read from a preset business analysis system;
[0011] Classify the real user behavior data within the first preset time period according to the user behavior, and obtain the concurrency number under each classification;
[0012] After associating the first preset time period, the user behavior and the number of concurrent connections, the associations are saved in a preset scenario database as test scenario information;
[0013] A test script corresponding to the test scenario information is generated through a preset test script generation engine.
[0014] Preferably, the step of associating the first preset time period, the user behavior and the concurrency number and saving the associative test scenario information in a preset scenario database comprises:
[0015] Setting the priority of the corresponding user behavior according to the concurrent number;
[0016] After associating the first preset time period, the user behavior, the number of concurrent connections, and the priority, the association is saved in a preset scenario database as test scenario information;
[0017] When a stress test request is received, the step of obtaining pre-saved test scenario information corresponding to the stress test request includes:
[0018] When a stress test request is received, obtaining priority information carried in the stress test request;
[0019] The pre-saved test scenario information is acquired according to the priority information.
[0020] Preferably, the pressure testing method further includes:
[0021] When receiving a test scenario update request, reading real user behavior data within a second preset time period from the business analysis system;
[0022] Comparing the similarity between the real user behavior data within the first preset time period and the real user behavior data within the second preset time period;
[0023] When the similarity is less than or equal to the preset similarity, the test scenario information stored in the scenario database is updated according to the real user behavior data within the second preset time period, and the test script corresponding to the test scenario information is updated.
[0024] Preferably, the step of performing stress testing according to the test script includes:
[0025] Run the test script to initiate an automated build request to the execution center of the stress testing platform, so that the execution center pulls the corresponding test dependency package from a preset test warehouse according to the automated build request;
[0026] The stress test is performed according to the test dependency package, and during the execution of the stress test, predetermined indicators are monitored, and a corresponding stress test report is generated according to the monitoring data.
[0027] In addition, to achieve the above object, the present invention also provides a pressure testing device, the pressure testing device comprising:
[0028] A first acquisition module is used to, when receiving a stress test request, acquire pre-saved test scenario information corresponding to the stress test request, wherein the test scenario information is obtained by pre-analyzing real user behavior data in the business analysis system;
[0029] A second acquisition module is used to acquire a pre-generated test script corresponding to the test scenario information;
[0030] An execution module is used to execute a stress test according to the test script.
[0031] Preferably, the pressure testing device further comprises:
[0032] A first reading module, configured to read real user behavior data within a first preset time period from a preset business analysis system when receiving a test scenario creation request;
[0033] A classification module, used to classify the real user behavior data within the first preset time period according to the user behavior, and obtain the concurrency number under each classification;
[0034] A saving module, used for associating the first preset time period, the user behavior and the concurrency number, and saving the association as test scenario information in a preset scenario database;
[0035] The generation module is used to generate a test script corresponding to the test scenario information through a preset test script generation engine.
[0036] Preferably, the saving module is further used to set the priority of the corresponding user behavior according to the concurrent number; after associating the first preset time period, the user behavior, the concurrent number and the priority, save them as test scenario information in a preset scenario database;
[0037] The first acquisition module is further used to obtain priority information carried in the stress test request when receiving the stress test request; and obtain pre-saved test scenario information according to the priority information.
[0038] Preferably, the pressure testing device further comprises:
[0039] A second reading module is used to read the real user behavior data within a second preset time period from the business analysis system when receiving a test scenario update request;
[0040] A comparison module, configured to compare the similarity between the real user behavior data within the first preset time period and the real user behavior data within the second preset time period;
[0041] An updating module is used to update the test scenario information stored in the scenario database and update the test script corresponding to the test scenario information according to the real user behavior data within the second preset time period when the similarity is less than or equal to the preset similarity.
[0042] Preferably, the execution module is also used for:
[0043] Run the test script and initiate an automated build request to the execution center of the stress testing platform, so that the execution center pulls the corresponding test dependency package from the preset test warehouse according to the automated build request;
[0044] The stress test is performed according to the test dependency package, and during the execution of the stress test, predetermined indicators are monitored, and a corresponding stress test report is generated according to the monitoring data.
[0045] In addition, to achieve the above-mentioned purpose, the present invention also provides a stress testing device, which includes: a memory, a processor, and a stress testing program stored in the memory and executable on the processor, and the stress testing program implements the steps of the stress testing method described above when executed by the processor.
[0046] In addition, to achieve the above-mentioned purpose, the present invention also provides a computer-readable storage medium, on which a stress testing program is stored, and when the stress testing program is executed by a processor, the steps of the stress testing method described above are implemented.
[0047] When receiving a stress test request, the present invention obtains pre-saved test scenario information corresponding to the stress test request, the test scenario information is obtained by pre-analyzing real user behavior data in the business analysis system; obtains a pre-generated test script corresponding to the test scenario information; and performs stress testing according to the test script. In this way, it is realized that stress testing is automatically performed according to real user behavior data in the business analysis system. Compared with the existing method of manually inputting stress test case data, the efficiency of stress testing is improved, and the test is more in line with the actual business scenario, and the accuracy of stress testing results is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 It is a schematic diagram of the device structure of the hardware operating environment involved in the embodiment of the present invention;
[0049] Figure 2 Schematic diagram of the process of the first embodiment of the pressure testing method of the present invention.
[0050] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0051] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0052] like Figure 1 As shown, Figure 1 It is a schematic diagram of the device structure of the hardware operating environment involved in the embodiment of the present invention.
[0053] The stress testing device in the embodiment of the present invention may be a PC, a server or other device.
[0054] like Figure 1 As shown, the stress testing equipment may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, and a communication bus 1002. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory, or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.
[0055] Those skilled in the art will understand that Figure 1 The device structure shown in the figure does not constitute a limitation of the device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0056] like Figure 1 As shown, the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a stress testing program.
[0057] exist Figure 1In the device shown, the network interface 1004 is mainly used to connect to the background server and communicate data with the background server; the user interface 1003 is mainly used to connect to the client (user end) and communicate data with the client; and the processor 1001 can be used to call the stress test program stored in the memory 1005 and perform the operations in the following stress test method embodiment.
[0058] Based on the above hardware structure, an embodiment of the stress testing method of the present invention is proposed.
[0059] Reference Figure 2 , Figure 2 This is a flow chart of a first embodiment of a pressure testing method of the present invention, the method comprising:
[0060] Step S10, when a stress test request is received, obtaining pre-saved test scenario information corresponding to the stress test request, wherein the test scenario information is obtained by pre-analyzing real user behavior data in the business analysis system;
[0061] The stress testing method of this embodiment is applied to a stress testing device, which is equipped with a stress testing platform (ie, stress testing platform) for testing the stability and load performance of the system under test under certain access pressure conditions.
[0062] In this embodiment, the user can trigger a stress test request at the front end of the stress testing platform. The stress test request can be a single-scenario stress test request, that is, only a specific interface is stress tested, or a mixed-scenario stress test, that is, multiple interfaces are stress tested at the same time. In the system stress testing in the financial field, it is often necessary to allocate multiple interfaces in a certain proportion to simulate real business scenarios, that is, mixed-scenario stress testing. For example, for a certain financial transaction system to be tested, the ratio of user access to login, purchase, and query income interfaces in the same time period can be set to 2:4:4 to simulate a real transaction scenario. For ease of understanding, the mixed-scenario stress test of the financial business system is used as an example for explanation.
[0063] First, when the stress test platform receives a stress test request, it obtains the pre-saved test scenario information corresponding to the stress test request. The stress test request can carry information such as the system and test scenario requested for the test; the test scenario information corresponding to the stress test request includes user behavior (such as login, query, account opening, product purchase, product sale, withdrawal, recharge, transfer, etc.) and concurrent number, such as "1,000 users log in to the system in 5 minutes", where the user behavior is login and the concurrent number is 1,000.
[0064] The above test scenario information is obtained by pre-analyzing the real user behavior data in the business analysis system, and the test scenario information is pre-stored in the scenario database of the stress testing platform. Specifically, the business analysis system is based on the data of other systems in the business operation support system to build a unified enterprise-level data warehouse. Taking banks as an example, the bank's business analysis system stores user behavior data under real transaction scenarios (such as savings, loans, investments, etc.). By analyzing the real user behavior data in the business analysis system, the user behavior under the real transaction scenario and the corresponding concurrency, concurrency time, etc. can be obtained.
[0065] Step S20, obtaining a pre-generated test script corresponding to the test scenario information;
[0066] In this step, the test script refers to a series of instructions for a specific test, which can be executed by the automated testing tool. The test script corresponding to each test scenario information is pre-generated by the test script generation engine in the stress testing platform, and the test script is pre-stored in the script management center of the stress testing platform. After obtaining the pre-stored test scenario information corresponding to the stress test request, the script management center can be further queried through the test scenario information to obtain the test script corresponding to the test scenario information.
[0067] Step S30, performing stress testing according to the test script.
[0068] After obtaining the test script, the stress test is performed according to the test script. Specifically, step S30 may further include: running the test script to initiate an automated build request to the execution center of the stress test platform, so that the execution center pulls the corresponding test dependency package from the preset test warehouse according to the automated build request; performing the stress test according to the test dependency package, and during the execution of the stress test, monitoring the predetermined indicators, and generating a corresponding stress test report according to the monitoring data.
[0069] In this embodiment, the stress test platform runs the acquired test script and initiates an automated build request to the execution center, which can be implemented by Gradle (an automated build tool based on Java virtual machine); after receiving the automated build request, the execution center pulls the corresponding test dependency package from the preset test warehouse, which is a Jar (Java ARchive, Java archive) package, which is a platform-independent file format that can synthesize multiple files into one file, which contains several classes; after obtaining the test dependency package, the execution center can perform stress testing according to the classes and properties contained in the test dependency package. During the execution of the stress test, it is necessary to monitor the predetermined indicators, which include but are not limited to TPS (Transactions Per Second, the number of web request responses completed per second), the number of concurrent requests (the number of web request responses processed by the system at the same time within a certain period of time), the response time (the time when all web requests are processed), the throughput (the total amount of data transmitted by the system per unit time), etc., which can be flexibly set during the specific implementation. Finally, the stress test platform generates a corresponding stress test report based on the monitoring data, and sends the stress test report to the front end for display.
[0070] In this embodiment, when a stress test request is received, the pre-saved test scenario information corresponding to the stress test request is obtained, and the test scenario information is obtained by pre-analyzing the real user behavior data in the business analysis system; the pre-generated test script corresponding to the test scenario information is obtained; and the stress test is performed according to the test script. In this way, the stress test is automatically performed according to the real user behavior data in the business analysis system. Compared with the existing method of manually inputting stress test case data, the efficiency of stress testing is improved, and the test is more in line with the actual business scenario, and the accuracy of stress test results is improved.
[0071] Furthermore, based on the first embodiment of the pressure testing method of the present invention, a second embodiment of the pressure testing method of the present invention is proposed.
[0072] In this embodiment, before the above step S10, it may also include: when a test scenario creation request is received, reading real user behavior data within a first preset time period from a preset business analysis system; classifying the real user behavior data within the first preset time period according to the user behavior, and obtaining the concurrency number under each classification; after associating the first preset time period, the user behavior and the concurrency number, saving them as test scenario information in a preset scenario database; and generating a test script corresponding to the test scenario information through a preset test script generation engine.
[0073] In this embodiment, in order to ensure that the subsequent stress test is carried out normally, it is necessary to first generate test scenario information and a test script corresponding to the test scenario information.
[0074] Specifically, first, the stress testing platform can receive a test scenario creation request triggered by a user, and read the real user behavior data within a first preset time period (for example, the past 1 hour) from the preset business analysis system according to the test scenario creation request. To protect user privacy, the real user behavior data is desensitized real user behavior data; then, according to the user behavior, the read real user behavior data is classified, and the concurrency number under each category is obtained, where the user behavior includes but is not limited to login, query, account opening, purchase of products, sale of products, withdrawal, recharge, transfer and other operations. The concurrency number indicates that the system processes simultaneously within the first preset time period. The number of web request responses related to user behavior; then, the first preset time period, user behavior and concurrency are associated and saved as test scenario information in a preset scenario database; then, a test script corresponding to the test scenario information is generated through a preset test script generation engine, wherein the script generation rules can be flexibly set, for example, the steps for generating a token (login token) interface request code include: 1. Automatically match and copy the Gradle template project; 2. Write the middleware service message protocol sending and receiving logic based on the custom template engine; 3. Call the template engine to pass parameters including protocol header, request DCN (Data Communication Network), scenario id, service id, request package body, etc. to generate Groovy (an agile development language based on Java virtual machine) stress testing code.
[0075] In this embodiment, test scenario information is generated by analyzing real user behavior data in the business analysis system, and then a test script corresponding to the test scenario information is generated, which provides a prerequisite for the subsequent stress testing platform to perform automated stress testing based on real business scenarios.
[0076] Furthermore, based on the second embodiment of the stress testing method of the present invention, a third embodiment of the stress testing method of the present invention is proposed.
[0077] In this embodiment, the step of associating the first preset time period, the user behavior and the concurrency number, and saving them as test scenario information in a preset scenario database may include: setting the priority of the corresponding user behavior according to the concurrency number; associating the first preset time period, the user behavior, the concurrency number and the priority, and saving them as test scenario information in a preset scenario database; correspondingly, when a stress test request is received, the step of obtaining the pre-saved test scenario information corresponding to the stress test request may include: when a stress test request is received, obtaining the priority information carried in the stress test request; and obtaining the pre-saved test scenario information according to the priority information.
[0078] In this embodiment, considering that sometimes only some important or commonly used functions of the system to be tested need to be stress tested, for this reason, when generating the test scenario information, the priority of the corresponding user behavior can be set according to the concurrency number of each user behavior. The higher the concurrency number, the more frequent the user access, and the higher the corresponding priority can be set. Conversely, the lower the concurrency number, the lower the corresponding priority can be set. After that, the above-mentioned first preset time period, user behavior, concurrency number and set priority are associated and saved as test scenario information in the preset scenario database. When a stress test request is subsequently received, the priority information carried in the stress test request is obtained, and the scenario database is searched according to the priority information to obtain the test scenario information of the corresponding priority.
[0079] This embodiment sets priorities so that only stress tests of certain important or common functions can be performed later according to the priorities, thereby improving the flexibility of stress testing.
[0080] Furthermore, based on the second and third embodiments of the pressure testing method of the present invention, a fourth embodiment of the pressure testing method of the present invention is proposed.
[0081] In this embodiment, the stress testing method also includes: when a test scenario update request is received, reading real user behavior data within a second preset time period from the business analysis system; comparing the similarity between the real user behavior data within the first preset time period and the real user behavior data within the second preset time period; when the similarity is less than or equal to the preset similarity, updating the test scenario information stored in the scenario database according to the real user behavior data within the second preset time period, and updating the test script corresponding to the test scenario information.
[0082] In this embodiment, the test scenario update request can be triggered by the user or by the stress testing platform. When the stress testing platform receives the test scenario update request, it reads the real user behavior data within the second preset time period from the business analysis system, and compares the similarity between the real user behavior data within the first preset time period and the real user behavior data within the second preset time period, wherein the length of the second preset time period and the length of the first preset time period may be the same or different; when the similarity is less than or equal to the preset similarity, new test scenario information and test script are generated based on the real user behavior data within the second preset time period, and then the test scenario information stored in the scenario database is updated based on the new test scenario information and test script, and the test script corresponding to the test scenario information is updated.
[0083] Through the above method, the test scenario information and test scripts saved in the stress testing platform are updated, so that the stress test fits the latest business scenarios and further improves the accuracy of the stress testing results.
[0084] The present invention also provides a pressure testing device. The pressure testing device comprises:
[0085] A first acquisition module is used to, when receiving a stress test request, acquire pre-saved test scenario information corresponding to the stress test request, wherein the test scenario information is obtained by pre-analyzing real user behavior data in the business analysis system;
[0086] A second acquisition module is used to acquire a pre-generated test script corresponding to the test scenario information;
[0087] An execution module is used to execute a stress test according to the test script.
[0088] Furthermore, the pressure testing device further comprises:
[0089] A first reading module, configured to read real user behavior data within a first preset time period from a preset business analysis system when receiving a test scenario creation request;
[0090] A classification module, used to classify the real user behavior data within the first preset time period according to the user behavior, and obtain the concurrency number under each classification;
[0091] A saving module, used for associating the first preset time period, the user behavior and the concurrency number, and saving the association as test scenario information in a preset scenario database;
[0092] The generation module is used to generate a test script corresponding to the test scenario information through a preset test script generation engine.
[0093] Furthermore, the saving module is further used to set the priority of the corresponding user behavior according to the concurrency number; after associating the first preset time period, the user behavior, the concurrency number and the priority, save them as test scenario information in a preset scenario database;
[0094] The first acquisition module is further used to obtain priority information carried in the stress test request when receiving the stress test request; and obtain pre-saved test scenario information according to the priority information.
[0095] Furthermore, the pressure testing device further comprises:
[0096] A second reading module is used to read the real user behavior data within a second preset time period from the business analysis system when receiving a test scenario update request;
[0097] A comparison module, configured to compare the similarity between the real user behavior data within the first preset time period and the real user behavior data within the second preset time period;
[0098] An updating module is used to update the test scenario information stored in the scenario database and update the test script corresponding to the test scenario information according to the real user behavior data within the second preset time period when the similarity is less than or equal to the preset similarity.
[0099] Furthermore, the execution module is also used for:
[0100] Run the test script and initiate an automated build request to the execution center of the stress testing platform, so that the execution center pulls the corresponding test dependency package from the preset test warehouse according to the automated build request;
[0101] The stress test is performed according to the test dependency package, and during the execution of the stress test, predetermined indicators are monitored, and a corresponding stress test report is generated according to the monitoring data.
[0102] The methods executed by the above-mentioned program modules can refer to the various embodiments of the pressure testing method of the present invention, and will not be repeated here.
[0103] The present invention also provides a computer-readable storage medium.
[0104] A stress testing program is stored on the computer-readable storage medium of the present invention, and the stress testing program implements the steps of the stress testing method described above when executed by a processor.
[0105] Among them, the method implemented when the stress test program running on the processor is executed can refer to the various embodiments of the stress test method of the present invention, and will not be repeated here.
[0106] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.
[0107] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0108] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present invention.
[0109] The above are only preferred embodiments of the present invention, and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A stress testing method, characterized in that: The pressure testing method comprises the following steps: When a test scenario creation request is received, real user behavior data within a first preset time period is read from a preset business analysis system; Classify the real user behavior data within the first preset time period according to the user behavior, and obtain the concurrency number under each classification; Setting the priority of the corresponding user behavior according to the concurrent number; after associating the first preset time period, the user behavior, the concurrent number and the priority, saving them as test scenario information in a preset scenario database; When a stress test request is received, obtaining priority information carried in the stress test request; Acquiring pre-saved test scenario information according to the priority information; Generate a test script corresponding to the test scenario information through a preset test script generation engine, wherein the test scenario information is obtained by pre-analyzing real user behavior data in the business analysis system; Obtaining a pre-generated test script corresponding to the test scenario information; Perform stress testing according to the test script.
2. The pressure testing method according to claim 1, characterized in that: The pressure testing method further comprises: When receiving a test scenario update request, reading real user behavior data within a second preset time period from the business analysis system; Comparing the similarity between the real user behavior data within the first preset time period and the real user behavior data within the second preset time period; When the similarity is less than or equal to the preset similarity, the test scenario information stored in the scenario database is updated according to the real user behavior data within the second preset time period, and the test script corresponding to the test scenario information is updated.
3. The pressure testing method according to claim 1, characterized in that: The step of performing stress testing according to the test script comprises: Run the test script to initiate an automated build request to the execution center of the stress testing platform, so that the execution center pulls the corresponding test dependency package from a preset test warehouse according to the automated build request; The stress test is performed according to the test dependency package, and during the execution of the stress test, predetermined indicators are monitored, and a corresponding stress test report is generated according to the monitoring data.
4. A pressure testing device, characterized in that: The pressure testing device comprises: A first reading module, configured to read real user behavior data within a first preset time period from a preset business analysis system when receiving a test scenario creation request; A classification module, used to classify the real user behavior data within the first preset time period according to the user behavior, and obtain the concurrency number under each classification; A saving module, used to set the priority of the corresponding user behavior according to the concurrent number; after associating the first preset time period, the user behavior, the concurrent number and the priority, save them as test scenario information in a preset scenario database; A generation module, used to generate a test script corresponding to the test scenario information through a preset test script generation engine; A first acquisition module is used to, when receiving a stress test request, acquire priority information carried in the stress test request; acquire pre-saved test scenario information according to the priority information, wherein the test scenario information is obtained by pre-analyzing real user behavior data in the business analysis system; A second acquisition module is used to acquire a pre-generated test script corresponding to the test scenario information; An execution module is used to execute a stress test according to the test script.
5. The pressure testing device according to claim 4, characterized in that: The pressure testing device also includes: A second reading module is used to read the real user behavior data within a second preset time period from the business analysis system when receiving a test scenario update request; A comparison module, configured to compare the similarity between the real user behavior data within the first preset time period and the real user behavior data within the second preset time period; An updating module is used to update the test scenario information stored in the scenario database and update the test script corresponding to the test scenario information according to the real user behavior data within the second preset time period when the similarity is less than or equal to the preset similarity.
6. The pressure testing device according to claim 4, characterized in that: The execution module is also used for: Run the test script and initiate an automated build request to the execution center of the stress testing platform, so that the execution center pulls the corresponding test dependency package from the preset test warehouse according to the automated build request; The stress test is performed according to the test dependency package, and during the execution of the stress test, predetermined indicators are monitored, and a corresponding stress test report is generated according to the monitoring data.
7. A pressure testing device, characterized in that: The stress testing device comprises: a memory, a processor, and a stress testing program stored in the memory and executable on the processor, wherein the stress testing program implements the steps of the stress testing method according to any one of claims 1 to 3 when executed by the processor.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a stress testing program, and when the stress testing program is executed by a processor, the steps of the stress testing method according to any one of claims 1 to 3 are implemented.
Citation Information
Patent Citations
Pressure testing system and method
CN102866944A
Method and device for automatic testing
CN105374131A