Internet application software performance testing method, system and electronic equipment

By dynamically adjusting the number of test processes in the performance test of Internet application software, the problem of not being able to clearly determine the load and pressure values in the existing technology is solved, and more accurate and efficient performance testing is achieved.

CN114756462BActive Publication Date: 2025-08-15B&Q NETWORK TECH (SHANGHAI) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210396737.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-15
Publication Date
2025-08-15
Estimated Expiration
2042-04-15

AI Technical Summary

Technical Problem

In the prior art, the performance testing of Internet application software cannot be clearly obtained by obtaining clear load and pressure values, making it difficult to achieve the purpose of performance testing.

Method used

Create a test process by presetting the initial number of processes, dynamically collect performance test data, and perform assertion comparisons based on preset performance indicators, adaptively adjust the number of test processes to remain within the preset pressure range, and output a performance test report.

Benefits of technology

Improve the accuracy and efficiency of performance testing, ensure that the test pressure is within the set range, and clear the performance test results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114756462B_ABST
    Figure CN114756462B_ABST
Patent Text Reader

Abstract

The present invention provides a method, system, and electronic device for performance testing of internet application software. The method includes presetting an initial number of processes, using the initial number of processes as a first test process number, creating the initial number of test processes using the initial number of processes, and initiating a performance test; dynamically collecting performance test data using a first script according to preset performance indicators, comparing the performance test data with assertion expectations to determine whether the performance data is within a preset pressure range; performing a test execution action based on the comparison result, outputting a performance test report when the performance test data is not within the preset pressure range, and increasing the first test process number by the number of test processes according to preset incremental data as the first test process number when the performance test data is within the preset pressure range, and repeating steps 1, 2, and 3. The present invention can adaptively maintain the test pressure within a set range, improve the accuracy of the performance test, and clarify the performance test results, ultimately improving the efficiency of the performance test.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of smart payment, and in particular to a method, system and electronic equipment for testing the performance of Internet application software. Background Art

[0002] In the digital age, with the development of internet technology, an increasing number of software projects are being developed, and a growing number of technologies (such as big data, cloud computing, and microservices) are being applied. Performance testing is a crucial business testing component of software projects. Performance testing is often used for stress testing of customer-side systems. It uses automated testing tools to simulate various normal, peak, and abnormal load conditions to test various system performance indicators.

[0003] Currently, performance testing primarily focuses on single-interface performance stress testing. Business and product teams lack a clear understanding of the significance of performance testing, and the meaning of performance indicators is unclear. Performance testing often uses a single indicator as the benchmark for performance test results, making it difficult to clearly determine load and stress values, making it difficult to achieve the purpose of performance testing. Summary of the Invention

[0004] In view of the above-mentioned shortcomings of the prior art, the object of the present invention is to provide an Internet application software performance testing method, system and electronic device for solving the above problems in the prior art.

[0005] To achieve the above-mentioned purpose and other related purposes, the present invention provides a performance testing method for Internet application software, the method comprising: presetting an initial process number, using the initial process number as the first test process number, creating the initial process number of test processes through the number, and starting a performance test; dynamically collecting performance test data through a first script according to preset performance indicators, comparing the first script assertion with the assertion expectation to determine whether the performance data is within a preset pressure range; performing a test execution action based on the comparison result, outputting a performance test report when the performance test data is not within the preset pressure range, and increasing the first test process number by the preset incremental data as the first test process number when the performance test data is within the preset pressure range, and repeating steps 1, 2, and 3.

[0006] In one embodiment of the present invention, the method further includes: reading the interface URL, request method, and parameter generation variables in the stress testing interface list through the first script yaml.load method; and analyzing the interface business scenario to generate a business flow interface test case.

[0007] In one embodiment of the present invention, the method also includes: presetting the initial number of processes as N, and generating a variable association performance tool through an automated script; generating environment variables of the script according to the interface URL, request method, and parameter passing corresponding to the dynamic loop read by the first script: transmitting the expected result of the assertion to the code storage server in a fixed file format; traversing and reading the corresponding expected result in the interface serialization format and the actual result generated by the second script through the field reading method of the fixed file format; and using a third script to monitor the assertion performance indicators.

