Test method and device, computer equipment, storage medium and program product
By obtaining test case tags and concurrent test parameters, automatically combining and executing test cases, it solves the problem of low efficiency of traditional performance testing methods and achieves efficient and accurate performance testing.
Patent Information
- Application Number
- CN202410658163.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-24
- Publication Date
- 2024-09-17
AI Technical Summary
Traditional performance testing methods are inefficient and require repeated tedious manual operations, resulting in low testing efficiency.
By obtaining test case tags and concurrent test parameters, automatically combine test cases, determine the number of concurrency and execute test cases, realize automated operation of test case combination, avoid manual adjustments, and improve test efficiency and accuracy.
It improves the efficiency and accuracy of performance testing, reduces manual operations, and realizes performance analysis and control from local to global levels.
Smart Images

Figure CN118656296A
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a testing method, apparatus, computer equipment, storage medium and program product. Background Art
[0002] With the continuous development of computer technology, the scale and complexity of software applications are increasing, the performance requirements of software are getting higher and higher, and performance testing technology has emerged. Performance testing is a testing method to evaluate the performance of software, systems or equipment.
[0003] In traditional technology, the interface of the test service is usually selected and then the performance test is performed using a performance test tool. However, in traditional technology, performance testing requires a lot of repeated and cumbersome manual operations, resulting in low efficiency of performance testing. Summary of the invention
[0004] Based on this, it is necessary to provide a testing method, apparatus, computer equipment, storage medium and program product that can improve the performance efficiency of the testing system in response to the above technical problems.
[0005] In a first aspect, the present application provides a testing method, comprising:
[0006] Get test case tags and concurrent test parameters for performance testing;
[0007] Get test case combinations based on test case tags;
[0008] For each test case in the test case combination, determine the test concurrency of the test case according to the concurrent test parameter, execute the test case under the test concurrency, and obtain the test result of the test case;
[0009] The test results of each test case are analyzed to obtain the test results of the test case combination.
[0010] In a second aspect, the present application also provides a testing device, comprising:
[0011] An acquisition module, used to obtain test case labels and concurrent test parameters for performance testing;
[0012] The acquisition module is also used to obtain test case combinations based on test case tags;
[0013] An execution module is used to determine the test concurrency of each test case in the test case combination according to the concurrent test parameter, and execute the test case under the test concurrency to obtain the test result of the test case;
[0014] The analysis module is used to analyze the test results of each test case to obtain the test results of the test case combination.
[0015] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above-mentioned test method when executing the computer program.
[0016] In a fourth aspect, the present application further provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above-mentioned test method are implemented.
[0017] In a fifth aspect, the present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned testing method when executed by a processor.
[0018] The above-mentioned test method, apparatus, computer equipment, storage medium and program product, by obtaining test case labels and concurrent test parameters for performance testing, and obtaining test case combinations based on the test case labels, realizes the operation of performing performance testing on flexibly set test case combinations, avoids the need to perform multiple repeated and tedious parameter adjustment operations on each test case when the application scenario to be tested includes multiple test cases, and is conducive to improving the efficiency of performance testing in multiple test case application scenarios; for each test case in the test case combination, the test concurrency number of the test case is determined according to the concurrent test parameters, and the test case is executed under the test concurrency number to obtain the test result of the test case, thereby realizing the automated operation of performing performance testing on each test case in the test case combination, and the concurrent test parameters are used. The number can determine the test concurrency number of different test cases, and the test cases can be executed in a targeted manner according to the test concurrency number corresponding to each test case, thereby orderly and efficiently realizing the performance test of each test case in the test case combination, and obtaining the test result of each test case, which improves the efficiency of performance testing and, to a certain extent, ensures the accuracy of the test result of the test case combination; the test results of each test case are comprehensively analyzed to obtain the test result of the test case combination, realizing the performance analysis control from the local test case to the global test case combination, and ensuring the accuracy of the performance test of the test case combination; the entire performance test execution process is automated, avoiding unnecessary manual operations, and greatly improving the efficiency of system performance testing for specific application scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0020] Figure 1 An application environment diagram of a test method in an embodiment;
[0021] Figure 2 A schematic diagram of a test method in one embodiment;
[0022] Figure 3 A schematic diagram of an indicator reflection graph in one embodiment;
[0023] Figure 4 A schematic diagram of a performance test process in an embodiment;
[0024] Figure 5 is a flow chart of a performance test in another embodiment;
[0025] Figure 6 is a structural block diagram of a testing device in one embodiment;
[0026] Figure 7 is an internal structure diagram of a computer device in one embodiment;
[0027] Figure 8 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0028] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0029] The test method provided in the embodiment of the present application can be applied to Figure 1In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. Among them, the terminal 102 can be but is not limited to various personal computers, laptops, smart phones, tablets, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server 104 can be implemented with an independent server or a server cluster consisting of multiple servers.
[0030] The terminal and the server can be used together to execute the testing method provided in the embodiments of the present application.
[0031] For example, the server obtains test case labels and concurrent test parameters for performance testing from the terminal; the server obtains a test case combination based on the test case labels; the server determines the test concurrency of the test case for each test case in the test case combination according to the concurrent test parameters, and executes the test case under the test concurrency to obtain the test result of the test case; the server analyzes the test result of each test case to obtain the test result of the test case combination; the terminal receives the test result of the test case combination sent by the server, and displays the test result of the test case combination.
[0032] In an exemplary embodiment, Figure 2 As shown, a test method is provided, which is applied to Figure 1 The server in the example is used to illustrate. Figure 2 , the test method includes the following steps:
[0033] Step S200, obtaining test case labels and concurrent test parameters for performance testing.
[0034] Among them, the test case label is used to characterize the application scenario. The application scenario can be a system startup scenario, such as a login scenario; the system can be any type of system without limitation. Concurrency test parameters refer to the basic data required to realize the automated performance test of the system; it includes the starting concurrency, ending concurrency and interval concurrency required for the test cases related to the application scenario represented by the test case label to perform automated performance testing. Subsequently, the data fusion and comparison between the starting concurrency, ending concurrency and interval concurrency of each test case can be used to realize the automated performance test of each test case under multiple different test concurrencies; the test case corresponding to the application scenario can be understood by the following example. For example, when completing the login scenario, the login scenario can be divided into multiple test cases. There can be an execution priority relationship between the test cases. According to the execution priority relationship between the test cases, the performance test of each test case can be performed in turn, and then the performance test of the login scenario is completed, from the local to the overall, so that the effect of the login scenario performance test is better. Among them, the concurrency refers to the number of requests executed concurrently when performing the case performance test, such as the number of links accessing the server site at the same time, or the number of requests processed by the system at the same time. The starting concurrency refers to the starting test concurrency when the test case performs automated performance testing. The ending concurrency refers to the concurrency used to limit the test case to terminate the automated performance test. The interval concurrency refers to the interval value between adjacent test concurrency when the test case performs automated performance testing, which is used to achieve automatic changes in the test concurrency, thereby improving the efficiency of performance testing.
[0035] In one embodiment, obtaining test case labels and concurrent test parameters may include: receiving performance test instructions, and obtaining test case labels and concurrent test parameters from the performance test instructions; wherein, generating performance test instructions may include: logging into the Jenkins tool, entering the automated performance test interface, the terminal responding to the performance test related information entered in the creation of the automated performance test interface, the performance test related information including the test case labels and concurrent test parameters, and generating performance test instructions based on the performance test related information; the terminal may send the performance test instructions to the server, the server receives the performance test instructions, and prepares data for performance testing the system.
[0036] Exemplarily, the continuous integration tool can be logged in through the terminal, and in the performance test task construction interface, the test case label that can characterize the application scenario to be tested and the concurrent test parameters corresponding to each test case related to the application scenario to be tested can be input, and the performance test instruction is generated based on the test case label and the concurrent test parameter, and the performance test instruction is sent to the server, so that the server can subsequently implement the automated performance test of the test case related to the application scenario to be tested based on the performance test instruction. Among them, the continuous integration tool includes but is not limited to the Jenkins tool. Jenkins is an open source software project. It is a continuous integration tool developed based on Java, which is used to monitor continuous and repetitive work and aims to provide an open and easy-to-use software platform so that software projects can be continuously integrated. Through a visual way, the application scenario of the test can be flexibly selected according to actual needs, and the concurrent test parameters for implementing automated performance testing can be set according to actual needs. Multiple test cases can be set for one application scenario, which improves the convenience of parameter setting when the system is performance tested, and lays a data foundation for improving the efficiency of performance testing.
[0037] Step S202, obtaining a test case combination based on the test case label.
[0038] The test case combination refers to a combination of test cases related to the application scenarios represented by the test case labels.
[0039] Exemplarily, each test case in the test case combination may have one or more scenario use case labels for determining the scenario use case labels related to the test case label. Test cases belonging to the same application scenario have the same scenario use case label. The test case combination to which the test case belongs can be determined based on the scenario use case label. In other words, if the scenario use case label of the test case is consistent with the test case label, then the test case belongs to the test case combination corresponding to the test case label.
[0040] Step S204, for each test case in the test case combination, determine the test concurrency of the test case according to the concurrent test parameter, and execute the test case under the test concurrency to obtain the test result of the test case.
[0041] Among them, the test concurrency refers to the number of requests executed concurrently when the test case is subjected to performance testing; the concurrent test parameters include the concurrent test parameters of each test case in the test case combination. The concurrent test parameters of a test case include the starting concurrency, the interval concurrency and the termination concurrency. When a test case is subjected to performance testing, there are multiple test concurrencies. The test concurrency can be obtained by taking the starting concurrency as the starting value and the interval concurrency as the interval value, and accumulating multiple times to the termination concurrency. For example, the starting concurrency of the concurrent test parameters of a test case is 100, If the interval concurrency is 50 and the termination concurrency is 300, the test concurrency of the test case during the performance test is 100, 100+50=150, 150+50=200, 200+50=250 and 250+50=300. The test case is executed based on the test concurrency of 100, 150, 200, 250 and 300, respectively, so as to obtain the reference test results obtained under different test concurrency numbers, and the test results of the test case are obtained according to the reference test results obtained under different test concurrency numbers. The concurrent test parameters corresponding to different test cases in the test case combination can be the same or different, and can be set according to actual needs.
[0042] The test result of a test case refers to the reference test result obtained by executing the test case under multiple different test concurrency numbers, and the maximum concurrency number of the test case is determined based on the analysis of the reference test result. The reference test result refers to the indicator test result under different test concurrency numbers. The indicator test result refers to the indicator execution result generated during the performance test, such as request execution error rate, request processing speed, etc. Each test case can have indicator test results corresponding to different indicator types. The indicator type can be added according to the actual situation, and can include but is not limited to indicator test results of types such as request execution error rate, representative response time, request processing speed, and CPU occupancy. When the test case is executed under different test concurrency numbers, the indicator test results corresponding to each indicator type may change. The indicator test results of different indicator types of the same test case under different test concurrency numbers can be analyzed to determine the maximum concurrency number of the test case under this performance test, thereby realizing local testing and analysis of performance testing of the application scenario to be tested, and ensuring the accuracy of local testing and analysis.
[0043] Exemplarily, each test case in the test case combination may also have one or more reference case labels used to characterize the test case itself, and each test case in the same test case combination may have a corresponding execution priority. When the test case combination is subjected to performance testing, the test case currently being subjected to performance testing may be determined based on the reference case label and execution priority of the test case. When the test cases in the same application scenario are subjected to performance testing, they are not executed in parallel, but are executed based on the execution priority of the test cases, thereby avoiding excessive occupation of system resources during the execution process, and adversely affecting the index test results generated when other application scenarios are subjected to performance testing. For example, if the test case combination includes test case A (execution priority 1), test case B (execution priority 2), and test case C (execution priority 3), then test case A is executed first, and test case B is executed after test case A is executed, and then test case C is executed after test case B is executed.
[0044] In more detail, based on the test case label and execution priority of the test case, the current test case can be determined from the test case combination, and the starting concurrency of the current test case can be used as the current test concurrency of the current test case; the current test case is executed under the current test concurrency to obtain a reference test result of the current test case; the fusion value between the current test concurrency and the interval concurrency of the current test case is calculated, and the current test concurrency is updated according to the fusion value; if the updated current test concurrency is less than the termination concurrency of the current test case, then the step of executing the current test case under the current test concurrency to obtain a reference test result of the current test case is returned; if the updated current test concurrency is equal to or greater than the termination concurrency of the current test case, the test result of the current test case is determined based on the obtained reference test result; the test case with the next execution priority is used as the current test case, and the step of using the starting concurrency of the current test case as the current test concurrency of the current test case is returned until each test case in the test case combination obtains the corresponding test result.
[0045] When performing performance testing on test cases, the test cases can be executed in order from small to large test concurrency numbers, thereby avoiding the situation where if the test concurrency number is too large, the performance test effect will be destroyed or the performance test of other application scenarios will be affected. To a certain extent, the accuracy of the performance test can be ensured.
[0046] Furthermore, the reference test results include indicator test results under different test concurrency numbers. The indicator test results of the same indicator type obtained by executing the test case under different test concurrency numbers can be compared with the corresponding indicator standard values, and the test concurrency numbers that meet the indicator standard values in different indicator types can be screened out. The test concurrency numbers that meet the indicator standard values are used as candidate test concurrency numbers, and the maximum screening concurrency number of the indicator type is determined from the candidate test concurrency numbers corresponding to the same indicator type, so as to first analyze the system performance status according to a single indicator type, and determine the optimal performance of the test case execution from multiple single aspects; then, different indicator types are combined. The maximum screening concurrency corresponding to the type is compared, and the smallest value is selected as the target screening concurrency of the test case, and the test result of the test case is generated based on the target screening concurrency, so as to realize performance analysis based on comprehensive multi-faceted performance indicators, and ensure that the performance indicators of the test case in each dimension meet the overall performance situation, from unilateral to multi-faceted, layer by layer, thereby better ensuring the accuracy of the test case performance analysis, and can more accurately determine the maximum test concurrency (i.e., the target screening concurrency) corresponding to each test case in the test case combination when maintaining good performance during execution, providing an accurate data basis for finally determining the test result of the test case combination.
[0047] Step S206, analyzing the test result of each test case to obtain the test result of the test case combination.
[0048] Among them, the test results of the test case combination refer to the performance test analysis results corresponding to the application scenarios represented by the test case labels; they include the highest concurrency number when the application scenarios corresponding to the test case combination are executed in the system. When the application scenarios represented by the test case combination are executed with the highest concurrency number in the system, the stability and performance of the software execution related to the application scenario are better, thereby ensuring better performance of the system.
[0049] Specifically, the performance bottleneck of the application scenario corresponding to the test case combination in the system can be determined by analyzing the test results of each test case in the test case combination. To ensure that each test case in the test case combination can be executed according to a better performance state, the minimum target screening concurrency in the test results of the test cases in the test case combination can be used as the maximum concurrency corresponding to the test case combination, and the test results of the test case combination are generated according to the maximum concurrency. It should be noted that the test results of the test case combination include but are not limited to the maximum concurrency, and can also include other data information obtained based on the analysis of the reference test results of each test case in the test case combination, such as the increase ratio between adjacent test concurrencies of the indicator test results corresponding to each indicator type, etc.
[0050] In the above test method, by obtaining the test case label and concurrent test parameters for performance testing, and obtaining the test case combination based on the test case label, the performance testing operation of the flexibly set test case combination is realized, and when the application scenario to be tested includes multiple test cases, it is avoided that multiple repeated and tedious parameter adjustment operations are needed for each test case, which is conducive to improving the efficiency of performance testing in multiple test case application scenarios; for each test case in the test case combination, the test concurrency number of the test case is determined according to the concurrent test parameters, and the test case is executed under the test concurrency number to obtain the test result of the test case, which realizes the automated operation of performance testing of each test case in the test case combination, and the concurrent test parameters can determine different test cases The test concurrency number of the trial case can be used to execute the test cases in a targeted manner according to the test concurrency number corresponding to each test case, thereby realizing the performance test of each test case in the test case combination in an orderly and efficient manner, and obtaining the test result of each test case, which improves the efficiency of performance testing while ensuring the accuracy of the test result of the test case combination to a certain extent; the test results of each test case are comprehensively analyzed to obtain the test result of the test case combination, realizing the performance analysis control from the local test case to the global test case combination, and ensuring the accuracy of the performance test of the test case combination; the entire performance test execution process is automated, avoiding unnecessary manual operations, and greatly improving the efficiency of system performance testing for specific application scenarios.
[0051] In one embodiment, the concurrent test parameters include the concurrent test parameters of each test case in the test case combination, and the concurrent test parameters of a test case include the starting concurrent number, the ending concurrent number, and the interval concurrent number; step S204 includes:
[0052] Step S300, taking the starting concurrent number as the current test concurrent number of the test case.
[0053] Among them, the current test concurrency refers to the test concurrency corresponding to the current performance test operation of the test case; the test case can be executed from the starting concurrency, and the interval concurrency is the interval value of the test concurrency, and the termination concurrency is the boundary value for terminating the performance test execution. It can be executed cyclically and automatically under multiple different test concurrency numbers, thereby avoiding the situation where a test concurrency number needs to be manually modified every time the test concurrency number changes, and greatly improving the efficiency of performance testing of each test case.
[0054] Step S302, executing the test case under the current test concurrency number to obtain a reference test result of the test case.
[0055] The reference test results refer to the test results of various indicators generated when the test case is executed under the current test concurrency, including but not limited to request execution error rate, response time, request processing speed and CPU usage.
[0056] Step S304, calculating a fusion value between the current test concurrency number and the interval concurrency number, and updating the current test concurrency number according to the fusion value.
[0057] The fusion value between the current test concurrency number and the corresponding interval concurrency number refers to the value obtained by adding the current test concurrency number to the interval concurrency number.
[0058] Step S306, if the updated current test concurrency number is less than the termination concurrency number, return to the step of executing the test case under the current test concurrency number to obtain the reference test result of the test case.
[0059] Step S308: If the updated current test concurrency number is equal to or greater than the corresponding termination concurrency number, the test result of the test case is determined based on the obtained reference test result.
[0060] Exemplarily, the test cases in the test case combination may have corresponding execution priorities, and which test case is currently being performance tested may be determined based on the execution priority of the test case. In addition, each test case has corresponding concurrent test parameters, and multiple test concurrency numbers corresponding to the test case may be determined based on the starting concurrency number, interval concurrency number, and termination concurrency number in the test concurrency parameters. When the test case is performance tested, the starting concurrency number may be used as the current test concurrency number, and the test case may be executed based on the current test concurrency number to generate a reference test result corresponding to the test case under the current test concurrency number. The current test concurrency number and the interval concurrency number may then be added together to form a fused value as the updated current test concurrency number. When the updated current test concurrency number is less than the termination concurrency number, the test case may be executed based on the updated current test concurrency number to generate a reference test result corresponding to the test case under the updated current test concurrency number. This process may be repeated until the current test concurrency number is equal to or greater than the corresponding termination concurrency number, and the reference test results corresponding to the test case under multiple different test concurrency numbers are obtained.
[0061] Furthermore, the maximum screening concurrency corresponding to the test case under the same indicator type can be determined based on the reference test results corresponding to the test case under multiple different test concurrency numbers, and the minimum value of the maximum screening concurrency numbers of different indicator types can be used as the target screening concurrency number of the test case, and the test result of the test case is generated based on the target screening concurrency number. Other test cases are executed in the same way, thereby realizing automated performance testing of each test case in the test case combination, without the need to adjust the test concurrency number multiple times, and greatly improving the efficiency of performance testing.
[0062] In the above embodiment, through the concurrent test parameters corresponding to the test cases in the test case combination, the execution of the test cases under multiple different test concurrency numbers is automatically realized, and the reference test results corresponding to the test cases under multiple different test concurrency numbers are obtained, and then further analysis is performed based on the reference test results to determine the test results of the test cases, thereby realizing the automation of the execution of each test case in the test case combination under the corresponding multiple different test concurrency numbers, without the need to manually adjust the test concurrency number multiple times, thereby greatly improving the efficiency of performance testing.
[0063] In one embodiment, the reference test results include indicator test results under different test concurrency numbers; in step S308, based on the obtained reference test results, determining the test results of the test case includes:
[0064] Step S400, for each indicator test result, based on the indicator standard value and the indicator test results under different test concurrency numbers, screen the maximum screening concurrency number.
[0065] Step S402, determining a target screening concurrency based on the maximum screening concurrency obtained by screening, and generating a test result of the test case according to the target screening concurrency.
[0066] Among them, the indicator test result refers to the indicator execution result generated during the performance test, including the result values of multiple indicator types during the performance test, including but not limited to one or more of the request execution error rate, representative response time, request processing speed increase ratio, and central processing unit occupancy rate. The indicator standard value refers to the threshold used to measure the same indicator type to characterize the system performance in the preset expected state; different indicator types can have corresponding indicator standard values, that is, the indicator standard values corresponding to different indicator types are different. The maximum screening concurrency refers to the test concurrency corresponding to the best performance determined by comparing the same indicator type when the test case is executed under multiple different test concurrencies. It is the result of comparing the same indicator type; for example, it can be understood in combination with the following Table 1. The starting concurrency of the test case is 100, the interval concurrency is 50, and the ending concurrency is 200. The indicator types in the indicator test results include indicator type A and indicator type B. The indicator standard value of indicator type A is 4, and the indicator standard value of indicator type B is 6. When the value of indicator type A is greater than or equal to 4 The value of indicator type A is the indicator test result that meets the indicator standard value. When the value of indicator type B is less than or equal to 6, the value of indicator type B is the indicator test result that meets the indicator standard value. Under different test concurrency numbers, the indicator test results of the same indicator type are compared. It can be seen that when indicator type A meets the indicator standard value, the corresponding test concurrency numbers are 100 and 150, and when indicator type B meets the indicator standard value, the corresponding test concurrency number is 200. The maximum screening concurrency number corresponding to indicator type A is 150, and the maximum screening concurrency number corresponding to indicator type B is 200.
[0067] Table 1
[0068]
[0069] The target screening concurrency number refers to the test concurrency number corresponding to the best test case execution performance; the minimum value of the maximum screening concurrency numbers corresponding to different indicators can be used as the target screening concurrency number; the target screening concurrency number is determined by comparing different indicator types, which considers a wider range than the comparison analysis of the same indicator type, thereby achieving a comprehensive evaluation from a small range to a large range, so as to further improve the accuracy of the test case test results; for example, it can be understood in combination with the above Table 1. From the above, it can be seen that the maximum screening concurrency number corresponding to indicator type A is 150, and the maximum screening concurrency number corresponding to indicator type B is 200, then the target screening concurrency number is 150, which can ensure that whether the system performance is measured by indicator type A or indicator type B, the high performance execution of the test case can be guaranteed.
[0070] Exemplarily, in order to ensure the accuracy of the test results of the test case, the indicator test results corresponding to the same indicator type in the test case under multiple different test concurrency numbers can be compared with the corresponding indicator standard values, and the test concurrency numbers corresponding to the performance indicator results corresponding to the same indicator type that meet the indicator standard values can be used as candidate test concurrency numbers for the corresponding indicator type, and then the maximum screening concurrency numbers for the corresponding indicator type can be obtained from the candidate test concurrency numbers corresponding to the same indicator type, so as to obtain the maximum screening concurrency numbers corresponding to the test case under different indicator types.
[0071] Furthermore, the maximum screening concurrency numbers corresponding to different indicator types are compared, and the maximum screening concurrency number with the smallest screening value is used as the target screening concurrency number of the test case, and the test results of the test case are generated based on the target screening concurrency number, thereby taking into account the judgment of each indicator type on the test case performance, and further improving the accuracy of the test case performance test.
[0072] In the above embodiment, the maximum screening concurrency corresponding to each indicator type is determined by first comparing the indicator test results of the test case at multiple different test concurrency numbers with the corresponding indicator standard values, and then the target screening concurrency is determined from the maximum screening concurrency numbers of different indicator types, and the test results of the test case are generated based on the target screening concurrency. The progressive consideration from a single indicator type to multiple indicator types is conducive to improving the accuracy of the test results of the test case.
[0073] In one embodiment, in step S400, based on the indicator standard value and the indicator test results under different test concurrency numbers, screening the maximum screening concurrency number includes:
[0074] Step S500, screening the indicator test results that meet the indicator standard value according to the indicator test results under different test concurrency numbers.
[0075] Step S502: If the screening is successful, the test concurrency number corresponding to the screened indicator test result is used as the candidate test concurrency number, and the maximum screening concurrency number is determined based on the candidate test concurrency number.
[0076] Step S504: If the screening fails, the preset screening concurrency number is used as the maximum screening concurrency number.
[0077] Among them, the candidate test concurrency refers to the test concurrency corresponding to the indicator test result when the indicator test result meets the indicator standard value, which may be one or more. The preset screening concurrency refers to the preset value used to reflect the situation that there is no indicator test result that meets the indicator standard value; it can be customized to a preset fixed value, such as 0. If there is no indicator test result that meets the indicator standard value under multiple test concurrency numbers, it means that even if the test case is executed with the starting concurrency number as the starting test concurrency number, the performance of the test case execution is judged according to the indicator test result obtained by execution. The performance status is not in line with the preset expected performance state. Correspondingly, if other test concurrency numbers are larger than the starting concurrency number, the performance status of the test case executed under other test concurrency numbers will be worse. The maximum screening concurrency number of the indicator type corresponding to the indicator test result can be directly set to a custom fixed value, such as 0, so that the concurrent test parameters can be adjusted according to the feedback when the concurrent test parameters are set next time to improve the accuracy of the performance test, such as reducing the starting concurrency number.
[0078] Exemplarily, for indicator test results of the same indicator type, the test concurrency corresponding to the indicator test results that meet the corresponding indicator standard value in the indicator test results under different test concurrency numbers can be used as the candidate test concurrency number, and the largest candidate test concurrency number can be used as the maximum screening concurrency number, so as to determine the maximum screening concurrency number corresponding to each indicator type; if there is no indicator test result that meets the corresponding indicator standard value in the indicator test results under different test concurrency numbers, the preset screening concurrency number will be used as the maximum screening concurrency number, so that it can be recorded in the performance test analysis report of the test case combination later, so that when the performance test of the test case combination is performed again in the future, more suitable concurrent test parameters can be adjusted, thereby further improving the accuracy of the performance test results.
[0079] In the above embodiment, the test concurrency corresponding to the indicator test result that meets the indicator standard value in the indicator test results under different test concurrency numbers is used as the candidate test concurrency number, and the maximum screening concurrency number is determined from the candidate test concurrency number, otherwise the preset screening concurrency number is used as the maximum screening concurrency number, thereby realizing the operation of determining the maximum screening concurrency number from each indicator test result, which is beneficial to analyzing the performance test situation locally and, to a certain extent, is beneficial to improving the accuracy of performance test analysis of test case combinations.
[0080] In one embodiment, the indicator test result is any one or more of the following: request execution error rate, representative response time, request processing speed increase ratio, and central processing unit occupancy rate; the conditions for screening the indicator test results that meet the indicator standard value include but are not limited to the following:
[0081] Case 1: When the indicator test result includes a request execution error rate, the indicator test result that meets the indicator standard value includes a request execution error rate that is equal to or less than a preset request execution error rate.
[0082] The request execution error rate refers to the percentage of the number of request failures divided by the total number of requests when the test case is executed under the test concurrency number. The preset request execution error rate refers to the threshold used to measure the system performance reflected by the request execution error rate.
[0083] Exemplarily, the request execution error rate can reflect the failure and success of request execution during the execution of the test case. The higher the request execution error rate, the worse the performance of the test case under the corresponding test concurrency. The request execution error rate can be used as an evaluation indicator for test case performance testing. When the request execution error rate corresponding to the test case under a certain test concurrency is equal to or less than the preset request execution error rate, it means that the performance state of the test case under this test concurrency is in the preset performance expectation state. In order to determine the test concurrency corresponding to the preset performance expectation state for the test case based on the evaluation indicator of the request execution error rate, the test concurrency corresponding to the request execution error rate of the test case under multiple test concurrency numbers can be used as the candidate test concurrency number, and then the candidate test concurrency numbers can be selected from the candidate test concurrency numbers. The maximum screening concurrency is selected from the numbers, so as to determine the highest concurrency that the test case execution performance can withstand (that is, the corresponding maximum screening concurrency) when the request execution error rate is used as the evaluation indicator; for example, the preset request execution error rate is 0%, the starting concurrency is 350, the interval concurrency is 50, and the termination concurrency is 450. When the test concurrency is 350, the corresponding request execution error rate is 0%, when the test concurrency is 400, the corresponding request execution error rate is 0%, and when the test concurrency is 450, the corresponding request execution error rate is 2%. The candidate concurrency numbers are 350 and 400, and the maximum screening concurrency is 400.
[0084] Case 2: When the indicator test result includes a representative response time, the indicator test result that meets the indicator standard value includes a representative response time that is equal to or less than a preset response time.
[0085] Among them, the representative response time is determined by the response time of the test case executing the request under the test concurrency number; the determination of the representative response time includes: sorting the response time of each request executed by the test case under the test concurrency number in order from small to large, and taking the response time at the preset position after sorting as the representative response time; the preset position can be the 90th position, which is conducive to limiting the response time of 90% of the requests to meet the preset performance conditions, avoiding the situation where the performance status is greatly different through the average response time and other methods. It should be noted that each test concurrency number determines the representative response time corresponding to the test case under the test concurrency number in the same way, that is, under multiple different test concurrency numbers, the representative response time corresponding to the test case under multiple different test cases can be determined according to the above representative response time determination method. The preset response time refers to the threshold used to measure the system performance reflected by the response time.
[0086] Exemplarily, the execution performance of the test case can also be judged based on the representative response time. The longer the response time, the worse the performance of the test case execution. Therefore, if the representative response time is less than or equal to the preset representative response time, it means that the performance state of the test case executed under the test case corresponding to this situation meets the preset performance expectation state. The test concurrency corresponding to the representative response time equal to or less than the preset representative response time can be used as the candidate test concurrency, and then the maximum value is selected from the candidate test concurrency as the maximum screening concurrency. For example, the preset representative response time is 500ms, the starting concurrency is 100, the interval concurrency is 50, and the ending concurrency is 150. When the test concurrency is 100, the corresponding representative response time is 400ms, and when the test concurrency is 150, the corresponding representative response time is 550ms. Then the candidate test concurrency and the maximum screening concurrency are both 100.
[0087] In addition, if there is no situation where the representative response time is equal to or less than the preset response time, the maximum screening concurrency can be directly set to a preset fixed value of the custom setting, such as 0, so as to provide reference information when adjusting the concurrent test parameters, and then further improve the accuracy of the performance test when performing performance testing based on the adjusted concurrent test. For example, if the preset representative response time is 500ms, the starting concurrency is 100, the interval concurrency is 50, and the ending concurrency is 150, the corresponding representative response time when the test concurrency is 100 is 550ms, and the corresponding representative response time when the test concurrency is 150 is 700ms, the maximum screening concurrency can be set to 0.
[0088] Case 3: When the indicator test result includes a request processing speed increase ratio, the indicator test result that meets the indicator standard value includes a request processing speed increase ratio that is equal to or greater than a preset request processing speed increase ratio.
[0089] Among them, the request processing speed increase ratio refers to the increase ratio of the request processing speed between adjacent test concurrency numbers; for example, the interval concurrency is 50, and the adjacent test concurrency numbers are 100 and 150. When the test concurrency is 100, the corresponding request processing speed is a, and when the test concurrency is 150, the corresponding request processing speed is b. Then the request processing speed increase ratio between the test concurrency numbers of 100 and 150 is (ba) / a*100%. The request processing speed refers to the speed of processing requests, or the number of requests processed per second; the request processing speed can be the value of the total number of requests executed by the test case under the test concurrency divided by the total processing time. The preset request processing speed increase ratio refers to the threshold used to measure the system performance reflected by the request speed increase ratio.
[0090] Exemplarily, the execution performance of the test case can also be judged according to the request processing speed increase ratio. The greater the request processing speed or the greater the request processing speed increase ratio, the better the execution performance of the test case. The greater the request processing speed increase ratio, the more the server's processing capacity is sufficient and there is still room for increase. Therefore, the test concurrency corresponding to the request processing speed increase ratio equal to or greater than the preset request processing speed increase ratio can be used as the candidate test concurrency, and then the maximum value among the candidate test concurrency is used as the maximum screening concurrency. For example, the preset request processing speed increase ratio is 1%, the starting concurrency is 300, the interval concurrency is 50, the ending concurrency is 400, the request processing speed increase ratio between the test concurrency of 300 and the test concurrency of 350 is 3%, and the request processing speed increase ratio between the test concurrency of 350 and the test concurrency of 400 is 0.5%. Then the candidate test concurrency is 300 and 350, and the maximum screening concurrency is 350.
[0091] In addition, if there is no situation where the request processing speed increase ratio is equal to or greater than the preset request processing speed increase ratio, the maximum screening concurrency can be directly set to a preset fixed value of the custom setting, such as 0, so as to provide reference information when adjusting the concurrent test parameters, and then further improve the accuracy of the performance test when performing performance testing based on the adjusted concurrent test. For example, if the preset request processing speed increase ratio is 1%, the starting concurrency is 100, the interval concurrency is 50, and the ending concurrency is 150, the request processing speed increase ratio between the test concurrency of 100 and the test concurrency of 150 is 0.8%, and the maximum screening concurrency can be set to 0.
[0092] In one embodiment, since to a certain extent, the faster the request processing speed, the better the execution performance, the preset request processing speed can also be used as the standard value of the indicator, and the test concurrency number corresponding to the request processing speed equal to or greater than the preset request processing speed is used as the candidate test concurrency number, and the maximum screening concurrency number is obtained from the candidate test concurrency number; if there is no request processing speed equal to or greater than the preset request processing speed in the reference test results under multiple different test concurrency numbers, the preset screening concurrency number is used as the maximum screening concurrency number.
[0093] Case 4: when the indicator test result includes the CPU occupancy rate, the indicator test result satisfying the indicator standard value includes a CPU occupancy rate that is equal to or less than a preset CPU occupancy rate.
[0094] The CPU usage rate refers to the usage rate of the CPU (Central Processing Unit) resources during the execution of the test case under the test concurrency number. The highest value of the CPU resource usage rate during the execution of the test case under the test concurrency number can be used as the CPU usage rate. The preset CPU usage rate refers to the threshold used to measure the system performance reflected by the CPU usage rate.
[0095] Exemplarily, the execution performance of the test case can also be judged according to the CPU occupancy rate. The larger the CPU occupancy rate, the more likely it is that the CPU resources will be over-occupied during the execution of the test case, and the worse the relative execution performance. If the CPU occupancy rate is equal to or less than the preset CPU occupancy rate, it means that the performance state of the test case execution meets the preset performance expectation state. Therefore, the test concurrency corresponding to the CPU occupancy rate equal to or less than the preset CPU occupancy rate can be used as the candidate test concurrency number, and then the maximum value among the candidate test concurrency numbers is used as the maximum screening concurrency number. For example, the preset CPU occupancy rate is 70%, the starting concurrency number is 300, the interval concurrency number is 50, and the ending concurrency number is 400. When the test concurrency number is 300, the corresponding CPU occupancy rate is 66%, when the test concurrency number is 350, the corresponding CPU occupancy rate is 70%, and when the test concurrency number is 400, the corresponding CPU occupancy rate is 73%. Then the candidate test concurrency numbers are 300 and 350, and the maximum screening concurrency number is 350.
[0096] In addition, if there is no situation where the CPU usage is less than or equal to the preset CPU usage, the maximum screening concurrency can be directly set to a preset fixed value of the custom setting, such as 0, so as to provide reference information when adjusting the concurrent test parameters, and then further improve the accuracy of the performance test when performing performance testing based on the adjusted concurrent test. For example, if the preset CPU usage is 70%, the starting concurrency is 100, and the corresponding CPU usage is 72% when the test concurrency is 100, then the maximum screening concurrency can be set to 0.
[0097] In the above embodiment, by screening out the maximum screening concurrency corresponding to the indicator test results that meet the indicator standard value in the case of indicator test results of different indicator types, it is beneficial to consider from multiple dimensions and provide more accurate data for the subsequent determination of the target screening concurrency of the test case, thereby improving the accuracy of the test results of the analysis test case to a certain extent.
[0098] In one embodiment, the test case label is used to characterize the application scenario to be tested; the test case combination includes test cases related to the application scenario to be tested. The terminal can respond to the test case label selected or input on the performance test task construction interface, and determine the test case combination corresponding to the application scenario to be tested based on the test case label, thereby realizing a flexible combination of test cases related to application scenarios corresponding to different requirements, thereby improving the flexibility of the system in performing performance testing.
[0099] In one embodiment, the test result of each test case includes a target filtering concurrency number; step S206 includes: comparing the target filtering concurrency number of each test case in the test case combination with the concurrency number filtering condition, and taking the target filtering concurrency number that meets the concurrency number filtering condition as the test result of the test case combination.
[0100] The concurrency filter condition refers to the condition for filtering the most suitable test concurrency for the test case combination; the concurrency filter condition can be satisfied by the minimum value among the concurrency filters of the filtering targets.
[0101] Specifically, in order to take into account the execution performance of each test case in the test case combination, the minimum target screening concurrency number in the test case can be used as the maximum concurrency number of the test case combination, and the test results of the test case combination can be generated based on the maximum concurrency number, thereby realizing performance analysis control from the local test case to the global test case combination, and ensuring the accuracy of the performance analysis results obtained from the performance test of the test case combination.
[0102] In the above embodiment, by taking the target screening concurrency satisfying the concurrency screening condition as the test result of the test case combination, the accuracy of the performance test of the test case combination is improved while ensuring that each test case meets the preset performance expectations.
[0103] In one embodiment, the test result of each test case includes a target screening concurrency number and an indicator test result under different test concurrency numbers; the test method further includes:
[0104] Step S600, based on the indicator test results of each test case under different test concurrency numbers, calculate the indicator increase ratio of the indicator test results of the same indicator type between adjacent test concurrency numbers.
[0105] Among them, the indicator increase ratio refers to the increase ratio between indicator test results corresponding to the same indicator type under adjacent test concurrency numbers; the indicator increase ratio can be used to further analyze and determine the interval of the highest concurrency number corresponding to the test case; it can also be used to analyze and adjust the values of the starting concurrency number, interval concurrency number and ending concurrency number in the concurrent test parameters corresponding to the test case; the indicator increase ratio can be calculated as follows: when the adjacent test concurrency numbers are 100 and 150, the indicator test result of indicator type A when the test concurrency number is 100 is a1, and the indicator test result of indicator type A when the test concurrency number is 150 is a2, then the indicator increase ratio corresponding to indicator type A when the adjacent test concurrency numbers are 100 and 150 is (a2-a1) / a1*100%; the indicator increase ratio of the indicator test results of each indicator type between each adjacent test concurrency number can be calculated to enrich the analysis result information of the system performance test and provide effective data basis for further optimizing the system performance test.
[0106] Step S602, based on the indicator test results of each test case under different test concurrency numbers, the indicator test results of the same indicator type under different test concurrency numbers are counted, and indicator reflection graphs of different indicator types are drawn based on the statistical results. An indicator reflection graph of an indicator type is used to characterize that the indicator test results of an indicator type change with the change of the test concurrency number.
[0107] Among them, the indicator reflection graph refers to a graph used to reflect the changes in indicator test results as the number of concurrent tests changes. The type of graph is not limited; different indicator types can have corresponding indicator reflection graphs, which is conducive to enriching the analysis information of system performance testing and providing effective data basis for further optimizing system performance testing.
[0108] Step S604, generating a performance test analysis report for the test case combination based on the test results of the test case combination, the test results of each test case in the test case combination, the performance indicator increase ratio of the indicator test results of the same indicator type between adjacent test concurrency numbers, and the indicator reflection graphs of different indicator types.
[0109] Among them, the performance test analysis report refers to a report that integrates the performance-related data information of the test case combination during the performance testing process; the performance test analysis report can also be divided into multiple sub-performance analysis reports, that is, each test case can have a corresponding sub-performance analysis report, thereby improving the readability of the performance test analysis report; for the indicator test results, indicator increase ratios, indicator reflection charts and other data of different test cases in the test case combination, different tables can be created for differentiated storage. For the performance-related information of the test cases in the comprehensive test case combination, the information on the performance conditions corresponding to the test case combination can also be created for differentiated storage, thereby improving the readability of the performance test analysis report.
[0110] Exemplarily, in order to enrich the performance analysis information of the test case combination, improve the accuracy of the maximum concurrency judgment of the test case combination, and improve the effectiveness of the reference information of the test case combination for performance test analysis, the indicator increase ratio of the indicator test results of the same indicator type between adjacent test concurrencies under multiple different test concurrencies of the test cases in the test case combination can be calculated. For example, if the indicator test result is the request execution error rate, the request execution error rate increase ratio of the test case between each adjacent test concurrency can be calculated; if the indicator test result is the representative response time, the representative response time increase ratio of the test case between each adjacent test concurrency can be calculated; if the indicator test result is the CPU occupancy rate, the CPU occupancy increase ratio of the test case between each adjacent test concurrency can be calculated.
[0111] Furthermore, for different indicator types, an indicator reflection graph corresponding to each indicator type can be drawn, that is, based on the indicator test results of each indicator type under multiple different test concurrency numbers of the test case, an indicator reflection graph of each indicator type can be constructed respectively, and performance analysis can be performed based on the indicator reflection graph, which can be more intuitively shown as follows: Figure 3 As shown, Figure 3 (a) in the figure shows the request execution error rate reflection diagram showing the change of the request execution error rate with the change of the test concurrency number. Figure 3 (b) in the figure shows the representative response time reflection graph showing the change of the representative response time with the change of the number of concurrent tests. Figure 3 (c) in the figure shows the request processing speed reflection diagram which shows the change of request processing speed with the change of test concurrency number. Figure 3(d) in the figure shows the CPU utilization rate reflection diagram which shows the CPU utilization rate changes with the number of concurrent tests.
[0112] Furthermore, the test results of the test case combination, the test results of each test case in the test case combination, the indicator increase ratio of the indicator test results of the same indicator type between adjacent test concurrency numbers, and the indicator reflection graphs of different indicator types can be integrated to generate a performance test analysis report for the test case combination. The performance test analysis report integrates a variety of performance analysis data information, which is conducive to obtaining more effective information and further adjusting the concurrent test parameters of the test cases in the test case combination. Since the performance test analysis report has been divided into sub-performance analysis reports for each test case, the concurrent test parameters of specific test cases can be adjusted in a targeted manner, so that the adjusted concurrent test parameters can be applied to perform performance testing on the test case combination, thereby further improving the accuracy of performance testing of the test case combination.
[0113] In the above embodiment, by calculating the indicator increase ratio of the indicator test results of the same indicator type of each test case in the test case combination, the indicator reflection graph of different indicator types, and integrating the test results of the test case combination, the test results of each test case in the test case combination, the indicator increase ratio of the indicator test results of the same indicator type between adjacent test concurrency numbers and the indicator reflection graph of different indicator types, a performance test analysis report for the test case combination is generated, which is beneficial to improving the analysis efficiency of performance data during the performance testing process, enriching the performance analysis information, and providing more accurate reference information for further adjustment and optimization of concurrent test parameters of the test case, which is beneficial to further improve the accuracy of performance testing of the test case combination.
[0114] In one embodiment, the automated performance test is performed by using the Jenkins continuous integration tool as an example. The specific data interaction process can be as follows: Figure 4As shown, you can enter the Jenkins continuous integration tool through the terminal, create an automated performance test task in the performance test task creation interface, and enter the test case label and concurrent test parameters in the performance test task creation interface. The command started in the automated performance test task is "python main.py --threads_start =%threads_start% -- threads_end=%threads_end% --threads_per=%threads_per% --tag=%tag%", where threads_start refers to the starting concurrency number in the concurrent test parameters, threads_end refers to the ending concurrency number in the concurrent test parameters, threads_per refers to the interval concurrency number in the concurrent test parameters, and tag refers to the test case label; when the terminal starts the above command, you can generate performance test instructions (i.e. Figure 4 ), and sends the performance test instruction to the server, the server receives the performance test instruction, obtains the test case combination based on the test case label in the performance test instruction, and then for each test case in the test case combination, determines the test concurrency of the test case based on the concurrent test parameters in the performance test instruction, the concurrent test parameters include the starting concurrency, the interval concurrency and the termination concurrency, the starting concurrency and the interval concurrency can be used to determine a plurality of different test concurrencies, and the interval value between adjacent test concurrencies is equal to the interval concurrency, the termination concurrency is used to limit the maximum test concurrency of the test case in this performance test, the starting concurrency, the interval concurrency and the termination concurrency work together to determine a plurality of different test concurrencies corresponding to the test case, and then the test case is executed in a plurality of different test concurrencies, and the reference test results of the test case under a plurality of different test concurrencies are obtained, the parameter test results include the request execution error rate, the representative response time, the request processing speed and the request processing speed increase ratio, the CPU occupancy rate and other data (corresponding to Figure 4 to store and compute data).
[0115] Furthermore, based on the reference test results under multiple different test concurrency numbers, the test results of the test case are analyzed and obtained. Furthermore, based on the test results of the test case, the test results of the test case combination are determined. In addition, based on the indicator test results of the test case under multiple different test concurrency numbers, the indicator increase ratio of the indicator test results of the same indicator type between adjacent test concurrency numbers can be calculated, and indicator reflection graphs of different indicator types can be drawn. The test results of the test case combination, the test results of each test case, the indicator increase ratio of the indicator test results of the same indicator type between adjacent test concurrency numbers, and the indicator reflection graphs of different indicator types are integrated to generate a performance test analysis report for the test case combination.
[0116] In one embodiment, it is also possible to combine Figure 5 Jenkins is a continuous integration tool for automated performance testing. It can be used to build automated performance testing tasks, obtain input concurrent test parameters and test case labels through the terminal, start related commands for automated performance testing, generate corresponding performance test instructions, and send the performance test instructions to the server. The server obtains the test case combination based on the test case label in the performance test instruction, and determines the execution order of the test cases in the test case combination according to the execution priority of the test cases in the test case combination. The performance test instruction also includes concurrent test parameters, which include the concurrent test parameters of each test case in the test case combination. The concurrent test parameters of a test case include the starting concurrency number, the interval concurrency number, and the ending concurrency number. The starting concurrency number, the interval concurrency number, and the ending concurrency number can be used to determine the execution order of the test cases in the test case combination. A plurality of different test concurrency numbers corresponding to a given test case are respectively executed based on the plurality of different test concurrency numbers to obtain reference test results corresponding to the test case under the plurality of different test concurrency numbers, the reference test results including but not limited to data such as request execution error rate, representative response time, request processing speed and request processing speed increase ratio, CPU occupancy rate, etc., wherein the test case can be based on the number of requests, number of failed requests, request execution response time, data on change of central processing unit occupancy rate during execution, total execution time, etc. obtained by executing the test case under the plurality of different test concurrency numbers, and the request execution error rate, representative response time, request processing speed and request processing speed increase ratio, CPU occupancy rate, etc. corresponding to the test case under the plurality of different test concurrency numbers are analyzed and calculated, so the process of obtaining the reference test results includes the process of data storage and data analysis (i.e., corresponding Figure 5 In addition, the reference test results corresponding to different test cases under multiple different test cases can be stored in different tables, which is conducive to improving the readability of the data.
[0117] Further, the reference test results corresponding to the test cases under multiple different test concurrency numbers are analyzed to determine the test results of the test cases, and further based on the test results of each test case, the test results of the test case combination (i.e., the corresponding Figure 5 Bottleneck analysis in). Furthermore, based on the indicator test results corresponding to the test cases under multiple different test concurrency numbers, the indicator increase ratio of the indicator test results of the same indicator type between adjacent test concurrency numbers can be calculated, and indicator reflection graphs of different indicator types can be drawn. The test results of the test case combination, the test results of each test case, the indicator increase ratio of the indicator test results of the same indicator type between adjacent test concurrency numbers, and the indicator reflection graphs of different indicator types are integrated to generate a performance test analysis report for the test case combination, thereby realizing the automation of performance testing of the test case combination, and better improving the efficiency and accuracy of system performance testing during the execution of application scenarios corresponding to the flexibly set test case combination.
[0118] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0119] Based on the same inventive concept, the embodiment of the present application also provides a test device for implementing the test method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more test device embodiments provided below can refer to the limitations on the test method above, and will not be repeated here.
[0120] In an exemplary embodiment, Figure 6 As shown, a testing device is provided, including: an acquisition module 600, an execution module 602 and an analysis module 604, wherein:
[0121] An acquisition module 600 is used to acquire test case labels and concurrent test parameters for performance testing;
[0122] The acquisition module 600 is further used to acquire a test case combination based on the test case label;
[0123] An execution module 602 is used to determine the test concurrency of each test case in the test case combination according to the concurrent test parameter, and execute the test case under the test concurrency to obtain a test result of the test case;
[0124] The analysis module 604 is used to analyze the test result of each test case to obtain the test result of the test case combination.
[0125] In one embodiment, the concurrent test parameters include the concurrent test parameters of each test case in the test case combination, and the concurrent test parameters of a test case include the starting concurrency number, the ending concurrency number and the interval concurrency number; the execution module 602 is specifically used to:
[0126] The starting concurrency number is used as the current test concurrency number of the test case;
[0127] Execute the test case under the current test concurrency number and obtain the reference test result of the test case;
[0128] Calculate the fusion value between the current test concurrency number and the interval concurrency number, and update the current test concurrency number according to the fusion value;
[0129] If the updated current test concurrency number is less than the termination concurrency number, return to execute the test case under the current test concurrency number to obtain the reference test result of the test case;
[0130] If the updated current test concurrency number is equal to or greater than the corresponding termination concurrency number, the test result of the test case is determined based on the obtained reference test result.
[0131] In one embodiment, the reference test results include indicator test results under different test concurrency numbers; in determining the test results of the test case based on the obtained reference test results, the execution module 602 is further specifically used to:
[0132] For each indicator test result, based on the indicator standard value and the indicator test results under different test concurrency numbers, filter the maximum screening concurrency number;
[0133] The target filtering concurrency is determined based on the maximum filtering concurrency obtained by filtering, and the test result of the test case is generated according to the target filtering concurrency.
[0134] In one embodiment, in terms of screening the maximum screening concurrency based on the index standard value and the index test results under different test concurrency numbers, the execution module 602 is further specifically used to:
[0135] According to the indicator test results under different test concurrency numbers, filter the indicator test results that meet the indicator standard value;
[0136] If the screening is successful, the test concurrency number corresponding to the screened indicator test result is used as the candidate test concurrency number, and the maximum screening concurrency number is determined based on the candidate test concurrency number;
[0137] If the filtering fails, the preset filtering concurrency number will be used as the maximum filtering concurrency number.
[0138] In one embodiment, the execution module 602 is further specifically configured to:
[0139] The indicator test results are any one or more of the following: request execution error rate, representative response time, request processing speed increase ratio, and CPU occupancy rate;
[0140] In the case where the indicator test result includes a request execution error rate, the indicator test result that meets the indicator standard value includes a request execution error rate that is equal to or less than a preset request execution error rate;
[0141] In the case where the indicator test result includes a representative response time, the indicator test result that meets the indicator standard value includes a representative response time that is equal to or less than a preset response time;
[0142] In the case where the indicator test result includes a request processing speed increase ratio, the indicator test result that meets the indicator standard value includes a request processing speed increase ratio that is equal to or greater than a preset request processing speed increase ratio;
[0143] In the case where the indicator test result includes a CPU occupancy rate, the indicator test result that meets the indicator standard value includes a CPU occupancy rate that is equal to or less than a preset CPU occupancy rate.
[0144] In one embodiment, the test result of each test case includes a target screening concurrency number. In analyzing the test result of each test case to obtain the test result of the test case combination, the analysis module 604 is specifically used to:
[0145] The target filtered concurrency of each test case in the test case combination is compared with the concurrency filtering condition, and the target filtered concurrency that meets the concurrency filtering condition is used as the test result of the test case combination.
[0146] In one embodiment, the test result of each test case includes a target screening concurrency number and an indicator test result under different test concurrency numbers; the test device also includes a report generation module 606, which is used to:
[0147] Based on the indicator test results of each test case at different test concurrency numbers, calculate the indicator increase ratio of the indicator test results of the same indicator type between adjacent test concurrency numbers;
[0148] Based on the indicator test results of each test case at different test concurrency numbers, the indicator test results of the same indicator type at different test concurrency numbers are counted, and indicator reflection graphs of different indicator types are drawn based on the statistical results. An indicator reflection graph of an indicator type is used to represent the change of indicator test results of an indicator type with the change of test concurrency numbers;
[0149] A performance test analysis report for the test case combination is generated based on the test results of the test case combination, the test results of each test case in the test case combination, the performance indicator increase ratio of the indicator test results of the same indicator type between adjacent test concurrency numbers, and the indicator reflection graphs of different indicator types.
[0150] Each module in the above-mentioned test device can be implemented in whole or in part by software, hardware and a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each module above.
[0151] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Figure 7 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data such as performance indicator results and performance analysis results generated during the execution process. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a test method is implemented.
[0152] In an exemplary embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as shown in FIG. Figure 8As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be realized through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a test method is implemented. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.
[0153] Those skilled in the art will understand that Figure 7 or Figure 8 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0154] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.
[0155] In one embodiment, a computer-readable storage medium is provided, storing a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0156] In one embodiment, a computer program product is provided. The computer program product includes a computer program. When the computer program is executed by a processor, the steps in the above method embodiments are implemented.
[0157] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0158] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0159] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0160] The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A testing method, characterized in that: The method comprises: Get test case tags and concurrent test parameters for performance testing; Acquire a test case combination based on the test case label; For each test case in the test case combination, determine the test concurrency number of the test case according to the concurrent test parameter, and execute the test case under the test concurrency number to obtain the test result of the test case; The test result of each test case is analyzed to obtain the test result of the test case combination.
2. The method according to claim 1, characterized in that The concurrent test parameters include concurrent test parameters of each test case in the test case combination, and the concurrent test parameters of a test case include a starting concurrency number, an ending concurrency number, and an interval concurrency number; for each test case in the test case combination, determining the test concurrency number of the test case according to the concurrent test parameters, executing the test case under the test concurrency number, and obtaining the test result of the test case, including: Using the starting concurrent number as the current test concurrent number of the test case; Execute the test case under the current test concurrency number to obtain a reference test result of the test case; Calculate a fusion value between the current test concurrency number and the interval concurrency number, and update the current test concurrency number according to the fusion value; If the updated current test concurrency number is less than the termination concurrency number, returning to the step of executing the test case under the current test concurrency number to obtain a reference test result of the test case; If the updated current test concurrency number is equal to or greater than the corresponding termination concurrency number, the test result of the test case is determined based on the obtained reference test result.
3. The method according to claim 2, characterized in that The reference test results include index test results under different test concurrency numbers; The step of determining the test result of the test case based on the obtained reference test result includes: For each indicator test result, based on the indicator standard value and the indicator test results under different test concurrency numbers, filter the maximum screening concurrency number; The target screening concurrency is determined based on the maximum screening concurrency obtained by screening, and the test result of the test case is generated according to the target screening concurrency.
4. The method according to claim 3, characterized in that The maximum screening concurrency is screened based on the index standard value and the index test results under different test concurrency numbers, including: According to the indicator test results under different test concurrency numbers, filter the indicator test results that meet the indicator standard value; If the screening is successful, the test concurrency number corresponding to the screened indicator test result is used as the candidate test concurrency number, and the maximum screening concurrency number is determined based on the candidate test concurrency number; If the filtering fails, the preset filtering concurrency number will be used as the maximum filtering concurrency number.
5. The method according to claim 4, characterized in that The indicator test result is any one or more of the following: request execution error rate, representative response time, request processing speed increase ratio and central processing unit occupancy rate; In the case where the indicator test result includes a request execution error rate, the indicator test result that meets the indicator standard value includes a request execution error rate that is equal to or less than a preset request execution error rate; In the case where the index test result includes a representative response time, the index test result that meets the index standard value includes a representative response time that is equal to or less than a preset response time; In the case where the indicator test result includes a request processing speed increase ratio, the indicator test result that meets the indicator standard value includes a request processing speed increase ratio that is equal to or greater than a preset request processing speed increase ratio; In the case where the indicator test result includes a CPU occupancy rate, the indicator test result that meets the indicator standard value includes a CPU occupancy rate that is equal to or less than a preset CPU occupancy rate.
6. The method according to claim 1, characterized in that The test results for each test case include a target filter concurrency number; The analyzing the test result of each test case to obtain the test result of the test case combination includes: The target screening concurrency number of each test case in the test case combination is compared with the concurrency number screening condition, and the target screening concurrency number that meets the concurrency number screening condition is used as the test result of the test case combination.
7. The method according to claim 1, characterized in that The test result of each test case includes a target screening concurrency number and an indicator test result under different test concurrency numbers; the method further includes: Based on the indicator test results of each test case at different test concurrency numbers, calculate the indicator increase ratio of the indicator test results of the same indicator type between adjacent test concurrency numbers; Based on the indicator test results of each test case at different test concurrency numbers, the indicator test results of the same indicator type at different test concurrency numbers are counted, and indicator reflection graphs of different indicator types are drawn based on the statistical results. An indicator reflection graph of an indicator type is used to represent the change of indicator test results of an indicator type with the change of test concurrency numbers; A performance test analysis report for the test case combination is generated based on the test results of the test case combination, the test results of each test case in the test case combination, the performance indicator increase ratio of indicator test results of the same indicator type between adjacent test concurrency numbers, and indicator reflection graphs of different indicator types.
8. A testing device, characterized in that: The device comprises: An acquisition module, used to obtain test case labels and concurrent test parameters for performance testing; The acquisition module is further used to acquire a test case combination based on the test case label; An execution module, for determining, for each test case in the test case combination, a test concurrency number of the test case according to the concurrent test parameter, and executing the test case under the test concurrency number to obtain a test result of the test case; The analysis module is used to analyze the test result of each test case to obtain the test result of the test case combination.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
11. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Test method of retrieval enhancement generation system and electronic equipment
CN121349828A
