Performance test method, device, medium, equipment and program product of application program
Patent Information
- Application Number
- CN202510550117.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-28
- Publication Date
- 2026-10-30
AI Technical Summary
现阶段,通常由人工来完成应用程序的性能防劣化测试,不但费时费力,影响测试效率,且由于人力资源和发布时间限制,无法大规模扩展性能测试覆盖范围
[0019]在上述技术方案中,在获取到测试包、基线包以及待测试用例后,先基于待测试用例的执行逻辑,生成与测试包对应的第一插件、与基线包对应的第二插件;然后,分别运行测试包对应的第一应用程序和基线包对应的第二应用程序,得到第一性能数据和第二性能数据,其中,第一性能数据为第一应用程序基于第一插件执行待测试用例得到的性能数据,第二性能数据为第二应用程序基于第二插件执行待测试用例得到的性能数据;最后,基于第一性能数据和第二性能数据,生成测试包的测试结果。这样,通过调用测试包对应的第一插件和基线包对应的第二插件,即可对应用程序进行自动化性能防劣化测试,不但可以显著减少人力成本,还可提升应用程序的性能测试效率,并能够大规模扩展性能测试覆盖范围。另外,通过调用包含待测试用例的执行逻辑的插件即可实现性能防劣化测试,而无需重新设计应用程序,从而减少重新设计应用程序引入新问题的风险,保证应用程序的稳定性和可靠性。
Smart Images