[0008] In one embodiment of the present invention, the method further includes: in the test process, calling an extension file through a first script execution to start performance testing; calling preset indicators in the fixed file in the assertion, improving the first script and executing performance testing.

[0009] In one embodiment of the present invention, the method further includes: the initial number of processes is a preset value N, which is rounded up by M% of the number of transaction processing systems as the first test process number, and the number of transaction processing systems = predicted number of daily users * K% / (L% * active time * 60 * 60), K% is the percentage of business volume met, and L% is L% of the commonly used time.

[0010] In one embodiment of the present invention, the method further includes: calling a second script through a first script according to the preset performance indicator to collect the performance test data; comparing the assertions of the first script with the expected assertions in the fixed file of the first script, and determining whether the performance test data is within a preset pressure range based on the comparison results.

[0011] In one embodiment of the present invention, the method further includes: when the performance test data is within a preset pressure range, automatically adjusting the number of test processes according to a preset process increment with the first test process number as the first test process number, and executing the performance test according to the first test process number; when the performance test data exceeds the preset pressure range, recording the first test process number as H through the performance test report or log, replacing the load test process number in the second script with the number H-1, performing a load test and outputting the load test result; automatically adjusting the number of test processes according to the preset process increment with the first test process number H as the first test process number for performance testing, when the performance test data does not meet the business scenario, asserting the business scenario to change the variable through the first script, executing the load test through the variable, and stopping the load test when the first test process number is H+J and all business scenarios exceed the preset pressure value. Output the corresponding performance test report according to the template.

[0012] To achieve the above-mentioned purpose and other related purposes, the present invention provides an Internet application software performance testing system, which includes: a test startup module, which is used to preset the initial process number, use the initial process number as the first test process number, create the initial process number of test processes through the number, and start the performance test; a data acquisition module, which is used to dynamically collect performance test data through a first script according to preset performance indicators; a judgment module, which is used to compare the assertion of the first script with the assertion expectation to determine whether the performance data is within a preset pressure range; a data processing module: when the performance test data is within the preset pressure range, increase the test process number by the first test process number according to preset incremental data as the first test process number to continue to execute the performance test; a report output module: when the performance test data is not within the preset pressure range, output a performance test report.

[0013] To achieve the above-mentioned purpose and other related purposes, the present invention provides a computer-readable storage medium, which stores a computer program. When the computer program is loaded and executed by a processor, it implements the Internet application software performance testing method.

[0014] To achieve the above-mentioned purpose and other related purposes, the present invention provides an electronic device, comprising: a processor, a memory and a communication interface; wherein the memory is used to store computer programs; the processor is used to load and execute the computer programs so that the electronic device executes the Internet application software performance testing method; and the communication interface is used to realize communication between the access device and other devices.

[0015] As described above, the present invention provides an Internet application software performance testing method, system, and electronic device that can adaptively maintain the test pressure within a set range, improve the accuracy of the performance test and clarify the performance test results, and ultimately improve the efficiency of the performance test. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 Shown is a flow chart of a method for testing performance of Internet application software in one embodiment of the present invention.

[0017] Figure 2 Shown is a module diagram of an Internet application software performance testing system in one embodiment of the present invention.

[0018] Figure 3 Shown is a schematic structural diagram of an electronic device in an embodiment of the present invention. DETAILED DESCRIPTION

[0019] The following describes the embodiments of the present invention through specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the following embodiments and features in the embodiments can be combined with each other in the absence of conflict. Based on the embodiments in the present invention, all other embodiments obtained by those of ordinary skill in the art without making creative work are within the scope of protection of the present invention.

[0020] It should be noted that the illustrations provided in the following embodiments are merely schematic illustrations of the basic concept of the present invention. Therefore, the illustrations only show components related to the present invention and are not drawn according to the number, shape, and size of components in actual implementation. In actual implementation, the type, quantity, and proportion of each component may be changed arbitrarily, and the component layout may also be more complex.

[0021] In order to solve the problem in the prior art that it is impossible to clearly obtain clear load and pressure values to judge performance indicators during the performance testing process of Internet application software, the present invention provides an Internet application software performance testing method, system and electronic equipment.

[0022] like Figure 1 As shown, this embodiment provides a method for testing the performance of Internet application software, which includes the following steps:

[0023] S11: Preset the initial process number, use the initial process number as the first test process number, create the initial process number of test processes using the number, and start performance testing.

