Software performance testing method, device, electronic device and readable storage medium

Through automated test strategy matching and application, the problem of low accuracy and low efficiency of manual analysis of software performance analysis tools under large amounts of data is solved, and efficient software performance testing and report generation are achieved.

CN113806205BActive Publication Date: 2024-08-30TENCENT TECH SHANGHAI
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202010537210.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-06-12
Publication Date
2024-08-30
Estimated Expiration
2040-06-12

AI Technical Summary

Technical Problem

Existing software performance analysis tools have problems with low accuracy and low efficiency in manual analysis when the amount of data is large, making it difficult to effectively conduct in-depth analysis of performance issues.

Method used

By obtaining the performance data of the software to be tested, matching and applying the corresponding test strategy from the preset test strategy library based on the resource type, the performance data is automatically tested, and the test report is generated to reduce manual participation.

Benefits of technology

It improves the accuracy and efficiency of software performance testing, automatically matches test strategies and data for testing, generates detailed test reports, and simplifies the analysis process of performance problems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113806205B
    Figure CN113806205B
Patent Text Reader

Abstract

The present application provides a software performance testing method, device, electronic device and readable storage medium, wherein the method includes: obtaining performance data for performance testing of the software to be tested; obtaining the resource type of each performance data, and obtaining a preset test strategy for testing the performance data from a test strategy library based on the resource type of each performance data, wherein the test strategy library stores preset test strategies corresponding to each resource type in the software to be tested; performing performance testing on each performance data based on the preset test strategy, and obtaining the test result corresponding to each performance data; and obtaining a test report of the software to be tested based on each test result. In this solution, the corresponding test strategy is automatically matched according to the resource type of the performance data to complete the performance test to obtain the test result, and the test report is summarized. Both the testing of the performance data and the summary of the test results do not require human participation, thereby improving the accuracy and efficiency of the test.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a software performance testing method, device, electronic device and readable storage medium. Background Art

[0002] Software performance is a very important non-functional characteristic corresponding to software functions, which indicates the requirements of software systems for timeliness and resource economy. Many existing performance analysis tools can only draw the trend of various performance data after obtaining software performance data. To further analyze performance issues, testers are required to manually process and analyze performance data to obtain test reports. However, when the amount of data is large, manual analysis has the problems of low accuracy and low efficiency. Summary of the invention

[0003] The purpose of this application is to solve at least one of the above technical defects. The technical solutions provided by the embodiments of this application are as follows:

[0004] In a first aspect, an embodiment of the present application provides a software performance testing method, including:

[0005] Obtaining performance data of the software to be tested for performance testing;

[0006] Obtaining the resource type of each performance data, and based on the resource type of each performance data, obtaining a preset test strategy for testing the performance data from a test strategy library, wherein the test strategy library stores preset test strategies corresponding to each resource type in the software to be tested;

[0007] Perform performance tests on each performance data based on a preset test strategy, and obtain the test results corresponding to each performance data;

[0008] Based on each test result, obtain a test report of the software to be tested;

[0009] Among them, the test strategy library is constructed in the following way:

[0010] Determine the resource type corresponding to each performance data used for performance testing of the software to be tested, and determine the data identification attribute and performance attribute corresponding to each resource type;

[0011] For each resource type, the corresponding performance data identification condition is obtained based on the data identification attribute corresponding to the resource type, and the corresponding performance test rule is obtained based on the performance attribute corresponding to the resource type;

[0012] Based on the performance data identification conditions and performance test rules corresponding to each resource type, the preset test strategy corresponding to the resource type is obtained, and a test strategy library is constructed based on each resource type and the corresponding preset test strategy.

[0013] In an optional embodiment of the present application, obtaining performance data for performance testing of the software to be tested includes:

[0014] Acquire performance data generated during the running of the software to be tested to obtain a first performance data set;

[0015] Based on the preset whitelist, the performance data corresponding to the resource types included in the whitelist in the first performance data set are screened out to obtain a second performance data set, where the performance data in the second performance data set is the performance data used for performance testing.

[0016] In an optional embodiment of the present application, obtaining performance data generated during the running of the software to be tested includes:

[0017] A performance collection plug-in is set in the software to be tested, and performance data is obtained through the performance collection plug-in during the operation of the software to be tested.

[0018] In an optional embodiment of the present application, obtaining a preset test strategy for testing the performance data from a test strategy library based on the resource type of each performance data includes:

[0019] At least one preset test policy corresponding to the resource type of each performance data is obtained from the test policy library, and the preset test policy whose performance data identification condition matches the performance data in each preset test policy corresponding to each performance data is used as the preset test policy for testing the performance data.

[0020] In an optional embodiment of the present application, a performance test is performed on each performance data based on a preset test strategy to obtain a test result corresponding to each performance data, including:

[0021] Substituting each performance data into the performance test rule corresponding to the preset test strategy to obtain the test result corresponding to the performance data;

[0022] If the performance data meets the performance test rules corresponding to the test strategy, the corresponding test result is passed; otherwise, the corresponding test result is failed.

[0023] In an optional embodiment of the present application, based on each test result, obtaining a test report of the software to be tested includes:

[0024] Based on the resource type of the performance data corresponding to the failed test results and the preset test strategy, a test report of the software to be tested is obtained.

[0025] In an optional embodiment of the present application, obtaining a test report of the software to be tested based on the resource type of the performance data corresponding to the failed test result and the preset test strategy includes:

[0026] Based on the performance data corresponding to each failed test result, obtain the functional module corresponding to the test result, and based on the resource type and preset test strategy corresponding to the test result, obtain optimization suggestions for the test result;

[0027] Generate a test report for the software to be tested based on the functional modules and optimization suggestions corresponding to each failed test result.

[0028] In a second aspect, an embodiment of the present application provides a software performance testing device, including:

[0029] A performance data acquisition module is used to acquire performance data of the software to be tested for performance testing;

[0030] A preset test strategy acquisition module is used to obtain the resource type of each performance data, and based on the resource type of each performance data, obtain a preset test strategy for testing the performance data from a test strategy library, wherein the test strategy library stores preset test strategies corresponding to each resource type in the software to be tested;

[0031] A test result acquisition module is used to obtain the test result corresponding to each performance data based on a preset test strategy;

[0032] A test report acquisition module is used to perform performance tests on various performance data based on various test results and obtain a test report of the software to be tested;

[0033] Among them, the test strategy library is constructed in the following way:

[0034] Determine the resource type corresponding to each performance data used for performance testing of the software to be tested, and determine the data identification attribute and performance attribute corresponding to each resource type;

[0035] For each resource type, the corresponding performance data identification condition is obtained based on the data identification attribute corresponding to the resource type, and the corresponding performance test rule is obtained based on the performance attribute corresponding to the resource type;

[0036] Based on the performance data identification conditions and performance test rules corresponding to each resource type, the preset test strategy corresponding to the resource type is obtained, and a test strategy library is constructed based on each resource type and the corresponding preset test strategy.

[0037] In an optional embodiment of the present application, the performance data acquisition module further includes: a first performance data set acquisition module and a second performance data set acquisition module, wherein:

[0038] A first performance data set acquisition module is used to acquire performance data generated during the operation of the software to be tested to obtain a first performance data set;

[0039] The second performance data set acquisition module is used to filter out the performance data corresponding to the resource types included in the whitelist in the first performance data set based on a preset whitelist, and obtain a second performance data set. The performance data in the second performance data set is the performance data used for performance testing.

[0040] In an optional embodiment of the present application, the first performance data set acquisition module is specifically used to:

[0041] A performance collection plug-in is set in the software to be tested, and performance data is obtained through the performance collection plug-in during the operation of the software to be tested.

[0042] In an optional embodiment of the present application, the preset test strategy acquisition module is specifically used to:

[0043] At least one preset test policy corresponding to the resource type of each performance data is obtained from the test policy library, and the preset test policy whose performance data identification condition matches the performance data in each preset test policy corresponding to each performance data is used as the preset test policy for testing the performance data.

[0044] In an optional embodiment of the present application, the test result acquisition module is specifically used to:

[0045] Substituting each performance data into the performance test rule corresponding to the preset test strategy to obtain the test result corresponding to the performance data;

[0046] If the performance data meets the performance test rules corresponding to the test strategy, the corresponding test result is passed; otherwise, the corresponding test result is failed.

[0047] In an optional embodiment of the present application, the test report acquisition module is specifically used to:

[0048] Based on the resource type of the performance data corresponding to the failed test results and the preset test strategy, a test report of the software to be tested is obtained.

[0049] In an optional embodiment of the present application, the test report acquisition module is further used to:

[0050] Based on the performance data corresponding to each failed test result, obtain the functional module corresponding to the test result, and based on the resource type and preset test strategy corresponding to the test result, obtain optimization suggestions for the test result;

[0051] Generate a test report for the software to be tested based on the functional modules and optimization suggestions corresponding to each failed test result.

[0052] In a third aspect, an embodiment of the present application provides an electronic device, including a memory and a processor;

[0053] A computer program is stored in the memory;

[0054] A processor is used to execute a computer program to implement the method provided in the embodiment of the first aspect or any optional embodiment of the first aspect.

[0055] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the method provided in the embodiment of the first aspect or any optional embodiment of the first aspect is implemented.

[0056] The beneficial effects of the technical solution provided by this application are:

[0057] The corresponding preset test strategy is matched from the preset test database by the resource type of each performance data, and then the preset test strategy is used to test the corresponding performance data to obtain the test results, and the test results are summarized to obtain the corresponding test report. In this solution, the corresponding test strategy is automatically matched according to the resource type of the performance data to complete the performance test to obtain the test results, and the test report is summarized. There is no need for manual participation in the testing of performance data and the summary of test results, which improves the accuracy and efficiency of the test. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in describing the embodiments of the present application.

[0059] Figure 1 A flowchart of a software performance testing method provided in an embodiment of the present application;

[0060] Figure 2 A schematic diagram of the structure of a software testing system provided in an embodiment of the present application;

[0061] Figure 3a-3g A schematic diagram showing the contents of various parts of a test report of a game software in an example of an embodiment of the present application;

[0062] Figure 4 A schematic diagram of the overall solution of the embodiment of the present application;

[0063] Figure 5 A structural block diagram of a software performance testing device provided in an embodiment of the present application;

[0064] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0065] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and cannot be interpreted as limiting the present invention.

[0066] It will be understood by those skilled in the art that, unless expressly stated, the singular forms "one", "said", and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present application refers to the presence of the features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof. It should be understood that when we refer to an element as being "connected" or "coupled" to another element, it may be directly connected or coupled to the other element, or there may be an intermediate element. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The term "and / or" used herein includes all or any unit and all combinations of one or more associated listed items.

[0067] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.

[0068] Figure 1 A flowchart of a software performance testing method provided in an embodiment of the present application is shown in FIG. Figure 1 As shown, the method may include:

[0069] Step S101, obtaining performance data for performance testing of the software to be tested.

[0070] Among them, performance data refers to various performance-related data generated during the operation of the software to be tested. Specifically, it is generated by each functional module of the software to be tested in the process of realizing their respective functions. For example, for game software developed based on the Unity3D (United 3D) engine, the performance data in this type of game software can be generated by the following functional modules during operation: art resource module, CPU (Central Processing Unit) overall performance module, memory usage module, rendering performance module, loading module, UI (User Interface) module, animation and particle system module.

[0071] In addition, each performance data has a unique resource type, which can be specifically determined by the fields contained in the performance data itself. For example, in the above-mentioned game software, the resource types corresponding to the performance data contained in the art resource module may include Texture2D (two-dimensional texture), Mesh (mesh), Material (material), AudioClip (audio clip), Animator (animation), AnimationClip (animation clip), ParticleSystem (particle system), RenderTexture (rendering structure), Texture3D (three-dimensional texture), Shader (shader), and the performance data of the UI module mainly comes from the stack details of the function, that is, the resource type corresponding to the performance data contained therein can be a stack detail type. As shown in Table 1, the resource types corresponding to the performance data contained in a game software developed based on the Unity3D engine are listed. In Table 1, each resource type can be divided into two categories, namely art_asset (art asset) type and perform (running) type. Among them, art_asset can be understood as a static resource type, which generally includes art resource types such as textures, materials, etc., and perform can be understood as a dynamic resource type, which generally includes CPU, memory, rendering, and stack data. According to the above differences, the test strategies used for the performance data corresponding to the two major resource types will be different. At the same time, Table 1 lists the data table name corresponding to each resource type. The data table name is the name of the data table where the performance data is classified and stored, which can be used as an index to obtain the corresponding performance data from the database. The resource type description is a description of the corresponding resource types.

[0072] Table 1

[0073] Resource Type type Table name Resource Type Description AnimationClip art_asset perform_assetDetail_data AnimationClip Animator art_asset perform_assetDetail_data Animator AudioClip art_asset perform_assetDetail_data AudioClip CpuPerform perform perform_summary_cpu_data CPU Performance Material art_asset perform_assetDetail_data Material MemPerform perform perform_summary_mem_data Memory performance Mesh art_asset perform_assetDtail_data Mesh ParticleSystem art_asset perform_assetDtail_data ParticleSystem RenderPerform perform perform_summary_rendering_data Rendering performance RenderTexture art_asset perform_assetDetail_data RenderTexture Shader art_asset perform_assetDetail_data Shader StackDtail perform perform_summary_detail_data Stack Details Texture2D art_asset perform_assetDetail_data Texture2D Texture3D art_asset perform_assetDetail_data Texture3D

[0074] Specifically, after obtaining the performance data generated during the operation of the software to be tested, each performance data is uploaded to a preset database for storage. Specifically, the preset database can be divided into storage partitions corresponding to multiple functional modules, and one or more data tables are set under each partition, and each data table corresponds to a data table name. For each performance data, its resource type is obtained, and its corresponding data table name is determined, and then the performance data is stored in the data table indicated by the corresponding data table name. For example, each functional module in the preset database of the above-mentioned game software has a total of five data tables corresponding to each functional module, and the data table names are: perform_assetDetail_data, perform_summary_cpu_data, perform_summary_mem_data, perform_summary_rendering_data and perform_summary_detail_data. For example, the performance data of resource types such as AnimationClip, Animator and AudioClip are stored in the data table indicated by perform_assetDetail_data, and the performance data of the StackDtail resource type is stored in the data table indicated by perform_summary_detail_data.

[0075] Step S102, obtaining the resource type of each performance data, and based on the resource type of each performance data, obtaining a preset test strategy for testing the performance data from a test strategy library, wherein the test strategy library stores preset test strategies corresponding to each resource type in the software to be tested.

[0076] The preset test strategy is a pre-set test method for each resource type. The test strategy library stores the preset test strategies corresponding to all resource types of the software to be tested. The test strategy library is constructed in the following way:

[0077] Determine the resource type corresponding to each performance data used for performance testing of the software to be tested, and determine the data identification attribute and performance attribute corresponding to each resource type;

[0078] For each resource type, the corresponding performance data identification condition is obtained based on the data identification attribute corresponding to the resource type, and the corresponding performance test rule is obtained based on the performance attribute corresponding to the resource type;

[0079] Based on the performance data identification conditions and performance test rules corresponding to each resource type, the preset test strategy corresponding to the resource type is obtained, and a test strategy library is constructed based on each resource type and the corresponding preset test strategy.

[0080] Specifically, for each performance data, when the performance data is obtained from the preset database, it can be known from the previous description that the performance data for performance testing can be taken out from different data tables according to the resource type of the required performance data, and then according to the resource type of the performance data, the test policy corresponding to the resource type can be matched from the test policy library. It can be understood that since each performance data is stored in categories, the required performance data can be quickly obtained. At the same time, since the preset test policies corresponding to each resource type are preset in the test policy library, the test policies corresponding to each performance data can be accurately matched.

[0081] Specifically, before testing the software to be tested, a corresponding test strategy library needs to be built. Each preset test strategy in the test strategy library contains two parts, namely, performance data identification conditions and performance test rules. When using the preset test strategy to test a certain performance data, the performance data must first meet the performance data identification conditions in the test strategy, and then use the performance test rules to judge the performance data.

