Computer software performance testing method

Through technical means such as modular design, function packaging and parameterized data driving, the problems of confusing script structure, improper data processing and imperfect error processing in traditional software testing methods are solved, and efficient and automated software performance testing is achieved, which improves the Test quality and efficiency, adapting to the needs of continuous integration and continuous deployment.

CN119248648APending Publication Date: 2025-01-03HUNAN INST OF INFORMATION TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411353812.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-26
Publication Date
2025-01-03

AI Technical Summary

Technical Problem

Traditional software testing methods have unclear script structure, tight coupling of data and scripts, lack of effective error handling mechanisms, poor performance, and disconnection from continuous integration and continuous deployment, resulting in low testing efficiency, poor quality and extended release cycles.

Method used

Adopt modular design, function encapsulation, parameterized data driver, exception handling and parallel execution of tests, combined with continuous integration and continuous deployment tools, optimize performance metric monitoring and error logging, separate test data and scripts, reduce unnecessary operations, and Automated testing is performed during continuous deployment.

Benefits of technology

It improves the maintainability and reusability of test scripts, shortens testing time, improves test quality and automation, ensures the stability and rapid iteration of software versions, and reduces the risks caused by software defects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119248648A_ABST
    Figure CN119248648A_ABST
Patent Text Reader

Abstract

The invention provides a computer software performance testing method. Comprising the following steps: firstly, carrying out test preparation of computer software performance test, carrying out test design after the test preparation is finished, determining a test scene, compiling a test script, optimizing a script structure, carrying out data-driven test, optimizing error processing, carrying out performance optimization and continuous integration and continuous deployment, and setting performance index monitoring. After the test design technology is finished, test execution can be carried out, after test execution is finished, test structure analysis is carried out, and finally test report arrangement is carried out. According to the computer software performance testing method provided by the invention, through script structure optimization, modular design and function packaging, different functions are independently formed into modules or functions, so that the logic of the script is clearer; and the clear structure also enables newly added testers to more quickly understand the logic of the script, so that the cooperation efficiency of the team is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer software testing, and in particular to a computer software performance testing method. Background Art

[0002] In the field of computer software testing, with the continuous increase in software scale and complexity, traditional testing methods face many challenges. The quality of test script writing directly affects the efficiency and quality of testing.

[0003] Traditional test scripts may have the following problems:

[0004] The script structure is unclear and the functions are mixed together, making maintenance and modification difficult;

[0005] The data is tightly coupled with the script, which makes it difficult to manage and update the data. Every modification of the test data needs to be done directly in the script, which increases the risk of errors.

[0006] Lack of effective error handling mechanism. When an error occurs during testing, the script may be interrupted directly and cannot provide sufficient information for troubleshooting.

[0007] Poor performance and unnecessary operations lead to long test execution time, affecting test efficiency;

[0008] It is out of touch with the continuous integration and continuous deployment processes, making it impossible to test newly submitted code in a timely manner, which delays the software release cycle.

[0009] Therefore, it is necessary to provide a computer software performance testing method to solve the above technical problems. Summary of the invention

[0010] The present invention provides a computer software performance testing method, which solves the problems of chaotic test script structure, improper data processing method, imperfect error handling, low performance and lack of integration with continuous integration and continuous deployment, which will cause the testing process to be time-consuming and labor-intensive and difficult to quickly and accurately discover software conditions.

[0011] In order to solve the above technical problems, the present invention provides a computer software performance testing method, comprising the following steps:

[0012] S1. First, prepare for the computer software performance test;

[0013] S2, test the design after the test preparation in S1 is completed;

[0014] S21, determine the test scenario;

[0015] S22. Write test scripts;

[0016] S221. Script structure optimization;

[0017] S222, data driven testing;

[0018] S223, error handling optimization;

[0019] S224, performance optimization and continuous integration and continuous deployment;

[0020] S23, set performance indicator monitoring;

[0021] S3, after the test design technique in S2 is completed, the test execution can be carried out;

[0022] S4. After the test execution is completed, the test structure analysis is performed;

[0023] S5. Finally, the test report is compiled.

[0024] Preferably, the S1 comprises the following steps:

[0025] S11. Clarify the test objectives: determine the software performance indicators to be tested and determine the key business processes and functional points for key testing based on the software usage scenarios and requirements;

[0026] S12. Specify the test plan: plan the test time, personnel, resource allocation and determine the requirements for setting up the test environment;

[0027] S13. Prepare test tools: select appropriate performance test tools and ensure that the test tools can meet the test requirements, and be familiar with how to use the tools;

[0028] S14. Build a test environment: Build a test environment similar to the production environment according to the test plan, minimize the impact of environmental differences on the test results, and install and configure the tested software to ensure that the software is in a stable state.

[0029] Preferably, the S221 includes the following method:

[0030] S2211, Modular design: Split the test script into multiple modules, each module implements a specific function;

[0031] S2212, Function Encapsulation: Encapsulate common operations into functions so that they can be reused in different test scripts;

[0032] S2213. Reasonable use of loops and conditional judgments: In test scripts, reasonable use of loops and conditional judgments can improve the flexibility and adaptability of the script.

[0033] Preferably, the S222 includes the following method:

[0034] S2221, parameterization: separate the test data from the test script and pass it into the test script in a parameterized way;

[0035] S2222. Data file format selection: Select a suitable data file format to store test data.

[0036] Preferably, the S223 includes the following method:

[0037] S2231. Exception handling: Add appropriate exception handling mechanisms to the test scripts so that errors can be captured and handled in a timely manner when they occur during the test process;

[0038] S2232. Error log recording: Add an error log recording function to the test script so that when an error occurs during the test, the error information can be recorded in time to facilitate subsequent problem troubleshooting and analysis.

[0039] Preferably, the S224 includes the following method:

[0040] S2241. Reduce unnecessary operations: In the test script, try to reduce unnecessary operations to improve the execution efficiency of the script;

[0041] S2242. Parallel test execution: The test tool supports parallel test execution. You can consider splitting the test script into multiple parts and executing these parts in parallel to improve test efficiency.

[0042] S2243. Integration with continuous integration tools: Integrate test scripts with continuous integration tools to automatically execute tests after code submission;

[0043] S2244. Testing in continuous deployment: During the continuous deployment process, testing is also required to ensure that the deployed software version is stable and reliable.

[0044] Preferably, said S3 comprises the following steps:

[0045] S31. Pre-test: Before the formal test, a pre-test is conducted to check whether the test environment is normal, whether the test script is correct, whether the performance indicator monitoring is effective, and to make adjustments and optimizations based on the pre-test results to ensure the smooth progress of the formal test;

[0046] S32, Formal test: According to the test plan and test scenario, gradually increase the number of concurrent users or load, conduct performance testing, pay close attention to the changes in performance indicators during the test, record the test results, and stop the test when the performance indicators reach the expected threshold or a performance bottleneck occurs;

[0047] S33. Stress testing and stability performance: Perform stress testing under high load conditions to determine the software's extreme performance and stability, and conduct long-term stability testing to observe the performance of the software during continuous operation.

[0048] Preferably, S4 comprises the following steps:

[0049] S41, Data Analysis: Analyze the test results and calculate performance indicators such as average response time, throughput, and number of concurrent users;

[0050] S42, Problem location: Locate the cause of the performance problem based on the data analysis results;

[0051] S43, Optimization suggestions: According to the problem location results, make corresponding optimization suggestions.

[0052] Preferably, S5 comprises the following steps:

[0053] S51. Write a test report: summarize the test process and results, including test objectives, test environment, test scenarios, test results, problem analysis and optimization suggestions;

[0054] S52. Submit test report: Submit the test report to relevant personnel, such as the development team, project manager, and quality assurance personnel.

[0055] Compared with the related art, the computer software performance testing method provided by the present invention has the following advantages:

[0056] Beneficial effects:

[0057] The present invention provides a computer software performance testing method.

[0058] Improve maintainability:

[0059] By optimizing the script structure, using modular design and function encapsulation, different functions are separated into modules or functions, making the logic of the script clearer;

[0060] The clear structure also enables new testers to understand the logic of the script more quickly, improving team collaboration efficiency.

[0061] Enhanced reusability:

[0062] Function encapsulation allows common operations to be reused in different test scripts, avoiding repeated code writing;