[0024] Specifically, the Python script yaml.load method is first used to read the interface URL, request method, and parameter values from the stress testing interface list in a YAML file on a code management server such as SVN or Git to generate variables. It should be noted that a YAML file is typically uploaded to the code management server using the URL, request method, and parameter values of the interface in a Word or Markdown document. The YAML file generally includes a function list and corresponding interface documentation, namely, the interface name, interface class, request method, interface address, request parameters and description, and return data and description.

[0025] Furthermore, the interface business scenario is analyzed to generate a business flow interface test case.

[0026] Furthermore, the initial number of processes is preset to N, and a variable association performance tool generated by an automated script, such as a jmeter script, is used to generate an automated test python script, wherein the initial number of processes is the preset value N obtained by rounding M% of the number of transaction processing systems, the number of transaction processing systems = predicted number of daily users * K% / (L% * active time * 60 * 60), K% is the percentage of business volume met, and L% is L% of the common time. For example, the initial number of processes is rounded from 10% of the TPS by default, TPS is the transaction processing system, and according to the 80 / 20 principle: TPS = n*80% / (20% * active time * 60 * 60), n is the predicted number of daily users, 20% is the common time, 80% of the business volume is met, and the active time is generally 8 hours.

[0027] Furthermore, a Python script generates script environment variables corresponding to the interface URL, request method, and parameters read in a loop. The expected assertion results are then transferred to the code storage server in the form of a CSV file. The Python script's csv.DictReader traverses the expected results in the interface YAML file and the actual results generated by the JMeter script. Finally, assertion performance metrics are monitored using the assert function in the Python pytest framework.

[0028] Furthermore, according to the preset initial process number, the initial process number test processes are created, and in each test process, the python script execution call is executed, such as the jmeter non-GUI script jmx file, to start the performance test.

[0029] S12: Dynamically collect performance test data through the first script according to the preset performance indicator, and compare the first script assertion with the assertion expectation to determine whether the performance data is within the preset pressure range.

[0030] Specifically, according to all preset performance indicators, the jmeter script is called through the python script to collect performance test data, and the script assertion is compared with the assertion expectation in the python script csv to determine whether the performance test data is within the preset pressure range.

[0031] S13: Perform a test execution action based on the comparison result, output a performance test report when the performance test data is not within the preset pressure range, and when the performance test data is within the preset pressure range, increase the number of first test processes according to the preset incremental data as the first test process number, and repeat steps 1, 2, and 3.

[0032] Specifically, when the performance test data falls within the preset pressure range, the next time the performance test is executed, the current number of processes is incremented by a, serving as the test process number. For example, a is 1. Preset performance metrics in the CSV file are then called in the assertion. These metrics include, but are not limited to, pass rate, response time, error rate, CPU utilization, memory usage, and cache hit rate. For example, these metrics can be preset as follows: 100% pass rate, 2 / 5 / 10 response time, error rate less than 0.1%, CPU utilization of 70% (good), 85% (bad), 90%+ (very poor), memory utilization less than 80%, and cache hit rate greater than 85%. The performance test script is then refined and executed. During the execution of the performance test script, data is continuously collected and output based on the accumulated process count to determine whether the current number of processes and performance test metrics meet the preset pressure range. Finally, the final process count when all scenarios met the preset pressure is recorded in the test report and log. This count is used to replace the load test process count in JMT, and the load test is then executed and the load test results are output.

[0033] Furthermore, if the performance test data exceeds the preset pressure range, the performance test continues by increasing the number of processes by a. Each time a business scenario is not met, a record is made through a script assertion. The unsatisfied business scenario is extracted into a variable, and the load test is performed using the variable until all business scenarios fail to meet the preset pressure value. The script is then stopped and the corresponding performance test report is output according to the template.

[0034] All or part of the steps in implementing each of the above method embodiments can be accomplished by hardware associated with a computer program. Based on this understanding, the present invention also provides a computer program product comprising one or more computer instructions. The computer instructions can be stored in a computer-readable storage medium. The computer-readable storage medium can be any available medium capable of storing data on a computer, or a data storage device such as a server or data center that integrates one or more available media.