[0082] Among them, the performance data corresponding to each resource type has its own data structure characteristics (data identification attributes) and the performance (performance attributes) required to be tested. Its data structure characteristics can be used to identify the performance data, and its required performance can be used to determine the performance test rules that need to be set. In other words, the performance data identification conditions in the corresponding test strategy can be determined according to the data identification attributes corresponding to each resource type, and the performance test rules in the corresponding test strategy can be determined according to the performance attributes corresponding to each resource type. After obtaining the preset test strategies corresponding to all resource types of the software to be tested, the test strategy library can be obtained by storing them according to the corresponding resource types.

[0083] For example, in a game software developed based on the Unity3D engine, the performance attributes corresponding to the stack details resource type are shown in Table 2, where GC (Garbage Collection) Alloc refers to garbage collection bin memory allocation. Then, according to the performance attributes corresponding to the stack details and their corresponding meanings, the performance test rules in the corresponding preset test strategy can be determined. For example, according to the performance attribute Calls, determine that the upper limit of the number of calls of the relevant function is less than or equal to the predicted number; according to the performance attribute Avg (Total Time), determine that the average time consumption of the relevant function is less than or equal to the preset duration, etc.

[0084] Table 2

[0085]

[0086]

[0087] After determining the performance data identification conditions and performance test rules corresponding to each resource type, the preset test strategy corresponding to the resource type can be obtained. Continuing with the example, Table 3 lists multiple preset test strategies corresponding to the resource type of stack details in the CPU overall performance module. Among them, the preset test strategies corresponding to rows 2-6 define the performance data identification conditions. For example, the performance data identification condition in row 2 is that the function name contained in the performance data is Instantiate. If the performance data identification condition is met, the corresponding performance test rule is used to make a judgment, that is, to judge whether the number of calls to the function Instantiate contained in the performance data is less than or equal to 5 / 10min (that is, 5 times every ten minutes). Among them, if the performance data identification conditions of rows 7-8 are empty, the corresponding performance test rules are applicable to all performance data corresponding to the resource type of stack details.

[0088] Table 3

[0089] Resource Type Performance data identification conditions Performance Testing Rules Stack Details The function name is Instantiate The number of calls is less than or equal to 5 / 10min Stack Details The function name is GameObject Deactivate The number of calls is less than or equal to 5 Stack Details The function name is GameObject Activate The number of calls is less than or equal to 5 Stack Details The function name is Destory The number of calls is less than or equal to 50 Stack Details The function name is Shader createPrograme The number of calls is less than or equal to 10 Stack Details The function name is Behaviour Update The number of calls is less than or equal to 10 Stack Details null GC Alloc is less than or equal to 1KB Stack Details null The number of calls is less than or equal to 100

[0090] Among them, various comparison or matching operations are used when setting performance test rules, such as less than or equal to, greater than, value meets regularity, name meets regularity, etc. When setting specific performance rules, these comparison or matching operations can be selected according to actual conditions.

[0091] Step S103: Perform a performance test on each performance data based on a preset test strategy to obtain a test result corresponding to each performance data.

[0092] Specifically, for each performance data, after obtaining the performance data and its corresponding test strategy, the performance data is tested using the test strategy to obtain the corresponding test result. Due to the classified storage of performance data, the performance data in each data table can be tested one by one in the test process to obtain the test result, which can ensure that no performance data is missed.

[0093] It should be noted that each performance data may correspond to one or more test strategies.

[0094] Step S104: obtaining a test report of the software to be tested based on each test result.

[0095] The test report is used to show the user the performance test results of the software to be tested. It summarizes the test results corresponding to the performance data under each functional module so that developers can clearly and intuitively know the performance problems of the software to be tested.

[0096] Specifically, the test results can be integrated according to the functional modules to which the performance data corresponding to each test result belongs and / or the resource types corresponding to the performance data, and a test report of the software to be tested can be obtained. Specifically, the test report can be in various forms, for example, it can show a summary of the test results corresponding to the performance data generated by one or several functional modules, or it can show a comparison of the test results corresponding to the performance data of different versions of the software to be tested, etc.

[0097] The solution provided by the embodiment of the present application matches the corresponding preset test strategy from a preset test database by the resource type of each performance data, then uses the preset test strategy to test the corresponding performance data to obtain the test results, and summarizes the test results to obtain the corresponding test report. In this solution, the corresponding test strategy is automatically matched according to the resource type of the performance data to complete the performance test to obtain the test results, and the test report is summarized. There is no need for manual participation in the testing of the performance data and the summary of the test results, which improves the accuracy and efficiency of the test.

[0098] In an optional embodiment of the present application, obtaining performance data for performance testing of the software to be tested includes:

[0099] Acquire performance data generated during the running of the software to be tested to obtain a first performance data set;

[0100] Based on the preset whitelist, the performance data corresponding to the resource types included in the whitelist in the first performance data set are screened out to obtain a second performance data set, where the performance data in the second performance data set is the performance data used for performance testing.

[0101] The preset whitelist includes one or more resource types, and the performance data corresponding to the one or more resource types are resource types that do not need to be tested. It is understandable that the number and types of resource types in the preset whitelist can be set according to actual needs. Generally speaking, resource types that have little impact on the performance of the software to be tested can be put into the preset whitelist, which does not affect the accuracy of subsequent performance tests and can also improve the speed of performance tests.

[0102] For example, as shown in Table 4, it is a preset whitelist for testing a game software developed based on the Unity3D engine, which lists the resource types included in the preset whitelist. After obtaining the first performance data set, the performance data corresponding to the 10 resource types listed in Table 4 and the performance data name "Unknow" are filtered out to obtain the second performance data set, and the performance data in the second performance data set is the performance data used for performance testing.