[0063] The parameterized data-driven testing method separates the test data from the script, so that the same script can be tested using different data sets, increasing the versatility of the script;

[0064] Improve testing efficiency:

[0065] Reasonable use of loops and conditional judgments can automatically execute corresponding test steps according to different situations, reducing manual intervention and improving the degree of test automation.

[0066] Performance optimization measures can reduce unnecessary operations and execute tests in parallel, which can significantly shorten the testing time, especially in large-scale testing and regression testing, and can quickly obtain test results and speed up software iteration;

[0067] Improve test quality:

[0068] A complete error handling mechanism, including exception handling and error logging, can capture and handle errors during testing in a timely manner to avoid test interruptions caused by errors;

[0069] Integration with continuous integration and continuous deployment tools realizes automated testing, which enables testing immediately after code submission, timely discovering problems in the code, improving software quality, and testing during the continuous deployment process to ensure that the deployed software version is stable and reliable, reducing the risks caused by software defects;

[0070] Adapt to complex testing requirements: The choice of data file format can be flexibly adjusted according to different test scenarios and data characteristics. BRIEF DESCRIPTION OF THE DRAWINGS

[0071] Figure 1 A schematic diagram of a preferred embodiment of a computer software performance testing method provided by the present invention;

[0072] Figure 2 Schematic diagram of the operation of writing test scripts. DETAILED DESCRIPTION

[0073] The present invention will be further described below in conjunction with the accompanying drawings and implementation modes.

[0074] Please refer to Figure 1 and Figure 2 ,in, Figure 1 A schematic diagram of a preferred embodiment of a computer software performance testing method provided by the present invention; Figure 2 A computer software performance testing method includes the following steps:

[0075] S1. First, prepare for the computer software performance test;

[0076] S2, test the design after the test preparation in S1 is completed;

[0077] S21, determine the test scenario;

[0078] S22. Write test scripts;

[0079] S221. Script structure optimization;

[0080] S222, data driven testing;

[0081] S223, error handling optimization;

[0082] S224, performance optimization and continuous integration and continuous deployment;

[0083] S23, set performance indicator monitoring;

[0084] S3, after the test design technique in S2 is completed, the test execution can be carried out;

[0085] S4. After the test execution is completed, the test structure analysis is performed;

[0086] S5. Finally, the test report is compiled.

[0087] The S1 comprises the following steps:

[0088] S11. Clarify the test objectives: determine the software performance indicators to be tested and determine the key business processes and functional points for key testing based on the software usage scenarios and requirements;

[0089] S12. Specify the test plan: plan the test time, personnel, resource allocation and determine the requirements for setting up the test environment;

[0090] S13. Prepare test tools: select appropriate performance test tools and ensure that the test tools can meet the test requirements, and be familiar with how to use the tools;

[0091] S14. Build a test environment: Build a test environment similar to the production environment according to the test plan, minimize the impact of environmental differences on the test results, and install and configure the tested software to ensure that the software is in a stable state.

[0092] Clarify the test objectives: such as response time, throughput, number of concurrent users, resource utilization, and determine the key business processes and functional points for key testing based on the software's usage scenarios and requirements. Performance testing tools include JMeter and LoadRunner.

[0093] The S221 includes the following methods:

[0094] S2211, Modular design: Split the test script into multiple modules, each module implements a specific function;

[0095] S2212, Function Encapsulation: Encapsulate common operations into functions so that they can be reused in different test scripts;

[0096] S2213. Reasonable use of loops and conditional judgments: In test scripts, reasonable use of loops and conditional judgments can improve the flexibility and adaptability of the script.

[0097] Modular design: The login function, data input function, result verification function, etc. can be encapsulated into independent modules.

[0098] Function encapsulation: You can encapsulate a database query function and a file upload function. Function encapsulation can reduce code duplication and improve the readability and maintainability of the script.

[0099] Reasonable use of loops and conditional judgments: You can use loops to traverse multiple test data, and use conditional judgments to perform different operations according to different situations.

[0100] However, be careful to avoid overusing loops and conditionals, as this can make the script too complex and difficult to maintain.

[0101] The S222 includes the following methods:

[0102] S2221, parameterization: separate the test data from the test script and pass it into the test script in a parameterized way;