[0035] See Figure 2 This embodiment provides an Internet application software performance testing system 20, which is a piece of software installed in an electronic device and, when running, executes the Internet application software performance testing method described in the aforementioned method embodiment. Because the technical principles of this system embodiment are similar to those of the aforementioned method embodiment, the same technical details will not be repeated here.

[0036] The Internet application software performance testing system 20 of this embodiment specifically includes: a test startup module 21, a data collection module 22, a judgment module 23, a data processing module 24, and a report output module 25. The test startup module 21 is used to preset an initial number of processes, use the initial number of processes as the first test process number, create the initial number of test processes using the initial number of processes, and start the performance test; the data collection module 22 is used to dynamically collect performance test data using a first script based on preset performance indicators; the judgment module 23 is used to compare the assertions of the first script with the assertion expectations to determine whether the performance data is within a preset pressure range; the data processing module 24 is used to increase the first test process number by the preset incremental data if the performance test data is within the preset pressure range, and continue the performance test as the first test process number; the report output module 25 is used to output a performance test report if the performance test data is not within the preset pressure range.

[0037] It should be understood by those skilled in the art that Figure 2 The division of the modules in the embodiment is merely a division of logical functions, and in actual implementation, all or part of them can be integrated into one or more physical entities. Moreover, these modules can all be implemented in the form of software called by processing elements, or all in the form of hardware. Alternatively, some modules can be implemented in the form of processing elements calling software, and some modules can be implemented in the form of hardware. For example, the data processing module 24 can be a separately established processing element, or it can be integrated into a certain chip for implementation. In addition, it can also be stored in a memory in the form of program code, and called by a certain processing element to execute the functions of the data processing module 24. The implementation of other modules is similar. The processing element described here can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each of the above modules can be completed by an integrated logic circuit of hardware in the processor element or instructions in the form of software.

[0038] See Figure 3 This embodiment provides an electronic device, which may be a portable computer, a smart phone, a tablet computer, or the like. Specifically, the electronic device includes at least: a memory 32, a processor 33, and a communication interface 34, connected via a bus 31. The communication interface 34 is configured to enable communication between a data access device and other devices. The memory 32 is configured to store computer programs, and the processor 33 is configured to execute the computer programs stored in the memory 32 to perform all or part of the steps in the aforementioned method embodiment.

[0039] The system bus mentioned above can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The system bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. The communication interface is used to realize communication between the database access device and other devices (such as clients, read-write libraries, and read-only libraries). The memory may include random access memory (RAM), and may also include non-volatile memory, such as at least one disk storage.

[0040] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, and discrete hardware components.

[0041] In summary, the present invention provides an Internet application software performance testing method, system and electronic device, which constructs a complete automated performance testing framework by sorting out clear business scenarios, and then regularly and dynamically collects the preset performance indicators of the performance test to determine whether the performance data is within the preset pressure range. When all performance data are within the preset pressure range, the incremental and decremental methods are used to obtain the peak data of pressure and load when the interface meets different business scenarios to obtain the performance test results. This method can improve the efficiency of performance testing, and can adaptively maintain the test pressure within the set range, improve the accuracy of performance testing and clarify performance test results. Therefore, the present invention effectively overcomes the various shortcomings in the prior art and has a high industrial utilization value.

[0042] The above embodiments are merely illustrative of the principles and effects of the present invention and are not intended to limit the present invention. Anyone skilled in the art may modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by one of ordinary skill in the art without departing from the spirit and technical principles disclosed herein are intended to be covered by the claims of the present invention.

Claims