[0103] Table 4

[0104] Performance data name Resource Type Unknown AnimationClip Unknown Animator Unknown AudioClip Unknown Material Unknown Mesh Unknown ParticleSystem Unknown RenderTexture Unknown Shader Unknown Texture2D Unknown Texture3D

[0105] In an optional embodiment of the present application, obtaining performance data generated during the running of the software to be tested includes:

[0106] A performance collection plug-in is set in the software to be tested, and performance data is obtained through the performance collection plug-in during the operation of the software to be tested.

[0107] Specifically, before running the software to be tested, a corresponding performance collection plug-in is set in the software to be tested to obtain performance data, and the performance data is uploaded to a preset database for storage. Specifically, corresponding performance collection plug-ins can be set for different functional modules.

[0108] In an optional embodiment of the present application, obtaining a preset test strategy for testing the performance data from a test strategy library based on the resource type of each performance data includes:

[0109] At least one preset test policy corresponding to the resource type of each performance data is obtained from the test policy library, and the preset test policy whose performance data identification condition matches the performance data in each preset test policy corresponding to each performance data is used as the preset test policy for testing the performance data.

[0110] Specifically, since a resource type can generally correspond to multiple preset test strategies, and the preset test strategies correspond to different performance data, for each performance data corresponding to a resource type, first determine the corresponding multiple preset test strategies according to its resource type, and then screen them according to the performance data identification conditions in each preset test strategy, that is, select the preset test strategy whose performance data identification conditions match the data structure of the performance data as the preset test strategy for the performance data.

[0111] In an optional embodiment of the present application, a performance test is performed on each performance data based on a preset test strategy to obtain a test result corresponding to each performance data, including:

[0112] Substituting each performance data into the performance test rule corresponding to the preset test strategy to obtain the test result corresponding to the performance data;

[0113] If the performance data meets the performance test rules corresponding to the test strategy, the corresponding test result is passed; otherwise, the corresponding test result is failed.

[0114] Specifically, after determining the preset test strategy for each performance data according to the performance data identification conditions of each preset test strategy corresponding to the data structure of the performance data and the resource type, substitute the corresponding content in the performance data into the performance test rule to determine whether the corresponding content satisfies the performance test rule. If so, the corresponding test result is passed; if not, the corresponding test result is failed. For example, if the preset test strategy corresponding to a certain performance data is the preset test strategy shown in the second row of Table 4, the number of calls to the function Instantiate contained in the performance data (i.e., the corresponding content mentioned above) is obtained. If the number is greater than 5 times per 10 minutes, the test result corresponding to the performance data is failed; if the number is less than or equal to 5 times per 10 minutes, the test result corresponding to the performance data is passed.

[0115] In an optional embodiment of the present application, based on each test result, obtaining a test report of the software to be tested includes:

[0116] Based on the resource type of the performance data corresponding to the failed test results and the preset test strategy, a test report of the software to be tested is obtained.

[0117] Specifically, generally speaking, failed test results play a decisive role in the performance evaluation of the software to be tested, so the failed test results will be analyzed and summarized in the test report, that is, the test report of the software to be tested is obtained through the failed test results.

[0118] In an optional embodiment of the present application, obtaining a test report of the software to be tested based on the resource type of the performance data corresponding to the failed test result and the preset test strategy includes:

[0119] Based on the performance data corresponding to each failed test result, obtain the functional module corresponding to the test result, and based on the resource type and preset test strategy corresponding to the test result, obtain optimization suggestions for the test result;

[0120] Generate a test report for the software to be tested based on the functional modules and optimization suggestions corresponding to each failed test result.

[0121] Among them, according to the functional module partition corresponding to the data table where the performance data is located, the functional module corresponding to the performance data can be determined, and then the functional module corresponding to the test result corresponding to the performance data can be determined. The failed test results in each functional module will be classified and displayed in the test report for the convenience of developers to view.

[0122] Furthermore, for each failed test result, its resource type, corresponding preset test strategy and corresponding optimization suggestions will be displayed. Among them, the optimization suggestions can be obtained according to the corresponding optimization strategy. For example, if the performance test rule in the preset test strategy corresponding to a failed test result is "the number of calls to the function Instantiate is less than or equal to 5 / 10min (that is, 5 times every ten minutes)", if the number of calls to the function Instantiate contained in the performance data corresponding to the failed test result is 7 / 10min, then the optimization suggestion for the failed test result can be "reduce the number of calls to the function Instantiate during the operation of the software to be tested". It can be understood that the preset optimization strategy is the basis for providing optimization suggestions.

[0123] Specifically, the test report first shows the conclusion of whether the performance test of the software to be tested has passed. The conclusion can be determined based on the number of failed test results contained in the software to be tested. For example, if the software to be tested contains failed test results, then the performance test of the software to be tested is considered to have passed. If the software to be tested does not contain failed test results, then the performance test of the software to be tested is considered to have failed.

[0124] In the test report, failed test results are displayed separately according to each functional module. For each functional module of the software to be tested, its problem overview is displayed first. The problem overview gives the number of failed test results and the resource type of the corresponding performance data. Then the problem details are displayed. The problem details give the details of the failed test results, including the preset test strategies for each failed test result, the actual values ​​in the corresponding performance data, and optimization suggestions.

[0125] After each test report is generated, the test report can be sent to relevant developers via email or the like, so that the developers can promptly grasp the test results of the software to be tested and optimize the software to be tested.