Figure CN123011679A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and more specifically, to a method, apparatus, medium, device, and program product for testing the performance of an application. Background Technology
[0002] To improve application performance, regular version updates are typically required. To ensure performance, each version release must undergo performance degradation testing, particularly for Merge Requests (MRs). Currently, this testing is usually done manually, which is time-consuming, labor-intensive, and inefficient. Furthermore, limitations in human resources and release schedules prevent the large-scale scaling of performance testing coverage. Summary of the Invention
[0003] This summary section is provided to briefly introduce the concepts, which will be described in detail in the detailed description section below. This summary section is not intended to identify key or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.
[0004] In a first aspect, this disclosure provides a method for testing the performance of an application, the method comprising:
[0005] Obtain the test package, the baseline package, and the test cases to be tested, wherein the test package is an application package after code modifications to the baseline package;
[0006] Based on the execution logic of the test case, a first plugin corresponding to the test package and a second plugin corresponding to the baseline package are generated.
[0007] Run the first application corresponding to the test package and the second application corresponding to the baseline package respectively to obtain first performance data and second performance data. The first performance data is the performance data obtained by the first application executing the test case based on the first plugin, and the second performance data is the performance data obtained by the second application executing the test case based on the second plugin.
[0008] Based on the first performance data and the second performance data, the test results of the test package are generated.
[0009] Secondly, this disclosure provides an application performance testing apparatus, the apparatus comprising:
[0010] The acquisition module is used to acquire the test package, the baseline package, and the test cases to be tested, wherein the test package is an application package after code modification of the baseline package;
[0011] The plugin generation module is used to generate a first plugin corresponding to the test package and a second plugin corresponding to the baseline package based on the execution logic of the test case to be tested.
[0012] The testing module is used to run the first application corresponding to the test package and the second application corresponding to the baseline package respectively to obtain first performance data and second performance data. The first performance data is the performance data obtained by the first application executing the test case based on the first plugin, and the second performance data is the performance data obtained by the second application executing the test case based on the second plugin.
[0013] The test result generation module is used to generate test results for the test package based on the first performance data and the second performance data.
[0014] Thirdly, this disclosure provides a computer-readable medium having a computer program stored thereon, which, when executed by a processing device, implements the steps of the performance testing method for the application provided in the first aspect of this disclosure.
[0015] Fourthly, this disclosure provides an electronic device, comprising:
[0016] A storage device on which computer programs are stored;
[0017] A processing device for executing the computer program in the storage device to implement the steps of the performance testing method for the application provided in the first aspect of this disclosure.
[0018] Fifthly, this disclosure provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the performance testing method for the application provided in the first aspect of this disclosure.
[0019] In the above technical solution, after obtaining the test package, baseline package, and test cases, a first plugin corresponding to the test package and a second plugin corresponding to the baseline package are generated based on the execution logic of the test cases. Then, the first application corresponding to the test package and the second application corresponding to the baseline package are run respectively to obtain first performance data and second performance data. The first performance data is the performance data obtained by the first application executing the test cases based on the first plugin, and the second performance data is the performance data obtained by the second application executing the test cases based on the second plugin. Finally, the test results of the test package are generated based on the first and second performance data. In this way, by calling the first plugin corresponding to the test package and the second plugin corresponding to the baseline package, automated performance degradation prevention testing of the application can be performed. This not only significantly reduces labor costs but also improves the efficiency of application performance testing and allows for large-scale expansion of performance testing coverage. In addition, performance degradation prevention testing can be achieved by calling the plugin containing the execution logic of the test cases without redesigning the application, thereby reducing the risk of introducing new problems through application redesign and ensuring the stability and reliability of the application.
[0020] Other features and advantages of this disclosure will be described in detail in the following detailed description section. Attached Figure Description
[0021] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale. In the drawings:
[0022] Figure 1 This is a schematic diagram illustrating a performance degradation prevention testing framework according to an exemplary embodiment.
[0023] Figure 2 This is a flowchart illustrating a performance testing method for an application according to an exemplary embodiment.
[0024] Figure 3 This is a schematic diagram illustrating a performance testing process for an application according to an exemplary embodiment.
[0025] Figure 4 This is a block diagram illustrating an application performance testing apparatus according to an exemplary embodiment.
[0026] Figure 5 This is a schematic diagram of the structure of an electronic device according to an exemplary embodiment. Detailed Implementation
[0027] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.
[0028] It should be understood that the steps described in the method embodiments of this disclosure may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of this disclosure is not limited in this respect.
[0029] The term "comprising" and its variations as used herein are open-ended inclusions, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the description below.
[0030] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are used only to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.
[0031] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0032] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
[0033] It is understood that before using the technical solutions disclosed in the various embodiments of this disclosure, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this disclosure in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained.
[0034] For example, upon receiving a user's active request, a prompt message is sent to the user to explicitly inform them that the requested operation will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the software or hardware, such as the electronic device, application, server, or storage medium performing the operations of this disclosed technical solution, based on the prompt message.
[0035] As an optional but non-limiting implementation, in response to a user's active request, sending a prompt message to the user can be done via a pop-up window, where the prompt message can be presented in text format. Furthermore, the pop-up window can also include a selection control allowing the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0036] It is understood that the above notification and user authorization process are merely illustrative and do not constitute a limitation on the implementation of this disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of this disclosure.
[0037] Meanwhile, it is understood that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and related provisions.
[0038] To improve application performance, regular version updates are typically required. To ensure performance, each version release must undergo performance degradation testing, particularly for Merge Requests (MRs). Currently, this testing is usually done manually, which is time-consuming, labor-intensive, and inefficient. Furthermore, limitations in human resources and release schedules prevent the large-scale scaling of performance testing coverage.
[0039] Based on the principle of early detection and early repair, this disclosure can perform automated performance degradation prevention testing during the MR stage, or it can also perform automated performance degradation prevention testing before the release of a new version of the application. Simply put, it uses two test packages before and after the code modification, and uses the same test cases to perform performance testing to determine whether there is any degradation in the core performance indicators of the modified code (e.g., interaction time, frame rate, memory usage, etc.) (e.g., longer interaction time, lower frame rate, etc.).
[0040] The process of implementing automated performance degradation prevention testing can be as follows: First, trigger performance degradation prevention testing during the MR pipeline stage or before the release of a new version of the application; then obtain the corresponding test package and comparison package (i.e., baseline package); finally, run the test package and baseline package separately on the same device to compare and analyze the performance data generated by the test package and baseline package to determine whether performance degradation exists.
[0041] Both the test package and the baseline package are application packages. The baseline package can be understood as the application package before code modifications; the test package can be understood as the data package after modifications to the baseline package—that is, the test package is the application package after code modifications to the baseline package. Code modifications can be understood as changes made to the code corresponding to certain functions in the baseline package to optimize certain functions of the application.
[0042] For example, the baseline package is version V1.0 of application A, and the test package is version V1.1 of application A, wherein version V1.1 of application A is obtained by modifying the code of version V1.0 of application A.
[0043] The MR (Mapping) phase merges code modified based on business requirements into the main branch. The MR pineline refers to the process of committing code and merging it into the main branch, triggering a pipeline of analyses, including code style checks, security checks, and performance checks, which may include performance degradation prevention testing.
[0044] In the MR phase, the baseline package can be obtained from the trunk branch, and the test package (called the MR package) can be obtained from the branch code that will be merged into the trunk. This branch code is a branch pulled from the trunk and written based on business requirements.
[0045] Figure 1 This is a schematic diagram illustrating a performance degradation prevention testing framework according to an exemplary embodiment. Figure 1 As shown, the performance degradation prevention testing framework can include performance degradation prevention scripts, degradation prevention case configuration files, the main application, and performance degradation prevention plugins. Here, "case" refers to test cases.
[0046] like Figure 1 As shown, the performance degradation prevention script can include functional modules such as plugin integration, case configuration, and dual-package comparison. The plugin integration module is used to merge (i.e., integrate) the test package or baseline package with other packages; the case configuration module is used to configure the test cases, for example, configuring the test case list; and the dual-package comparison module is used to collect and compare the performance data generated by the test package and the baseline package.
[0047] like Figure 1 As shown, the performance degradation prevention plugin can include the execution logic of the test cases and the application programming interface (API) for automated testing. The execution logic of the test cases can include the execution logic of each individual test case, for example... Figure 1The execution logic of test case 0 and test case 1 are shown in the diagram. The automated testing API can include a test window and a testutils library.
[0048] The execution logic of a test case refers to the steps, rules, and sequence followed during its execution. It defines how to specifically operate the application to verify whether it meets expected functions and requirements. The execution logic of a test case mainly includes the input conditions, operation steps, and expected results. The test window encapsulates automated testing interfaces for windows; test utils is a toolset for simplifying and optimizing the testing process, mainly including pre-encapsulated operation logic, such as inputting information in input boxes and dragging, which can be directly called later.
[0049] The anti-degradation case configuration file can be used to store the configuration information of the test cases. It also allows for the management of performance degradation prevention plugins. The main application is the application to be tested for performance degradation prevention.
[0050] Figure 2 This is a flowchart illustrating a performance testing method for an application according to an exemplary embodiment. Figure 2 As shown, the performance testing method for this application may include the following S101 to S104.
[0051] In S101, obtain the test package, baseline package, and test cases.
[0052] In this disclosure, multiple test cases can be pre-written by Quality Assurance (QA) personnel. The test cases to be tested can be all or some of the pre-written test cases. There may be one or more test cases.
[0053] For example, during the MapReduce (MR) phase, to improve testing efficiency, performance degradation prevention testing can be performed on a subset of test cases; that is, the test cases to be tested are a portion of the pre-written test cases. Before releasing a new version of the application, to improve performance testing coverage, all test cases can be selected for performance degradation prevention testing; that is, the test cases to be tested are all the pre-written test cases.
[0054] In S102, based on the execution logic of the test case, a first plugin corresponding to the test package and a second plugin corresponding to the baseline package are generated.
[0055] In this disclosure, both the first plugin and the second plugin contain the execution logic for the test cases.
[0056] In S103, the first application corresponding to the test package and the second application corresponding to the baseline package are run respectively to obtain first performance data and second performance data. The first performance data is the performance data obtained by the first application executing the test case based on the first plugin, and the second performance data is the performance data obtained by the second application executing the test case based on the second plugin.
[0057] In this disclosure, the first application can be understood as the application corresponding to the test package, which can be considered as the application optimized through code modifications. The second application can be understood as the application corresponding to the baseline package, which can be considered as the application before optimization. The first application and the second application can be considered as the same application, except that the first application is the application obtained by optimizing the second application.
[0058] The execution logic of the test cases is encapsulated in the plugin and is run by calling the API provided by the application.
[0059] In addition, performance data can be understood as some performance indicators obtained after executing the test cases under test, such as interaction time, frame rate, memory usage, etc.
[0060] In S104, test results for the test package are generated based on the first performance data and the second performance data.
[0061] In this disclosure, the test results can be comparative results obtained by comparing the differences between the first performance data and the second performance data, such as the results obtained after analyzing the first performance data based on the second performance data.
[0062] Among them, it can be called Figure 1 The performance degradation prevention script performs a dual-package comparison, specifically comparing the first and second performance data to determine the test results based on the differences in the performance data. If the comparison results show that some (or some) performance indicators of the first performance data are worse than the corresponding performance indicators of the second performance data, it indicates that the first application after code modification has experienced performance degradation compared to the second application before code modification. Conversely, if the comparison results show that some (or some) performance indicators of the first performance data are better than the corresponding performance indicators of the second performance data, it indicates that the first application after code modification has achieved corresponding performance optimization compared to the second application before code modification.
[0063] Through pre-verification, the above methods can ensure that the impact of plugin operation on performance data is negligible, and that automated test results can be aligned with manual test results, thereby guaranteeing the stability and confidence of performance data.
[0064] In the above technical solution, after obtaining the test package, baseline package, and test cases, a first plugin corresponding to the test package and a second plugin corresponding to the baseline package are generated based on the execution logic of the test cases. Then, the first application corresponding to the test package and the second application corresponding to the baseline package are run respectively to obtain first performance data and second performance data. The first performance data is the performance data obtained by the first application executing the test cases based on the first plugin, and the second performance data is the performance data obtained by the second application executing the test cases based on the second plugin. Finally, the test results of the test package are generated based on the first and second performance data. In this way, by calling the first plugin corresponding to the test package and the second plugin corresponding to the baseline package, automated performance degradation prevention testing of the application can be performed. This not only significantly reduces labor costs but also improves the efficiency of application performance testing and allows for large-scale expansion of performance testing coverage. In addition, performance degradation prevention testing can be achieved by calling the plugin containing the execution logic of the test cases without redesigning the application, thereby reducing the risk of introducing new problems through application redesign and ensuring the stability and reliability of the application.
[0065] The following section provides a detailed explanation of the specific implementation methods for generating the first plugin corresponding to the test package and the second plugin corresponding to the baseline package based on the execution logic of the test case in S102 above.
[0066] Specifically, plugin code can be generated first based on the execution logic of the test cases; then, the plugin code is compiled using the Software Development Kit (SDK) corresponding to the test package to obtain the first plugin package, and the plugin code is compiled using the SDK corresponding to the baseline package to obtain the second plugin package; finally, as... Figure 3 As shown, the test package (e.g., Figure 3 The MR package in the first plugin package is merged with the first plugin package to obtain the first plugin, and the baseline package is merged with the second plugin package to obtain the second plugin. Figure 1 The performance degradation prevention plugin shown includes a first plugin and a second plugin.
[0067] In this disclosure, it is possible to call Figure 1 The performance degradation prevention script shown (specifically, the plugin integration module in the script) generates a first plugin corresponding to the test package and a second plugin corresponding to the baseline package.
[0068] In this implementation, a first plugin package and a second plugin package are generated based on the execution logic of the test cases. The test package is merged with the first plugin package, and the baseline package is merged with the second plugin package. This allows the plugin to run normally in the main application environment without breaking the functionality of the main application, thus ensuring the compatibility between the plugin and the main application.
[0069] The following is a detailed description of the specific implementation method for obtaining the first performance data and the second performance data by running the first application corresponding to the test package and the second application corresponding to the baseline package respectively in S103.
[0070] In one implementation, there are multiple test cases to be tested. In this case, S103 may include the following steps (a1) to (a7).
[0071] Step (a1): Determine the test case to be tested in the current round from multiple test cases and use it as the current test case.
[0072] In this disclosure, when there are multiple test cases, each test case can be tested sequentially.
[0073] Among these features, test cases can be pre-configured by calling the case configuration module in the performance degradation prevention script, such as... Figure 3 As shown, you can configure a list of test cases, and the test cases in the list can be used as test cases in order from front to back.
[0074] Step (a2): Write the configuration information of the current test case into the configuration file.
[0075] This configuration file is... Figure 1 The example shown is a configuration file for preventing degradation. The test case configuration information can include various aspects such as test data, test execution, and test environment.
[0076] like Figure 3 As shown, when test cases exist in the form of a list, if the test of a test case is completed, the next adjacent test case after the most recently completed test case in the list can be taken as the current test case, and the configuration information of the current test case can be written to the configuration file. That is, the configuration information of the next case can be read and written to the configuration file.
[0077] Step (a3): Launch the third application and load the third plugin into the third application.
[0078] Step (a4): Based on the configuration information of the current test case in the configuration file, the third application calls the third plugin to execute the current test case and obtain the first performance sub-data;
[0079] Step (a5): Launch the fourth application and load the fourth plugin into the fourth application;
[0080] Step (a6): Based on the configuration information of the current test case in the configuration file, the fourth application calls the fourth plugin to execute the current test case and obtain the second performance sub-data.
[0081] In this disclosure, the third application is one of the first application and the second application, and the fourth application is the other of the first application and the second application.
[0082] In one implementation, the third application is the first application, and the fourth application is the second application. In this implementation, the test package is tested first, followed by the baseline package. When the third application is the first application, the third plugin is the first plugin, the fourth plugin is the second plugin, the first performance data includes each first performance sub-data, and the second performance data includes each second performance sub-data.
[0083] For example, such as Figure 3 As shown, the third application is the first application, and the fourth application is the second application. At this point, the first application corresponding to the test package can be started first. Then, the first plugin can be loaded into the first application, and the configuration information of the current case in the configuration file can be read. Based on this configuration information, the first plugin can be called through the first application to execute the current case, thereby obtaining the first performance sub-data. At this point, it can be obtained by calling... Figure 1 The performance degradation prevention script uses a dual-package comparison module to collect the first performance sub-data. After completing the test package test for the current case, the baseline package test for the current case can be performed. Specifically, the second application corresponding to the baseline package can be started first. Then, the second plugin is loaded into the second application, and the configuration information of the current case in the configuration file is read. Based on this configuration information, the second application calls the second plugin to execute the current case, thereby obtaining the second performance sub-data. At this point, it can be obtained by calling... Figure 1 The dual-packet comparison module in the performance degradation prevention script is used to collect the second performance sub-data.
[0084] In another implementation, the third application is the second application, and the fourth application is the first application. In this implementation, the baseline package is tested first, followed by the test package. When the third application is the second application, the third plugin is the second plugin, the fourth plugin is the first plugin, the first performance data includes each second performance sub-data, and the second performance data includes each first performance sub-data.
[0085] Step (a7): Determine whether all test cases have been tested.
[0086] After completing the current test case, it can be determined whether all test cases have been tested successfully. For example, Figure 3 As shown, determine whether the case list has finished running; if there are test cases that have not been tested, return to step (a1) above; if all test cases have been tested, it means that the test is completed. At this time, the result data can be compared, that is, execute S104 above.
[0087] In one possible implementation, performance data can be collected through event tracking to accurately record performance data. Specifically, the performance testing method for the aforementioned application may further include the following steps:
[0088] Perform event tracking on the first application and the second application respectively;
[0089] At this point, step (a4) above may include:
[0090] Based on the configuration information of the current test case in the configuration file, the third application calls the third plugin to execute the current test case, and the first script is scheduled to collect the instrumentation data of the third application as the first performance sub-data.
[0091] The above step (a4) may include:
[0092] Based on the configuration information of the current test case in the configuration file, the fourth application calls the fourth plugin to execute the current test case, and the first script is scheduled to collect the instrumentation data of the fourth application as the second performance sub-data.
[0093] The first script is Figure 1 The performance degradation prevention script in the system. That is, the structure is collected by calling the performance degradation prevention script.
[0094] When there is only one test case, the above S103 may include the following steps (b1) to (b5).
[0095] Step (b1): Write the configuration information of the test case to be tested into the configuration file.
[0096] Step (b2): Launch the third application and load the third plugin into the third application.
[0097] Step (b3): Based on the configuration information of the test cases in the configuration file, the third application calls the third plugin to execute the test cases and obtain the fifth performance sub-data.
[0098] Step (b4): Launch the fourth application and load the fourth plugin into the fourth application.
[0099] Step (b5): Based on the configuration information of the test cases in the configuration file, the fourth application calls the fourth plugin to execute the test cases and obtain the sixth performance sub-data.
[0100] In one implementation, the third application is the first application, and the fourth application is the second application. In this implementation, the test package is tested first, followed by the baseline package. Specifically, when the third application is the first application, the third plugin is the first plugin, the fourth plugin is the second plugin, the fifth performance sub-data is the first performance data, and the sixth performance sub-data is the second performance data.
[0101] In another implementation, the third application is the second application, and the fourth application is the first application. In this implementation, the baseline package is tested first, followed by the test package. Specifically, when the third application is the second application, the third plugin is the second plugin, the fourth plugin is the first plugin, the fifth performance sub-data is the second performance data, and the sixth performance sub-data is the first performance data.
[0102] The following is a detailed description of the specific implementation method for generating test results of the test package based on the first performance data and the second performance data in S104 above.
[0103] Specifically, the first performance data includes the third performance sub-data corresponding to each test case, and the second performance data includes the fourth performance sub-data corresponding to each test case. When the third application is the first application, the third performance sub-data can be the first performance sub-data, and the fourth performance sub-data can be the second performance sub-data. When the third application is the second application, the third performance sub-data can be the second performance sub-data, and the fourth performance sub-data can be the first performance sub-data. In this case, S104 may include the following steps (c1) to (c3).
[0104] Step (c1): For each test case, calculate the difference between the third performance sub-data corresponding to the test case and the fourth performance sub-data corresponding to the test case.
[0105] Step (c2): Based on the difference between the third performance sub-data corresponding to the test case and the fourth performance sub-data corresponding to the test case, evaluate whether the test package has experienced performance degradation on the test case.
[0106] Step (c3): Generate the test results of the test package based on the performance degradation evaluation results of the test package on all test cases.
[0107] In the above implementation, the performance degradation of the test package on the test case can be evaluated by querying the performance sub-data of the same test case on the test package and the baseline package. Thus, the test results of the test package can be generated based on the performance degradation evaluation results of each test package on all test cases.
[0108] The following is a detailed explanation of the specific implementation method for evaluating whether the test package has experienced performance degradation on the test case based on the difference between the third performance sub-data corresponding to the test case and the fourth performance sub-data corresponding to the test case in step (c2) above.
[0109] Specifically, this can be achieved through various implementation methods. In one implementation method, if the comparison result between the difference and the preset performance threshold meets the second preset condition, it is determined that the test package has experienced performance degradation on the test case; if the comparison result between the difference and the preset performance threshold does not meet the second preset condition, it is determined that the test package has not experienced performance degradation on the test case.
[0110] The second preset condition varies depending on the performance metric. Specifically, a larger performance metric indicates better application performance, such as frame rate. In this case, the second preset condition can be a difference less than zero and an absolute value greater than a preset performance threshold. Conversely, a smaller performance metric indicates better application performance, such as interaction time or memory usage. In this case, the second preset condition can be a difference greater than zero and a difference greater than a preset performance threshold.
[0111] Among them, the preset performance threshold is greater than zero.
[0112] In another implementation, to improve the accuracy of performance degradation assessment, performance degradation can be assessed based on the percentage degradation of the test package on the test cases. Specifically, step (c2) above may include steps (c21) and (c22).
[0113] Step (c21): Determine the percentage of degradation of the test package on the test case based on the difference and the fourth performance sub-data corresponding to the test case.
[0114] In this disclosure, the ratio of the difference to the fourth performance sub-data corresponding to the test case can be determined as the percentage of degradation of the test package on the test case.
[0115] Step (c22): Determine whether the test package has experienced performance degradation on the test cases, at least based on the percentage of degradation.
[0116] In one implementation, if the comparison result between the degradation percentage and the preset percentage threshold meets the first preset condition, it is determined that the test package has experienced performance degradation on the test case; if the comparison result between the degradation percentage and the preset percentage threshold does not meet the first preset condition, it is determined that the test package has not experienced performance degradation on the test case.
[0117] The first preset condition varies depending on the performance metric. Specifically, a higher performance metric indicates better application performance (e.g., frame rate). In this case, the first preset condition can be a degradation percentage less than zero and an absolute value of the degradation percentage greater than a preset percentage threshold. Conversely, a lower performance metric indicates better application performance (e.g., interaction time, memory usage). In this case, the first preset condition can be a degradation percentage greater than a preset percentage threshold, where the preset percentage threshold is greater than zero.
[0118] In another implementation, to maximize the accuracy of performance degradation assessment, both the difference and the degradation percentage can be combined for performance degradation assessment. Specifically, it can be first determined whether the comparison result of the degradation percentage and the preset percentage threshold meets a first preset condition. If the comparison result meets the first preset condition, it is determined that the test package has experienced performance degradation on the test case. If the comparison result does not meet the first preset condition, it is determined whether the comparison result of the difference and the preset performance threshold meets a second preset condition. If the comparison result meets the second preset condition, it is determined that the test package has experienced performance degradation on the test case. If the comparison result does not meet the second preset condition, it is determined that the test package has not experienced performance degradation on the test case. Therefore, as long as either the difference or the degradation percentage meets the corresponding condition, it can be determined that the test package has experienced performance degradation on the test case.
[0119] The following provides a detailed description of the specific implementation method for generating the test results of the test package based on the performance degradation evaluation results of the test package on all test cases in step (c3) above. Specifically, step (c3) above may include the following steps (c31) and (c32).
[0120] Step (c31): For each test case, at least one of the third and fourth performance sub-data corresponding to the test case, the difference between the third and fourth performance sub-data corresponding to the test case, and the performance degradation evaluation result of the test package on the test case are determined as the test sub-result of the test case.
[0121] Step (c32): Determine all test sub-results as the test results of the test package.
[0122] In this embodiment, the test results of the test package include not only the performance degradation evaluation results of the test package on each test case, but also at least one of the third performance sub-data and the fourth performance sub-data corresponding to the heat exchange test case, and the difference between the third performance sub-data and the fourth performance sub-data corresponding to each test case. This makes it easier for users to understand the specific performance index information of the test package.
[0123] Figure 4 This is a block diagram illustrating a performance testing apparatus for an application according to an exemplary embodiment. Figure 4 As shown, the application performance testing device 300 includes:
[0124] The acquisition module 301 is used to acquire the test package, the baseline package, and the test cases to be tested, wherein the test package is an application package after code modification of the baseline package;
[0125] The plugin generation module 302 is used to generate a first plugin corresponding to the test package and a second plugin corresponding to the baseline package based on the execution logic of the test case to be tested.
[0126] Test module 303 is used to run the first application corresponding to the test package and the second application corresponding to the baseline package respectively to obtain first performance data and second performance data, wherein the first performance data is the performance data obtained by the first application based on the first plugin executing the test case, and the second performance data is the performance data obtained by the second application based on the second plugin executing the test case;
[0127] The test result generation module 304 is used to generate test results for the test package based on the first performance data and the second performance data.
[0128] In the above technical solution, after obtaining the test package, baseline package, and test cases, a first plugin corresponding to the test package and a second plugin corresponding to the baseline package are generated based on the execution logic of the test cases. Then, the first application corresponding to the test package and the second application corresponding to the baseline package are run respectively to obtain first performance data and second performance data. The first performance data is the performance data obtained by the first application executing the test cases based on the first plugin, and the second performance data is the performance data obtained by the second application executing the test cases based on the second plugin. Finally, the test results of the test package are generated based on the first and second performance data. In this way, by calling the first plugin corresponding to the test package and the second plugin corresponding to the baseline package, automated performance degradation prevention testing of the application can be performed. This not only significantly reduces labor costs but also improves the efficiency of application performance testing and allows for large-scale expansion of performance testing coverage. In addition, performance degradation prevention testing can be achieved by calling the plugin containing the execution logic of the test cases without redesigning the application, thereby reducing the risk of introducing new problems through application redesign and ensuring the stability and reliability of the application.
[0129] Optionally, the plug-in generation module 302 includes:
[0130] The first generation submodule is used to generate plugin code based on the execution logic of the test case to be tested;
[0131] The compilation submodule is used to compile the plugin code using the software development kit corresponding to the test package to obtain a first plugin package, and to compile the plugin code using the software development kit corresponding to the baseline package to obtain a second plugin package;
[0132] The merging submodule is used to merge the test package with the first plugin package to obtain the first plugin, and to merge the baseline package with the second plugin package to obtain the second plugin.
[0133] Optionally, there may be multiple test cases;
[0134] The test module 303 includes:
[0135] The first determining submodule is used to determine the test case to be tested in the current round from the multiple test cases to be tested, and use it as the current test case;
[0136] The write submodule is used to write the configuration information of the current test case into the configuration file;
[0137] The first plugin loading submodule is used to launch the third application and load the third plugin into the third application;
[0138] The first calling submodule is used to call the third plugin through the third application according to the configuration information of the current test case in the configuration file, so as to execute the current test case and obtain the first performance sub-data;
[0139] The second plugin loading submodule is used to launch the fourth application and load the fourth plugin into the fourth application;
[0140] The second calling submodule is used to call the fourth plugin through the fourth application according to the configuration information of the current test case in the configuration file, so as to execute the current test case and obtain the second performance sub-data;
[0141] The triggering submodule is used to trigger the first determining submodule to determine the test case to be tested in the current round from the multiple test cases to be tested, and use it as the current test case until all the test cases to be tested have been tested;
[0142] The third application is one of the first application and the second application, and the fourth application is the other of the first application and the second application;
[0143] When the third application is the first application, the third plugin is the first plugin, the fourth plugin is the second plugin, the first performance data includes each first performance sub-data, and the second performance data includes each second performance sub-data.
[0144] When the third application is the second application, the third plugin is the second plugin, the fourth plugin is the first plugin, the first performance data includes each of the second performance sub-data, and the second performance data includes each of the first performance sub-data.
[0145] Optionally, the application performance testing device 300 further includes:
[0146] The event tracking module is used to perform event tracking on the first application and the second application respectively.
[0147] The first calling submodule is used to call the third plugin through the third application to execute the current test case according to the configuration information of the current test case in the configuration file, and to collect the instrumentation data of the third application through the scheduling first script as the first performance sub-data;
[0148] The second calling submodule is used to call the fourth plugin through the fourth application to execute the current test case according to the configuration information of the current test case in the configuration file, and to collect the instrumentation data of the fourth application by scheduling the first script as the second performance sub-data.
[0149] Optionally, the test cases to be tested can be one or more, the first performance data includes the third performance sub-data corresponding to each of the test cases to be tested, and the second performance data includes the fourth performance sub-data corresponding to each of the test cases to be tested;
[0150] The test result generation module 304 includes:
[0151] The calculation submodule is used to calculate the difference between the third performance sub-data corresponding to the test case and the fourth performance sub-data corresponding to the test case for each test case; the evaluation submodule is used to evaluate whether the test package has experienced performance degradation on the test case based on the difference.
[0152] The second generation submodule is used to generate the test results of the test package based on the performance degradation evaluation results of the test package on all the test cases.
[0153] Optionally, the evaluation submodule includes:
[0154] The second determining submodule is used to determine the percentage of degradation of the test package on the test case based on the difference and the fourth performance sub-data corresponding to the test case;
[0155] The third determining submodule is used to determine, at least based on the degradation percentage, whether the test package has experienced performance degradation on the test case.
[0156] Optionally, the third determining submodule includes:
[0157] The fourth determination submodule is used to determine that the test package has experienced performance degradation on the test case if the comparison result between the degradation percentage and the preset percentage threshold meets the first preset condition.
[0158] Optionally, the third determining submodule further includes:
[0159] The fifth determining submodule is used to determine whether the comparison result of the difference and the preset performance threshold satisfies the second preset condition if the comparison result of the degradation percentage and the preset percentage threshold does not satisfy the first preset condition.
[0160] The sixth determining submodule is used to determine that the test package has experienced performance degradation on the test case if the comparison result between the difference and the preset performance threshold satisfies the second preset condition.
[0161] This disclosure also provides a computer-readable medium having a computer program stored thereon, which, when executed by a processing device, implements the steps of the performance testing method for the application provided in this disclosure.
[0162] This disclosure also provides an electronic device, including:
[0163] A storage device on which computer programs are stored;
[0164] A processing device is configured to execute the computer program in the storage device to implement the steps of the performance testing method for the application provided in this disclosure.
[0165] This disclosure also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the performance testing method for the application described above provided in this disclosure.
[0166] The following is for reference. Figure 5 The diagram illustrates a structural schematic of an electronic device (e.g., a terminal device or a server) 600 suitable for implementing embodiments of the present disclosure. The terminal device in the embodiments of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 5 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.
[0167] like Figure 5 As shown, electronic device 600 may include a processing device (e.g., a central processing unit, a graphics processor, etc.) 601, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 602 or a program loaded from storage device 608 into random access memory (RAM) 603. RAM 603 also stores various programs and data required for the operation of electronic device 600. Processing device 601, ROM 602, and RAM 603 are interconnected via bus 604. Input / output (I / O) interface 605 is also connected to bus 604.
[0168] Typically, the following devices can be connected to I / O interface 605: input devices 606 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 607 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 608 including, for example, magnetic tapes, hard disks, etc.; and communication devices 609. Communication device 609 allows electronic device 600 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 5 An electronic device 600 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.
[0169] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 609, or installed from a storage device 608, or installed from a ROM 602. When the computer program is executed by the processing device 601, it performs the functions defined in the methods of embodiments of this disclosure.
[0170] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.
[0171] In some implementations, clients and servers can communicate using any currently known or future-developed network protocol such as HTTP (Hypertext Transfer Protocol) and can interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet of Things), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future-developed networks.
[0172] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.
[0173] The aforementioned computer-readable medium carries one or more programs. When the electronic device executes the aforementioned one or more programs, the electronic device causes the following: it acquires a test package, a baseline package, and test cases, wherein the test package is an application package modified from the baseline package; based on the execution logic of the test cases, it generates a first plugin corresponding to the test package and a second plugin corresponding to the baseline package; it runs the first application corresponding to the test package and the second application corresponding to the baseline package, respectively, to obtain first performance data and second performance data, wherein the first performance data is the performance data obtained by the first application executing the test cases based on the first plugin, and the second performance data is the performance data obtained by the second application executing the test cases based on the second plugin; and it generates the test results of the test package based on the first performance data and the second performance data.
[0174] Computer program code for performing the operations of this disclosure can be written in one or more programming languages or a combination thereof, including but not limited to object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0175] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0176] The modules described in the embodiments of this disclosure can be implemented in software or hardware. The name of a module does not necessarily limit the module itself; for example, an acquisition module can also be described as "a module for acquiring test packages, baseline packages, and test cases."
[0177] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.
[0178] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0179] According to one or more embodiments of this disclosure, Example 1 provides a method for testing the performance of an application, the method comprising:
[0180] Obtain the test package, the baseline package, and the test cases to be tested, wherein the test package is an application package after code modifications to the baseline package;
[0181] Based on the execution logic of the test case, a first plugin corresponding to the test package and a second plugin corresponding to the baseline package are generated.
[0182] Run the first application corresponding to the test package and the second application corresponding to the baseline package respectively to obtain first performance data and second performance data. The first performance data is the performance data obtained by the first application executing the test case based on the first plugin, and the second performance data is the performance data obtained by the second application executing the test case based on the second plugin.
[0183] Based on the first performance data and the second performance data, the test results of the test package are generated.
[0184] According to one or more embodiments of this disclosure, Example 2 provides the method of Example 1, wherein generating a first plugin corresponding to the test package and a second plugin corresponding to the baseline package based on the execution logic of the test case to be tested includes:
[0185] Based on the execution logic of the test case, generate plugin code;
[0186] The plugin code is compiled using the software development kit corresponding to the test package to obtain a first plugin package, and the plugin code is compiled using the software development kit corresponding to the baseline package to obtain a second plugin package;
[0187] The test package is merged with the first plugin package to obtain the first plugin, and the baseline package is merged with the second plugin package to obtain the second plugin.
[0188] According to one or more embodiments of this disclosure, Example 3 provides the method of Example 1, wherein the test cases to be tested are multiple;
[0189] The step of running the first application corresponding to the test package and the second application corresponding to the baseline package respectively to obtain first performance data and second performance data includes:
[0190] The test case to be tested in the current round is determined from the multiple test cases to be tested, and is used as the current test case;
[0191] Write the configuration information of the current test case into the configuration file;
[0192] Launch the third application and load the third plugin into the third application;
[0193] Based on the configuration information of the current test case in the configuration file, the third application calls the third plugin to execute the current test case and obtain the first performance sub-data;
[0194] Launch the fourth application and load the fourth plugin into the fourth application;
[0195] Based on the configuration information of the current test case in the configuration file, the fourth application calls the fourth plugin to execute the current test case and obtain the second performance sub-data;
[0196] The process of determining the test case to be tested in the current round from the multiple test cases to be tested, as the current test case, continues until all test cases to be tested have been completed.
[0197] The third application is one of the first application and the second application, and the fourth application is the other of the first application and the second application;
[0198] When the third application is the first application, the third plugin is the first plugin, the fourth plugin is the second plugin, the first performance data includes each first performance sub-data, and the second performance data includes each second performance sub-data.
[0199] When the third application is the second application, the third plugin is the second plugin, the fourth plugin is the first plugin, the first performance data includes each of the second performance sub-data, and the second performance data includes each of the first performance sub-data.
[0200] According to one or more embodiments of this disclosure, Example 4 provides the method of Example 3, the method further comprising:
[0201] The first application and the second application are respectively processed for data entry;
[0202] The step involves calling the third plugin through the third application to execute the current test case based on the configuration information of the current test case in the configuration file, thereby obtaining the first performance sub-data, including:
[0203] According to the configuration information of the current test case in the configuration file, the third application calls the third plugin to execute the current test case, and the first script is used to collect the data points of the third application as the first performance sub-data.
[0204] The step involves calling the fourth plugin through the fourth application to execute the current test case based on the configuration information of the current test case in the configuration file, thereby obtaining the second performance sub-data, including:
[0205] According to the configuration information of the current test case in the configuration file, the fourth application calls the fourth plugin to execute the current test case, and the first script is scheduled to collect the instrumentation data of the fourth application as the second performance sub-data.
[0206] According to one or more embodiments of this disclosure, Example 5 provides the method of Example 1, wherein the test case to be tested is one or more, the first performance data includes third performance sub-data corresponding to each of the test cases to be tested, and the second performance data includes fourth performance sub-data corresponding to each of the test cases to be tested.
[0207] The step of generating test results for the test package based on the first performance data and the second performance data includes:
[0208] For each test case, calculate the difference between the third performance sub-data corresponding to the test case and the fourth performance sub-data corresponding to the test case; based on the difference, evaluate whether the test package experiences performance degradation on the test case.
[0209] Based on the performance degradation evaluation results of the test package on all the test cases, the test results of the test package are generated.
[0210] According to one or more embodiments of this disclosure, Example 6 provides the method of Example 5, wherein evaluating whether the test package experiences performance degradation on the test case based on the difference includes:
[0211] Based on the difference and the fourth performance sub-data corresponding to the test case, determine the percentage of degradation of the test package on the test case;
[0212] At least based on the percentage of degradation, determine whether the test package has experienced performance degradation on the test case.
[0213] According to one or more embodiments of this disclosure, Example 7 provides the method of Example 6, wherein determining whether the test package has experienced performance degradation on the test case is based at least on the degradation percentage, includes:
[0214] If the comparison result between the degradation percentage and the preset percentage threshold satisfies the first preset condition, then it is determined that the test package has experienced performance degradation on the test case.
[0215] According to one or more embodiments of this disclosure, Example 8 provides the method of Example 7, wherein determining whether the test package has experienced performance degradation on the test case based at least on the degradation percentage further includes:
[0216] If the comparison result between the degradation percentage and the preset percentage threshold does not meet the first preset condition, then determine whether the comparison result between the difference and the preset performance threshold meets the second preset condition.
[0217] If the comparison result between the difference and the preset performance threshold satisfies the second preset condition, then it is determined that the test package has experienced performance degradation on the test case.
[0218] According to one or more embodiments of this disclosure, Example 9 provides an application performance testing apparatus, the apparatus comprising:
[0219] The acquisition module is used to acquire the test package, the baseline package, and the test cases to be tested, wherein the test package is an application package after code modification of the baseline package;
[0220] The plugin generation module is used to generate a first plugin corresponding to the test package and a second plugin corresponding to the baseline package based on the execution logic of the test case to be tested.
[0221] The testing module is used to run the first application corresponding to the test package and the second application corresponding to the baseline package respectively to obtain first performance data and second performance data. The first performance data is the performance data obtained by the first application executing the test case based on the first plugin, and the second performance data is the performance data obtained by the second application executing the test case based on the second plugin.
[0222] The test result generation module is used to generate test results for the test package based on the first performance data and the second performance data.
[0223] According to one or more embodiments of the present disclosure, Example 10 provides a computer-readable medium having a computer program stored thereon that, when executed by a processing device, implements the steps of the method described in any one of Examples 1-8.
[0224] According to one or more embodiments of this disclosure, Example 11 provides an electronic device, including:
[0225] A storage device on which computer programs are stored;
[0226] A processing device for executing the computer program in the storage device to implement the steps of any one of the methods in Examples 1-8.
[0227] According to one or more embodiments of the present disclosure, Example 12 provides a computer program product including a computer program that, when executed by a processor, implements the steps of the method described in any one of Examples 1-8.
[0228] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.
[0229] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.
[0230] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative forms of implementing the claims. Regarding the apparatus in the above embodiments, the specific manner in which the various modules perform their operations has been described in detail in the embodiments relating to the method, and will not be elaborated upon here.
Claims
1. A method for performance testing of an application, characterized in that, The method includes: Obtain the test package, the baseline package, and the test cases to be tested, wherein the test package is an application package after code modifications to the baseline package; Based on the execution logic of the test case, a first plugin corresponding to the test package and a second plugin corresponding to the baseline package are generated. Run the first application corresponding to the test package and the second application corresponding to the baseline package respectively to obtain first performance data and second performance data. The first performance data is the performance data obtained by the first application executing the test case based on the first plugin, and the second performance data is the performance data obtained by the second application executing the test case based on the second plugin. Based on the first performance data and the second performance data, the test results of the test package are generated.
2. The method according to claim 1, characterized in that, The step of generating a first plugin corresponding to the test package and a second plugin corresponding to the baseline package based on the execution logic of the test case includes: Based on the execution logic of the test case, generate plugin code; The plugin code is compiled using the software development kit corresponding to the test package to obtain a first plugin package, and the plugin code is compiled using the software development kit corresponding to the baseline package to obtain a second plugin package; The test package is merged with the first plugin package to obtain the first plugin, and the baseline package is merged with the second plugin package to obtain the second plugin.
3. The method according to claim 1, characterized in that, There are multiple test cases to be tested; The step of running the first application corresponding to the test package and the second application corresponding to the baseline package respectively to obtain first performance data and second performance data includes: The test case to be tested in the current round is determined from the multiple test cases to be tested, and is used as the current test case; Write the configuration information of the current test case into the configuration file; Launch the third application and load the third plugin into the third application; Based on the configuration information of the current test case in the configuration file, the third application calls the third plugin to execute the current test case and obtain the first performance sub-data; Launch the fourth application and load the fourth plugin into the fourth application; Based on the configuration information of the current test case in the configuration file, the fourth application calls the fourth plugin to execute the current test case and obtain the second performance sub-data; The process of determining the test case to be tested in the current round from the multiple test cases to be tested, as the current test case, continues until all test cases to be tested have been completed. The third application is one of the first application and the second application, and the fourth application is the other of the first application and the second application; When the third application is the first application, the third plugin is the first plugin, the fourth plugin is the second plugin, the first performance data includes each first performance sub-data, and the second performance data includes each second performance sub-data. When the third application is the second application, the third plugin is the second plugin, the fourth plugin is the first plugin, the first performance data includes each of the second performance sub-data, and the second performance data includes each of the first performance sub-data.
4. The method according to claim 3, characterized in that, The method further includes: The first application and the second application are respectively processed for data entry; The step involves calling the third plugin through the third application to execute the current test case based on the configuration information of the current test case in the configuration file, thereby obtaining the first performance sub-data, including: According to the configuration information of the current test case in the configuration file, the third application calls the third plugin to execute the current test case, and the first script is used to collect the data points of the third application as the first performance sub-data. The step involves calling the fourth plugin through the fourth application to execute the current test case based on the configuration information of the current test case in the configuration file, thereby obtaining the second performance sub-data, including: According to the configuration information of the current test case in the configuration file, the fourth application calls the fourth plugin to execute the current test case, and the first script is scheduled to collect the instrumentation data of the fourth application as the second performance sub-data.
5. The method according to claim 1, characterized in that, The test cases to be tested can be one or more, the first performance data includes the third performance sub-data corresponding to each of the test cases to be tested, and the second performance data includes the fourth performance sub-data corresponding to each of the test cases to be tested. The step of generating test results for the test package based on the first performance data and the second performance data includes: For each test case, calculate the difference between the third performance sub-data corresponding to the test case and the fourth performance sub-data corresponding to the test case; based on the difference, evaluate whether the test package experiences performance degradation on the test case. Based on the performance degradation evaluation results of the test package on all the test cases, the test results of the test package are generated.
6. The method according to claim 5, characterized in that, The step of evaluating whether the test package experiences performance degradation on the test case based on the difference includes: Based on the difference and the fourth performance sub-data corresponding to the test case, determine the percentage of degradation of the test package on the test case; At least based on the percentage of degradation, determine whether the test package has experienced performance degradation on the test case.
7. The method according to claim 6, characterized in that, Determining whether the test package has experienced performance degradation on the test case, at least based on the degradation percentage, includes: If the comparison result between the degradation percentage and the preset percentage threshold satisfies the first preset condition, then it is determined that the test package has experienced performance degradation on the test case.
8. The method according to claim 7, characterized in that, The step of determining whether the test package has experienced performance degradation on the test case based at least on the degradation percentage further includes: If the comparison result between the degradation percentage and the preset percentage threshold does not meet the first preset condition, then determine whether the comparison result between the difference and the preset performance threshold meets the second preset condition. If the comparison result between the difference and the preset performance threshold satisfies the second preset condition, then it is determined that the test package has experienced performance degradation on the test case.
9. A performance testing device for an application, characterized in that, The device includes: The acquisition module is used to acquire the test package, the baseline package, and the test cases to be tested, wherein the test package is an application package after code modification of the baseline package; The plugin generation module is used to generate a first plugin corresponding to the test package and a second plugin corresponding to the baseline package based on the execution logic of the test case to be tested. The testing module is used to run the first application corresponding to the test package and the second application corresponding to the baseline package respectively to obtain first performance data and second performance data. The first performance data is the performance data obtained by the first application executing the test case based on the first plugin, and the second performance data is the performance data obtained by the second application executing the test case based on the second plugin. The test result generation module is used to generate test results for the test package based on the first performance data and the second performance data.
10. A computer-readable medium having a computer program stored thereon, characterized in that, When executed by a processing device, the computer program performs the steps of the method according to any one of claims 1-8.
11. An electronic device, characterized in that, include: A storage device on which computer programs are stored; A processing device for executing the computer program in the storage device to implement the steps of the method according to any one of claims 1-8.
12. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1-8.