1. A method for testing performance of Internet application software, characterized in that: include: Step 1: Use the yaml.load method of the first script to read the interface URL, request method, and parameter generation variables in the stress testing interface list; Analyze the interface business scenario to generate business flow interface test cases; Preset the initial process number, use the initial process number as the first test process number, create the initial process number of test processes using the number, and start the performance test; Step 2: Dynamically collect performance test data through the first script according to the preset performance indicators, and compare the first script assertion with the assertion expectation to determine whether the performance data is within the preset pressure range; The initial number of processes is preset to N, and the variable correlation performance tool is generated by the automated script; The environment variables of the script are generated according to the interface URL, request method, and parameter transmission read dynamically in the first script: Transfer the expected results of the assertion to the code storage server in a fixed file format; The corresponding expected result in the interface serialization format and the actual result generated by the second script are traversed and read using the field reading method of the fixed file format; Use the third script to monitor assertion performance indicators; Step 3: Perform a test execution action based on the comparison result. When the performance test data is not within the preset pressure range, output a performance test report. When the performance test data is within the preset pressure range, increase the number of test processes by the preset incremental data as the first test process number, and repeat steps 1, 2, and 3. When the performance test data is within a preset pressure range, automatically adjusting the number of test processes according to a preset process increment based on the first test process number as the first test process number, and performing the performance test according to the first test process number; When the performance test data exceeds the preset pressure range, the number of the first test processes is recorded as H in the performance test report or log, the number of load test processes in the second script is replaced by H-1, a load test is performed, and the load test result is output; A performance test is performed using a first test process number H, which is automatically adjusted according to a preset process increment, as the first test process number. When performance test data does not meet the business scenario, the business scenario is changed to a variable through a first script assertion, and a load test is performed using the variable. When the first test process number is H+J and all business scenarios exceed a preset stress value, the load test is stopped. Output the corresponding performance test report according to the template.

2. The method according to claim 1, characterized in that Also includes: In the test process, the extension file is called by executing the first script to start the performance test; The preset indicators in the fixed file are called in the assertion, the first script is improved and the performance test is executed.

3. The method according to claim 2, characterized in that Also includes: The initial number of processes is a preset value N, which is rounded up to M% of the number of transaction processing systems as the first test process number. The number of transaction processing systems = predicted number of daily users * K% / (L% * active time * 60 * 60), where K% is the percentage of business volume met and L% is L% of the commonly used time.

4. The method according to claim 1, wherein Also includes: Calling the second script through the first script according to the preset performance indicator to collect the performance test data; The assertion of the first script is compared with the expected assertion in the first script fixed file, and whether the performance test data is within a preset pressure range is determined based on the comparison result.

5. An Internet application software performance testing system, characterized in that: The system comprises: The test startup module reads the interface URL, request method, and parameter generation variables in the stress test interface list through the first script yaml.load method; analyzes the interface business scenario to generate a business flow interface test case; is used to preset the initial number of processes, use the initial number of processes as the first test process number, create the initial number of test processes using the number, and start the performance test; A data acquisition module, configured to dynamically acquire performance test data through a first script according to preset performance indicators; A judgment module is used to compare the assertion of the first script with the assertion expectation to determine whether the performance data is within a preset pressure range; the initial number of processes is preset to N, and the variable association performance tool is generated by the automated script; the environment variables of the script are generated according to the interface URL, request method, and parameter passing corresponding to the dynamic loop read by the first script: the expected result of the assertion is transmitted to the code storage server in a fixed file format; the corresponding expected result in the interface serialization format and the actual result generated by the second script are traversed and read through the field reading method of the fixed file format; and the assertion performance indicator monitoring is performed using a third script; A data processing module: configured to increase the number of test processes by the first test process according to the preset incremental data when the performance test data is within the preset pressure range, and to continue to perform the performance test as the first test process number; When the performance test data is within a preset pressure range, automatically adjusting the number of test processes according to a preset process increment based on the first test process number as the first test process number, and performing the performance test according to the first test process number; When the performance test data exceeds the preset pressure range, the number of first test processes is recorded as H through a performance test report or log, and the number of load test processes in the second script is replaced by the number H-1, and a load test is performed and the load test result is output; the number of test processes is automatically adjusted according to the preset process increment with the first test process number H as the first test process number for performance testing, and when the performance test data does not meet the business scenario, the business scenario is changed to a variable through the first script assertion, and the load test is performed through the variable. When the number of first test processes is H+J and all business scenarios exceed the preset pressure value, the load test is stopped; Report output module: used to output a performance test report when the performance test data is not within a preset pressure range.

6. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is loaded and executed by a processor, the Internet application software performance testing method according to any one of claims 1 to 4 is implemented.

7. An electronic device, characterized in that: include: Processor, memory and communication interface; wherein, The memory is used to store computer programs; The processor is configured to load and execute the computer program so that the electronic device executes the Internet application software performance testing method according to any one of claims 1 to 4; The communication interface is used to implement communication between the access device and other devices.

Citation Information

Patent Citations

  • Software performance test method and device, equipment and storage medium

    CN113971130A