[0126] like Figure 2 The figure shows a structural diagram of a software testing system provided in an embodiment of the present application, which system may include a performance acquisition plug-in 201, a performance testing server 202 and a terminal device 203, wherein the performance testing server 202 includes a communication module, a storage module and a performance testing module, the communication module is used to establish a communication connection with the performance acquisition plug-in 201 and the terminal device 203 respectively to realize data reception and transmission, the storage module is used to store a preset test strategy library, performance data, test results and produced test reports, etc., the performance testing module is used to analyze the performance data, and call the corresponding test strategy in the preset test strategy library in the storage module to complete the test of the performance data.

[0127] When a game developer is testing a game software developed based on the Unity3D engine, the game developer can use the above software testing system to test the game software. The testing process may include: before starting the test, the performance acquisition plug-in 201 is set in each module of the game software. The performance testing server 202 establishes a communication connection with the performance acquisition plug-in 201 through the communication module and obtains the performance data collected by the performance acquisition plug-in 201. The performance testing module of the performance testing server 202 obtains the corresponding test strategy from the preset test strategy pre-stored in the storage module according to the resource type of the performance data, and completes the test of the performance data based on the test strategy, obtains the corresponding test results, and stores the test results in the storage module. After the test is completed, a test report of the game software is generated based on all performance test results. The performance testing server 202 sends the test report to the terminal device 203 of the game developer through the communication module for the game developer to view the test report.

[0128] For example, Figure 3a-3g This is a schematic diagram showing the contents of each part in the performance test report of a game software developed based on the Unity3D engine. From the test report, we can know that its performance test obtained 6 failed test results, 4 of which were from the CPU overall performance module and 2 from the art resource module.

[0129] Specifically, Figure 3a The corresponding part shows the conclusion of the performance test of the game software. There are 6 problems in the performance test (that is, there are 6 performance data corresponding to the test results that are not passed), and the performance test conclusion is not passed. Developers can learn the conclusion and number of problems of the performance test by viewing this part. At the same time, developers can also learn the current version of the game software, the device where the game software is located, and the test scenario (which can be one of the preset multiple scenarios) and other test environment information by viewing this part.

[0130] Figure 3b The corresponding part shows the number of problems under the CPU overall performance module and the resource types of the corresponding performance data. This part shows an overview of the problems in the CPU overall performance module. From this area, it can be seen that the test results corresponding to the performance data of 2 resource types, memory performance, and 2 resource types, stack details, failed. Figure 3c The corresponding part lists the average time consumption, memory peak value, and rendering data of each resource type in the CPU (i.e. the module name in the figure). Figure 3fThe corresponding part shows the problem details under the CPU overall performance module, including the resource type of each performance data (i.e. the module name in the figure), the performance data identification conditions in the corresponding preset test strategy (i.e. the check conditions in the figure) and performance test rules (i.e. the check rules in the figure), the actual value of the performance data, and the query button of the corresponding optimization strategy.

[0131] Figure 3d The corresponding part shows the number of problems under the art resource module and the resource type of the corresponding performance data. This part shows an overview of the problems in the art resource module. From this area, it can be seen that the test results corresponding to the performance data of the two resource types of Texture2D are failed. Figure 3e The corresponding section lists the peak memory usage and peak resource count of each resource type in the art resource module. Figure 3g The corresponding part shows the problem details under the art resource module, including the name of each performance data (i.e. the resource name in the figure), the resource type of each performance data (i.e. the module name in the figure), the performance data identification conditions in the corresponding preset test strategy (i.e. the inspection conditions in the figure) and performance test rules (i.e. the inspection rules in the figure), the actual value of the performance data and the query button of the corresponding optimization strategy.

[0132] Developers can view the test report to accurately and intuitively obtain the performance test conclusions, as well as an overview and details of the problems under each functional module, and obtain corresponding optimization suggestions.

[0133] In summary, the overall implementation process of the solution of this application can be as follows: Figure 4 As shown, the performance data of the software to be tested is obtained and manually or automatically uploaded to the preset database 401 for classified storage, wherein the automatic upload can be implemented by setting a collection plug-in in the software to be tested. Each performance data is read from the preset database 401, and the corresponding preset test strategy is matched from the preset test strategy library 402, and the corresponding performance data is subjected to performance testing using the preset test strategy to obtain the test result. The test report of the software to be tested can be obtained by analyzing and summarizing each test result, and optimization suggestions corresponding to the failed test results are given in the test report. Each test result and test report will be stored in the preset database for subsequent call and viewing.

[0134] In addition, after uploading the performance data of the software to be tested to the preset database 401, the performance data of each module of the software to be tested can also be read therefrom, and a data trend graph can be generated in chronological order (in the game software group, it can be in the frame order of the screen), so that the developer can know the change trend of the performance data in each module according to the trend graph, and can also know the performance data corresponding to each specific moment or each frame. At the same time, after storing the performance data of multiple versions of the software to be tested in the preset database 401, the performance data of each module of the multiple versions of the software to be tested can be compared to analyze the performance differences between different versions.

[0135] Figure 5 A structural block diagram of a software performance testing device provided in an embodiment of the present application, such as Figure 5 As shown, the device 500 may include: a performance data acquisition module 501, a preset test strategy acquisition module 502, a test result acquisition module 503 and a test report acquisition module 504, wherein:

[0136] The performance data acquisition module 501 is used to acquire the performance data of the software to be tested for performance testing;