[0103] S2222. Data file format selection: Select a suitable data file format to store test data.

[0104] The S223 includes the following methods:

[0105] S2231. Exception handling: Add appropriate exception handling mechanisms to the test scripts so that errors can be captured and handled in a timely manner when they occur during the test process;

[0106] S2232. Error log recording: Add an error log recording function to the test script so that when an error occurs during the test, the error information can be recorded in time to facilitate subsequent problem troubleshooting and analysis.

[0107] The S224 includes the following methods:

[0108] S2241. Reduce unnecessary operations: In the test script, try to reduce unnecessary operations to improve the execution efficiency of the script;

[0109] S2242. Parallel test execution: The test tool supports parallel test execution. You can consider splitting the test script into multiple parts and executing these parts in parallel to improve test efficiency.

[0110] S2243. Integration with continuous integration tools: Integrate test scripts with continuous integration tools to automatically execute tests after code submission;

[0111] S2244. Testing in continuous deployment: During the continuous deployment process, testing is also required to ensure that the deployed software version is stable and reliable.

[0112] The S3 comprises the following steps:

[0113] S31. Pre-test: Before the formal test, a pre-test is conducted to check whether the test environment is normal, whether the test script is correct, whether the performance indicator monitoring is effective, and to make adjustments and optimizations based on the pre-test results to ensure the smooth progress of the formal test;

[0114] S32, Formal test: According to the test plan and test scenario, gradually increase the number of concurrent users or load, conduct performance testing, pay close attention to the changes in performance indicators during the test, record the test results, and stop the test when the performance indicators reach the expected threshold or a performance bottleneck occurs;

[0115] S33. Stress testing and stability performance: Perform stress testing under high load conditions to determine the software's extreme performance and stability, and conduct long-term stability testing to observe the performance of the software during continuous operation.

[0116] The S4 comprises the following steps:

[0117] S41, Data Analysis: Analyze the test results and calculate performance indicators such as average response time, throughput, and number of concurrent users;

[0118] S42, Problem location: Locate the cause of the performance problem based on the data analysis results;

[0119] S43, Optimization suggestions: According to the problem location results, make corresponding optimization suggestions.

[0120] The S5 comprises the following steps:

[0121] S51. Write a test report: summarize the test process and results, including test objectives, test environment, test scenarios, test results, problem analysis and optimization suggestions;

[0122] S52. Submit test report: Submit the test report to relevant personnel, such as the development team, project manager, and quality assurance personnel.

[0123] Compared with the related art, the computer software performance testing method provided by the present invention has the following advantages:

[0124] Beneficial effects:

[0125] The present invention provides a computer software performance testing method.

[0126] Improve maintainability:

[0127] By optimizing the script structure, using modular design and function encapsulation, different functions are separated into modules or functions, making the logic of the script clearer;

[0128] The clear structure also enables new testers to understand the logic of the script more quickly, improving team collaboration efficiency.

[0129] Enhanced reusability:

[0130] Function encapsulation allows common operations to be reused in different test scripts, avoiding repeated code writing;

[0131] The parameterized data-driven testing method separates the test data from the script, so that the same script can be tested using different data sets, increasing the versatility of the script;

[0132] Improve testing efficiency:

[0133] Reasonable use of loops and conditional judgments can automatically execute corresponding test steps according to different situations, reducing manual intervention and improving the degree of test automation.

[0134] Performance optimization measures can reduce unnecessary operations and execute tests in parallel, which can significantly shorten the testing time, especially in large-scale testing and regression testing, and can quickly obtain test results and speed up software iteration;

[0135] Improve test quality:

[0136] A complete error handling mechanism, including exception handling and error logging, can capture and handle errors during testing in a timely manner to avoid test interruptions caused by errors;

[0137] Integration with continuous integration and continuous deployment tools realizes automated testing, which enables testing immediately after code submission, timely discovering problems in the code, improving software quality, and testing during the continuous deployment process to ensure that the deployed software version is stable and reliable, reducing the risks caused by software defects;

[0138] Adapt to complex testing requirements: The choice of data file format can be flexibly adjusted according to different test scenarios and data characteristics.