[0137] The preset test strategy acquisition module 502 is used to obtain the resource type of each performance data, and based on the resource type of each performance data, obtain the preset test strategy for testing the performance data from the test strategy library, wherein the test strategy library stores the preset test strategy corresponding to each resource type in the software to be tested;

[0138] The test result acquisition module 503 is used to acquire the test result corresponding to each performance data based on the preset test strategy;

[0139] The test report acquisition module 504 is used to perform performance tests on various performance data based on various test results, and obtain a test report of the software to be tested;

[0140] Among them, the test strategy library is constructed in the following way:

[0141] Determine the resource type corresponding to each performance data used for performance testing of the software to be tested, and determine the data identification attribute and performance attribute corresponding to each resource type;

[0142] For each resource type, the corresponding performance data identification condition is obtained based on the data identification attribute corresponding to the resource type, and the corresponding performance test rule is obtained based on the performance attribute corresponding to the resource type;

[0143] Based on the performance data identification conditions and performance test rules corresponding to each resource type, the preset test strategy corresponding to the resource type is obtained, and a test strategy library is constructed based on each resource type and the corresponding preset test strategy.

[0144] The solution provided by the present application matches the corresponding preset test strategy from a preset test database by the resource type of each performance data, and then uses the preset test strategy to test the corresponding performance data to obtain the test results, and summarizes the test results to obtain the corresponding test report. In this solution, the corresponding test strategy is automatically matched according to the resource type of the performance data to complete the performance test to obtain the test results, and the test report is summarized. There is no need for manual participation in the testing of the performance data and the summary of the test results, which improves the accuracy and efficiency of the test.

[0145] In an optional embodiment of the present application, the performance data acquisition module further includes: a first performance data set acquisition module and a second performance data set acquisition module, wherein:

[0146] A first performance data set acquisition module is used to acquire performance data generated during the operation of the software to be tested to obtain a first performance data set;

[0147] The second performance data set acquisition module is used to filter out the performance data corresponding to the resource types included in the whitelist in the first performance data set based on a preset whitelist, and obtain a second performance data set. The performance data in the second performance data set is the performance data used for performance testing.

[0148] In an optional embodiment of the present application, the first performance data set acquisition module is specifically used to:

[0149] A performance collection plug-in is set in the software to be tested, and performance data is obtained through the performance collection plug-in during the operation of the software to be tested.

[0150] In an optional embodiment of the present application, the preset test strategy acquisition module is specifically used to:

[0151] At least one preset test policy corresponding to the resource type of each performance data is obtained from the test policy library, and the preset test policy whose performance data identification condition matches the performance data in each preset test policy corresponding to each performance data is used as the preset test policy for testing the performance data.

[0152] In an optional embodiment of the present application, the test result acquisition module is specifically used to:

[0153] Substituting each performance data into the performance test rule corresponding to the preset test strategy to obtain the test result corresponding to the performance data;

[0154] If the performance data meets the performance test rules corresponding to the test strategy, the corresponding test result is passed; otherwise, the corresponding test result is failed.

[0155] In an optional embodiment of the present application, the test report acquisition module is specifically used to:

[0156] Based on the resource type of the performance data corresponding to the failed test results and the preset test strategy, a test report of the software to be tested is obtained.

[0157] In an optional embodiment of the present application, the test report acquisition module is further used to:

[0158] Based on the performance data corresponding to each failed test result, obtain the functional module corresponding to the test result, and based on the resource type and preset test strategy corresponding to the test result, obtain optimization suggestions for the test result;

[0159] Generate a test report for the software to be tested based on the functional modules and optimization suggestions corresponding to each failed test result.

[0160] Based on the same principle, an embodiment of the present application further provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the method provided in any optional embodiment of the present application is implemented, and specifically the following situations can be implemented:

[0161] Obtain performance data for performance testing of the software to be tested; obtain the resource type of each performance data, and obtain the preset test policy for testing the performance data from the test policy library based on the resource type of each performance data, wherein the test policy library stores the preset test policy corresponding to each resource type in the software to be tested; perform performance testing on each performance data based on the preset test policy, and obtain the test result corresponding to each performance data; obtain the test report of the software to be tested based on each test result; wherein the test policy library is constructed in the following manner: determine the resource type corresponding to each performance data for performance testing of the software to be tested, and determine the data identification attribute and performance attribute corresponding to each resource type; for each resource type, obtain the corresponding performance data identification condition based on the data identification attribute corresponding to the resource type, and obtain the corresponding performance test rule based on the performance attribute corresponding to the resource type; obtain the preset test policy corresponding to each resource type based on the performance data identification condition and performance test rule corresponding to the resource type, and construct a test policy library based on each resource type and the corresponding preset test policy.

[0162] An embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, the method shown in any embodiment of the present application is implemented.

[0163] It is understandable that what is stored in the medium may be a computer program corresponding to the software performance testing method.

[0164] Figure 6 A schematic diagram of the structure of an electronic device applicable to an embodiment of the present application is shown in FIG. Figure 6 As shown, Figure 6 The electronic device 600 shown includes: a processor 601 and a memory 603. The processor 601 and the memory 603 are connected, such as through a bus 602. Further, the electronic device 600 may also include a transceiver 604, and the electronic device 600 may interact with other electronic devices through the transceiver 604. It should be noted that in actual applications, the transceiver 604 is not limited to one, and the structure of the electronic device 600 does not constitute a limitation on the embodiments of the present application.

[0165] The processor 601 is used in the embodiment of the present application to implement Figure 5 The software performance test device functionality is shown.

[0166] Processor 601 may be a CPU, a general purpose processor, a DSP, an ASIC, an FPGA or other programmable logic device, a transistor logic device, a hardware component or any combination thereof. It may implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of this application. Processor 601 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.

[0167] The bus 602 may include a path to transmit information between the above components. The bus 602 may be a PCI bus or an EISA bus, etc. The bus 602 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0168] The memory 603 may be a ROM or other type of static storage device that can store static information and instructions, a RAM or other type of dynamic storage device that can store information and instructions, or an EEPROM, a CD-ROM or other optical disk storage, an optical disk storage (including a compressed optical disk, a laser disk, an optical disk, a digital versatile disk, a Blu-ray disk, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited to these.

[0169] The memory 603 is used to store the application code for executing the solution of the present application, and the execution is controlled by the processor 601. The processor 601 is used to execute the application code stored in the memory 603 to implement Figure 5 The illustrated embodiment provides actions of the software performance testing device.

[0170] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.

[0171] The above are only some implementation methods of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A software performance testing method, characterized in that: include: Obtaining performance data of the software to be tested for performance testing; Obtaining the resource type of each performance data, and obtaining a preset test strategy for testing the performance data from a test strategy library based on the resource type of each performance data, wherein the test strategy library stores the preset test strategy corresponding to each resource type in the software to be tested; Performing a performance test on each performance data based on the preset test strategy, and obtaining a test result corresponding to each performance data; Based on each test result, generate a test report for the software to be tested; The test strategy library is constructed in the following way: Determine the resource type corresponding to each performance data for performance testing of the software to be tested, and determine the data identification attribute and performance attribute corresponding to each resource type; For each resource type, the corresponding performance data identification condition is obtained based on the data identification attribute corresponding to the resource type, and the corresponding performance test rule is obtained based on the performance attribute corresponding to the resource type; Based on the performance data identification conditions and performance test rules corresponding to each resource type, the preset test strategy corresponding to the resource type is obtained, and based on each resource type and the corresponding preset test strategy, the test strategy library is constructed.

2. The method according to claim 1, characterized in that The step of obtaining the performance data of the software to be tested for performance testing includes: Acquire performance data generated during the running of the software to be tested to obtain a first performance data set; Based on a preset whitelist, performance data corresponding to resource types included in the whitelist in the first performance data set is screened out to obtain a second performance data set, where the performance data in the second performance data set is performance data used for performance testing.

3. The method according to claim 2, characterized in that The obtaining of performance data generated during the running of the software to be tested includes: A performance acquisition plug-in is set in the software to be tested, and performance data is obtained through the performance acquisition plug-in during the running of the software to be tested.

4. The method according to claim 1, characterized in that: The step of acquiring a preset test strategy for testing the performance data from a test strategy library based on the resource type of each performance data includes: At least one preset test policy corresponding to the resource type of each performance data is obtained from the test policy library, and the preset test policy whose performance data identification condition matches the performance data in each preset test policy corresponding to each performance data is used as the preset test policy for testing the performance data.

5. The method according to claim 4, characterized in that The performing a performance test on each performance data based on the preset test strategy to obtain a test result corresponding to each performance data includes: Substituting each performance data into the performance test rule corresponding to the preset test strategy to obtain the test result corresponding to the performance data; If the performance data satisfies the performance test rule corresponding to the test strategy, the corresponding test result is passed; otherwise, the corresponding test result is failed.

6. The method according to claim 5, characterized in that The step of obtaining a test report of the software to be tested based on each test result includes: Based on the resource type of the performance data corresponding to the failed test result and the preset test strategy, a test report of the software to be tested is obtained.

7. The method according to claim 6, characterized in that The obtaining of the test report of the software to be tested based on the resource type of the performance data corresponding to the failed test result and the preset test strategy includes: Based on the performance data corresponding to each failed test result, obtain the functional module corresponding to the test result, and based on the resource type and preset test strategy corresponding to the test result, obtain optimization suggestions for the test result; Generate a test report for the software to be tested based on the functional modules and optimization suggestions corresponding to each failed test result.

8. A software performance testing device, characterized in that: include: A performance data acquisition module is used to acquire performance data of the software to be tested for performance testing; A preset test strategy acquisition module, used to acquire the resource type of each performance data, and based on the resource type of each performance data, acquire a preset test strategy for testing the performance data from a test strategy library, wherein the test strategy library stores preset test strategies corresponding to each resource type in the software to be tested; A test result acquisition module, used to acquire the test result corresponding to each performance data based on the preset test strategy; A test report acquisition module, used to perform performance tests on various performance data based on various test results, and obtain a test report of the software to be tested; The test strategy library is constructed in the following way: Determine the resource type corresponding to each performance data for performance testing of the software to be tested, and determine the data identification attribute and performance attribute corresponding to each resource type; For each resource type, the corresponding performance data identification condition is obtained based on the data identification attribute corresponding to the resource type, and the corresponding performance test rule is obtained based on the performance attribute corresponding to the resource type; Based on the performance data identification conditions and performance test rules corresponding to each resource type, the preset test strategy corresponding to the resource type is obtained, and based on each resource type and the corresponding preset test strategy, the test strategy library is constructed.

9. An electronic device, characterized in that: including memory and processor; The memory stores a computer program; The processor is configured to execute the computer program to implement the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Method for detecting network performance, packet loss probability and time delay and network fringe node equipment

    CN103618646A

  • Automatic performance testing method, device and system

    CN107992362A