[0139] The above descriptions are merely 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 computer software performance testing method, characterized in that: The following steps are involved: S1. First, prepare for the computer software performance test; S2, test the design after the test preparation in S1 is completed; S21, determine the test scenario; S22. Write test scripts; S221. Script structure optimization; S222, data driven testing; S223, error handling optimization; S224, performance optimization and continuous integration and continuous deployment; S23, set performance indicator monitoring; S3, after the test design technique in S2 is completed, the test execution can be carried out; S4. After the test execution is completed, the test structure analysis is performed; S5. Finally, the test report is compiled.

2. The computer software performance testing method according to claim 1, characterized in that: The S1 comprises the following steps: S11. Clarify the test objectives: determine the software performance indicators to be tested and determine the key business processes and functional points for key testing based on the software usage scenarios and requirements; S12. Specify the test plan: plan the test time, personnel, resource allocation and determine the requirements for setting up the test environment; S13. Prepare test tools: select appropriate performance test tools and ensure that the test tools can meet the test requirements, and be familiar with how to use the tools; S14. Build a test environment: Build a test environment similar to the production environment according to the test plan, minimize the impact of environmental differences on the test results, and install and configure the tested software to ensure that the software is in a stable state.

3. The computer software performance testing method according to claim 1, characterized in that: The S221 includes the following methods: S2211, Modular design: Split the test script into multiple modules, each module implements a specific function; S2212, Function Encapsulation: Encapsulate common operations into functions so that they can be reused in different test scripts; S2213. Reasonable use of loops and conditional judgments: In test scripts, reasonable use of loops and conditional judgments can improve the flexibility and adaptability of the script.

4. The computer software performance testing method according to claim 1, characterized in that: The S222 includes the following methods: S2221, parameterization: separate the test data from the test script and pass it into the test script in a parameterized way; S2222. Data file format selection: Select a suitable data file format to store test data.

5. The computer software performance testing method according to claim 1, characterized in that: The S223 includes the following methods: S2231. Exception handling: Add appropriate exception handling mechanisms to the test scripts so that errors can be captured and handled in a timely manner when they occur during the test process; S2232. Error log recording: Add an error log recording function to the test script so that when an error occurs during the test, the error information can be recorded in time to facilitate subsequent problem troubleshooting and analysis.

6. The computer software performance testing method according to claim 1, characterized in that: The S224 includes the following methods: S2241. Reduce unnecessary operations: In the test script, try to reduce unnecessary operations to improve the execution efficiency of the script; S2242. Parallel test execution: The test tool supports parallel test execution. You can consider splitting the test script into multiple parts and executing these parts in parallel to improve test efficiency. S2243. Integration with continuous integration tools: Integrate test scripts with continuous integration tools to automatically execute tests after code submission; S2244. Testing in continuous deployment: During the continuous deployment process, testing is also required to ensure that the deployed software version is stable and reliable.

7. The computer software performance testing method according to claim 1, characterized in that: The S3 comprises the following steps: S31. Pre-test: Before the formal test, a pre-test is conducted to check whether the test environment is normal, whether the test script is correct, whether the performance indicator monitoring is effective, and to make adjustments and optimizations based on the pre-test results to ensure the smooth progress of the formal test; S32, Formal test: According to the test plan and test scenario, gradually increase the number of concurrent users or load, conduct performance testing, pay close attention to the changes in performance indicators during the test, record the test results, and stop the test when the performance indicators reach the expected threshold or a performance bottleneck occurs; S33. Stress testing and stability performance: Perform stress testing under high load conditions to determine the software's extreme performance and stability, and conduct long-term stability testing to observe the performance of the software during continuous operation.

8. The computer software performance testing method according to claim 1, characterized in that: The S4 comprises the following steps: S41, Data Analysis: Analyze the test results and calculate performance indicators such as average response time, throughput, and number of concurrent users; S42, Problem location: Locate the cause of the performance problem based on the data analysis results; S43. Optimization suggestions: Based on the problem location results, make corresponding optimization suggestions.

9. The computer software performance testing method according to claim 1, characterized in that: The S5 comprises the following steps: S51. Write a test report: summarize the test process and results, including test objectives, test environment, test scenarios, test results, problem analysis and optimization suggestions; S52. Submit test report: Submit the test report to relevant personnel, such as the development team, project manager, and quality assurance personnel.