Performance testing method, device, storage medium and terminal
Through monitoring and Mock simulation test processing, the problem of difficulty in distinguishing the performance data of running modules in the existing technology is solved, and the efficiency and accuracy of performance testing are achieved.
Patent Information
- Application Number
- CN202110254160.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-09
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2041-03-09
AI Technical Summary
The existing technology is difficult to distinguish the performance data generated by each operating module during operation, resulting in low efficiency and accuracy of performance testing.
By monitoring the program code changes of the target application, perform Mock simulation test processing, obtain the performance ratio data of the target module, and analyze these data to achieve accurate differentiation of the target module performance test results.
It improves the efficiency and accuracy of performance testing, can accurately distinguish the performance data of target modules in target applications, and enhances the reliability of performance testing.
Smart Images

Figure CN112905432B
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a performance testing method, device, storage medium and terminal. Background Art
[0002] In the process of software product development, performance testing of software products is an essential step to improve the performance of software products. In the prior art, the performance of software products is usually analyzed and evaluated by obtaining various performance data generated during the operation of software products. However, each software product is composed of multiple operating modules. In different working environments, the performance data generated by each operating module may be different. Therefore, there is a problem that the performance data generated by each operating module during the operation cannot be obtained or distinguished. Summary of the invention
[0003] The embodiments of the present application provide a performance testing method, device, storage medium and terminal, which can solve the problem that the performance data generated by each running module during operation cannot be distinguished in the related art. The technical solution is as follows:
[0004] In a first aspect, an embodiment of the present application provides a performance testing method, which is applied to an electronic device, in which at least one application is installed, and each program code of the application corresponds to at least two modules, wherein the method comprises:
[0005] Monitoring whether a program code corresponding to a target application program has changed; wherein the at least one application program includes the target application program;
[0006] In the case where the program code corresponding to the target application program changes, a Mock simulation test process is performed on the target application program to obtain performance share data corresponding to the target module; wherein the at least two modules include the target module;
[0007] The performance ratio data is analyzed to obtain the performance test result of the target module.
[0008] In a second aspect, an embodiment of the present application provides a performance testing device, which is applied to an electronic device, in which at least one application is installed, and each program code of the application corresponds to at least two modules, wherein the device comprises:
[0009] A monitoring module, used to monitor whether a program code corresponding to a target application program has changed; wherein the at least one application program includes the target application program;
[0010] A processing module, used for performing a mock test on the target application to obtain performance share data corresponding to the target module when the program code corresponding to the target application changes; wherein the at least two modules include the target module;
[0011] The analysis module is used to analyze the performance ratio data to obtain the performance test result of the target module.
[0012] In a third aspect, an embodiment of the present application provides a computer storage medium, wherein the computer storage medium stores a plurality of instructions, wherein the instructions are suitable for being loaded by a processor and executing the above-mentioned method steps.
[0013] In a fourth aspect, an embodiment of the present application provides a terminal, which may include: a processor, a memory, and a display screen; wherein the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the above-mentioned method steps.
[0014] The beneficial effects brought about by the technical solutions provided by some embodiments of the present application include at least:
[0015] When the scheme of the embodiment of the present application is executed, the terminal monitors whether the program code corresponding to the target application has changed. When the program code corresponding to the target application has changed, the target application is subjected to Mock simulation test processing to obtain the performance share data corresponding to the target module, and the performance share data is analyzed to obtain the performance test result of the target module. The working status of other modules in the same running process as the target module (that is, other modules except the target module in the target application) is simulated through the Mock test processing method, so as to accurately distinguish the performance data generated by the target module in the running process, and thus accurately distinguish the performance data generated by the target module in the running process of the target application, thereby improving the efficiency and accuracy of performance testing. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0017] Figure 1 It is a flowchart of the performance testing method provided in the embodiment of the present application;
[0018] Figure 2 is another flow chart of the performance testing method provided in the embodiment of the present application;
[0019] Figure 3 It is a schematic diagram of the Mock simulation process provided by the embodiment of the present application;
[0020] Figure 4 It is a display interface effect diagram of the performance testing method provided in the embodiment of the present application;
[0021] Figure 5 is a schematic diagram of the structure of a device provided in an embodiment of the present application;
[0022] Figure 6 It is a structural schematic diagram of a device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0023] In order to make the objectives, technical solutions and advantages of the present application more clear, the embodiments of the present application will be further described in detail below with reference to the accompanying drawings.
[0024] It should be noted that the terminal device can be various electronic devices with display screens, including but not limited to smart phones, tablet computers, portable computers and desktop computers, etc. The terminal device can be hardware or software. When the terminal device is software, it can be installed in the electronic devices listed above. It can be implemented as multiple software or software modules, or it can be implemented as a single software or software module, which is not specifically limited here. When the terminal device is hardware, a display device and a camera can also be installed on it. The display device display can be various devices that can realize the display function, and the camera is used to collect video streams; for example: the display device can be a cathode ray tube display (Cathode Raytubedisplay, CR), a light-emitting diode display (Light-Emitting diode Display, LED), an electronic ink screen, a liquid crystal display (Liquid Crystal Display, LCD), a plasma display panel (Plasma DisplayPanel, PDP), etc. The user can use the display device on the terminal device to view the displayed text, pictures, videos and other information.
[0025] Multiple applications can be installed on the terminal device in the present application, and the program code of each application corresponds to at least two modules. The applications on the terminal device need to be performance debugged before being put into use.
[0026] The following will be combined with the attached Figure 1 To Attachment Figure 4 , the performance testing method provided in the embodiment of the present application is introduced in detail.
[0027] See also Figure 1 , which is a flow chart of a performance testing method provided in the embodiment of the present application. Figure 1As shown, the method of the embodiment of the present application may include the following steps:
[0028] S101, monitoring whether the program code corresponding to the target application program has changed.
[0029] The target application refers to the application that needs to be performance tested. At least one application can be installed on the terminal. The target application is included in at least one application. An application refers to a computer program used to complete one or more specific tasks. The program code of each application corresponds to at least two modules, that is, each application calls at least two modules during the working process.
[0030] Generally, before an application (such as a target application) on a terminal is officially put into use, the user (the user in this application may be a developer and / or tester) will perform multiple performance debugging on the application. This will involve modifying the program code corresponding to the application. The process of the terminal performing performance testing on the application is also a performance test of the debugging performed by the user. The user can control whether the terminal performs performance testing. The user can control the terminal to start performance testing by executing the start test operation on the terminal.
[0031] In a feasible implementation, when the terminal performs a performance test, the user may select an application from at least one application installed on the terminal as the object of the performance test according to the requirements, that is, the selected application is the target application. The terminal determines the module in the target application that needs to be performance tested by monitoring whether the program code corresponding to the target application changes.
[0032] In another feasible implementation, when the terminal performs performance testing, the program codes corresponding to all applications installed on the terminal are monitored. If the terminal detects an application with program code changes, the application is used as the target application, and then the module in the target application that needs to be performance tested is determined based on the program code changes.
[0033] S102, when the program code corresponding to the target application program changes, a Mock simulation test is performed on the target application program to obtain performance share data corresponding to the target module.
[0034] Among them, Mock simulation test processing includes Mock simulation processing and performance test processing. Mock simulation processing refers to a test method that uses a virtual object to create some objects that are not easy to construct or obtain for testing during the test process. The virtual object is the Mock object, and the Mock object is a substitute for the real object during debugging. Performance test processing can be completed through perfdog testing method or performance point collection method. The target module refers to the module in the target application program code that has changed. Usually each application includes at least two modules, and the modules in the target application include the target module. Performance share data refers to the performance occupancy data of each module in the application during operation, which can include memory occupancy data, processor occupancy data, etc.
[0035] Generally, when the terminal detects that the program code corresponding to the target application has changed, it will further determine the module in the target application where the program code has changed based on the location where the target application code has changed, and use the module with the changed program code as the target module. There may be one or more modules in the target application where the program code has changed.
[0036] Optionally, if the terminal detects that only one module in the target application has a change in the program code, the module can be directly determined as the target module, and a mock simulation test can be performed on the target application based on the target module to obtain the performance share data corresponding to the target module.
[0037] Optionally, if the terminal simultaneously detects that the program codes corresponding to multiple modules in the target application have changed, the modules with program code changes can be taken as target modules in sequence according to a preset priority order (such as: the time order of program code changes in the modules, or the order of importance of the modules during operation, or the order of names corresponding to the modules, etc.), and the target application can be subjected to mock simulation testing in sequence based on the target modules to obtain the performance share data corresponding to each target module.
[0038] For example: Application A, Application B and Application C are installed on the terminal. When the user chooses to perform a performance test on Application A on the terminal, Application A is the target application. The program code corresponding to Application A can be divided into Module A, Module B and Module C. After the terminal recognizes the start test operation performed by the user, it starts to monitor whether the program code corresponding to Application A has changed. When the program code corresponding to Application A is monitored to change, it is determined that the modules in Application A that have program code changes are Module A and Module B. Then, according to the time sequence of the program code changes of Module A and Module B, the priority order of Module A is higher than the priority order of Module B. Then, according to the priority order result, Module A and Module B are taken as target modules in turn, and Mock simulation test processing is performed on the target application in turn based on the target module. When performing a performance test on Module A, the working conditions of Module B and Module C are simulated by the Mock simulation method to cooperate with Module A to work normally. When performing a performance test on Module B, the working conditions of Module A and Module C are simulated by the Mock simulation method to cooperate with Module B to work normally. Then, the performance proportion data corresponding to Module A and Module B are measured respectively by using relevant performance test methods.
[0039] S103, analyzing the performance ratio data to obtain the performance test result of the target module.
[0040] Among them, the performance test result refers to the test result generated according to the performance share data corresponding to the target module measured by the terminal, which can intuitively display the performance occupancy corresponding to the target module in the target application.
[0041] Generally, since there may be one or more target modules in the target application program in which the code has changed, the performance occupancy of different target modules during operation will be different. After the terminal measures the performance share data corresponding to the target module in which the code has changed in the target application program, the obtained performance share data can be analyzed and summarized to obtain the performance test result. The performance test result can be obtained by comparing the performance share data corresponding to the target module with the standard performance data corresponding to the target application program (the performance test result includes an indication of whether it meets the performance share standard), such as: when the performance share value corresponding to the performance share data corresponding to the target module is less than the performance share value corresponding to the standard performance data, it can be determined that the performance test result meets the performance share standard; when the performance share value corresponding to the performance share data corresponding to the target module is greater than or equal to the performance share value corresponding to the standard performance data, it can be determined that the performance test result does not meet the performance share standard. The performance test result can intuitively display the performance occupancy of the target module in the target application program during operation through the display unit of the terminal, as well as whether the target module meets the performance share standard, so that the user can distinguish the performance share data corresponding to the modules in the target application program.
[0042] For example: when the terminal detects that the program codes corresponding to modules A and B in the target application have changed, after prioritizing modules A and B, the target module for each performance test is determined, and after the target application is subjected to Mock simulation test based on the target module, the performance share data corresponding to the target module is further measured: the performance share data of module A is 20% of memory usage and 30% of processor usage, and the performance share data of module B is 15% of memory usage and 20% of processor usage. The terminal will further analyze and summarize the obtained performance share data to obtain the performance test results, which are the performance occupancy data obtained by the terminal after analyzing and summarizing the performance share data corresponding to module A and the performance share data corresponding to module B, which can be viewed intuitively by the user.
[0043] When the scheme of the embodiment of the present application is executed, the terminal monitors whether the program code corresponding to the target application has changed. When the program code corresponding to the target application has changed, the target application is subjected to Mock simulation test processing to obtain the performance share data corresponding to the target module, and the performance share data is analyzed to obtain the performance test result of the target module. The working status of other modules in the same running process as the target module (that is, other modules except the target module in the target application) is simulated through the Mock test processing method, so as to accurately distinguish the performance data generated by the target module in the running process, and thus accurately distinguish the performance data generated by the target module in the running process of the target application, thereby effectively improving the efficiency and accuracy of performance testing.
[0044] See also Figure 2 , which is a flow chart of a performance testing method provided in an embodiment of the present application. This embodiment is illustrated by applying the performance testing method in a terminal. The performance testing method may include the following steps:
[0045] S201, in response to a user performing a start test operation on an application in an electronic device, generating a test instruction corresponding to the start test operation.
[0046] Among them, the start test operation refers to the operation in which the user controls the terminal through touch, voice or third-party tools to start performance testing of the application in the terminal (electronic device), and the test instruction is a control instruction generated by the terminal according to the start test operation for starting the performance test task.
[0047] Generally, the user can control whether the terminal performs performance testing. The user can control the terminal to start the performance testing task based on the test instructions generated by the start test operation by executing the start test operation on the terminal. After the terminal starts the performance testing task, the program code changes corresponding to each application installed on the terminal can be monitored based on a preset time interval. If the terminal detects an application with a program code change, the application is used as the target application to preliminarily determine the target that needs to be tested for performance.
[0048] S202, monitoring whether a program code corresponding to a target application program has changed based on the test instruction execution.
[0049] For details, please refer to step S101, which will not be described in detail here.
[0050] S203: When the program code corresponding to the target application program has content changes, determine at least two modules to be tested corresponding to the changed program code in the target application program.
[0051] The module to be tested refers to the module corresponding to the changed program code in the target application. The target application will have at least two modules involved in the work during the working process. The program code change can be one module or multiple modules in the target application. The modules to be tested are all modules that need to be performance tested. When the module to be tested is determined to be the target module for performance testing, the performance test is performed on the module to be tested.
[0052] Generally, when the terminal detects that the program code corresponding to the target application has changed, it is necessary to further determine the specific module in the target application where the program code has changed. When the terminal detects that the program code corresponding to multiple modules in the target application has changed, the multiple modules monitored are multiple modules to be tested. Further, according to the preset priority order (such as: the time order of the module program code changes, or the order of the importance of the modules during operation, or the order of the names corresponding to the modules, etc.), the multiple modules to be tested are taken as target modules in turn, and the target application is subjected to Mock simulation test processing in turn based on the target module to obtain the performance share data corresponding to each target module.
[0053] S204: Prioritize at least two modules to be tested.
[0054] Priority sorting refers to sorting the order of testing at least two modules to be tested according to preset rules, and the module to be tested with a higher priority is preferentially used as the target module for subsequent performance testing. The priority sorting of at least two modules to be tested can be performed according to the time sequence of program code changes in each module to be tested, the order of importance of each module to be tested during operation, or the order of names corresponding to each module to be tested.
[0055] S205 , selecting one module to be tested from at least two modules to be tested as a target module in order of priority.
[0056] The target module refers to the module in the target application whose program code has changed, and is also the module to be tested as the performance test object in each performance test. Usually, each application includes at least two modules, and the modules in the target application include the target module.
[0057] Generally, after prioritizing at least two modules to be tested, one module to be tested can be selected in turn as the target module for subsequent performance testing based on the order of arrangement from high to low priority or low to high priority. After completing the performance test of one module to be tested, another module to be tested can be selected for performance testing in the order of priority sorting until the performance test of at least two modules to be tested is completed.
[0058] S206, performing mock processing on the modules other than the target module among the at least two modules called by the target application, and performing performance testing on the target module to obtain performance share data.
[0059] Among them, Mock processing is also called Mock simulation processing. Mock processing refers to a test method that uses a virtual object to create some objects that are not easy to construct or obtain during the test process for the purpose of testing. The virtual object is the Mock object, which is a substitute for the real object during debugging. Performance testing can be completed through the perfdog test method or the performance point collection method. Performance share data refers to the performance occupancy data of the target module in the application during operation, which can include memory occupancy data and processor occupancy data generated by the target module during the working process.
[0060] Generally, after determining the target module, the terminal can simulate other modules in the target application through Mock processing, simulating the normal working status of other modules in the target application, so as to accurately distinguish the performance occupancy of the target module during the working process. After performing Mock processing on other modules except the target module in at least two modules called by the target application, the performance share data of the target module during the working process can be measured through the perfdog test method or the performance point collection method.
[0061] For example: See Figure 3 The schematic diagram of the Mock simulation processing shown. The target application is the teaching application 30 in the terminal, and the program code corresponding to the teaching application 30 is divided into an online classroom module 31, a courseware playback module 32, and an audio and video playback module 33. When it is determined that the program code change occurs in the online classroom module 31, the online classroom module 31 can be determined as the target module, and the terminal can perform a Mock simulation processing 34 (execute the Mock courseware playback module and the audio and video playback module processing 35) on the courseware playback module 32 and the audio and video playback module 33 in the teaching application 30 based on the target module, that is, respectively Mock the working state of the courseware playback module 32 and the audio and video playback module 33 under normal working conditions, so as to cooperate with the online classroom module 31 to work normally. When the terminal executes the Mock courseware playback module and the audio and video playback module processing 35, it directly simulates and returns the processing results of the courseware playback module 32 and the audio and video playback module 33 under normal working conditions, thereby realizing that in the Mock simulation processing process, the performance occupation of the courseware playback module 32 and the audio and video playback module 33 can be ignored.
[0062] S207, obtaining standard performance data corresponding to the target application.
[0063] The standard performance data refers to the performance percentage data that each module in the target application meets under normal working conditions. Based on the standard performance data, it can be determined whether the performance percentage data corresponding to the target module meets the requirements. The standard performance data varies according to different target applications.
[0064] S208, when the performance proportion value corresponding to the performance proportion data is less than the performance proportion value corresponding to the standard performance data, it is determined that the performance test result meets the performance proportion standard; or when the performance proportion value corresponding to the performance proportion data is greater than or equal to the performance proportion value corresponding to the standard performance data, it is determined that the performance test result does not meet the performance proportion standard.
[0065] Among them, the performance share value refers to the value used to indicate the performance occupancy of the module. The performance share data may include the memory share value and the processor share value of the module during operation. Correspondingly, the standard performance data may also include the memory share value and the processor share value that the module needs to meet the standard during operation. The performance test result refers to the test result generated according to the performance share data corresponding to the target module measured by the terminal, which can intuitively display the performance occupancy of the target module in the target application, and whether the target module meets the performance share standard. The performance share standard refers to the unified regulations on performance occupancy that the module needs to meet during operation. The module that meets the performance share standard is the module that meets the debugging standard, that is, the module that meets the standard requirements.
[0066] Generally, different target applications correspond to different standard performance data, and the standard performance data of the target application can be preset by the user. The performance test results can be obtained by comparing the performance ratio data corresponding to the target module with the standard performance data corresponding to the target application, and the performance test results include indication information of whether the performance ratio standard is met. When it is determined that the performance test results meet the performance ratio standard, the terminal will generate indication information showing that the performance ratio standard is met based on the performance test results; similarly, when it is determined that the performance test results do not meet the performance ratio standard, the terminal will generate indication information showing that the performance ratio standard is not met based on the performance test results.
[0067] S209: Generate a reminder message based on the performance test result.
[0068] The reminder message refers to the indication information used to remind the user whether the performance test result meets the requirements. The user can view the intuitive result of this performance test according to the reminder message.
[0069] Generally, after obtaining the performance test result, the terminal may further summarize and analyze the performance test result, and generate a reminder message that can be used to remind the user of the performance test result, so that the user can intuitively understand the performance test result.
[0070] For example: See Figure 4The display interface effect diagram of the terminal, the terminal obtains the performance test result 41 of the target module (module A) in the target application: the performance share data of module A is 20% memory occupancy and 30% processor occupancy, and the terminal can know through query that the performance share standard of module A is 10% memory occupancy and 20% processor occupancy, that is, the performance test result of module A does not meet the performance share standard, so the terminal can generate a reminder message 42 of "module A performance test failed" based on the performance test result, and display the reminder message 42 through the display unit 40 of the terminal, and the performance test result 41 can also be displayed through the display unit 40 to remind the user of the result of this performance test.
[0071] S210, displaying a reminder message via a display unit.
[0072] Generally, the terminal can display the reminder message generated based on the performance test results through the display unit. When the terminal completes the performance test of the target module, the user can view the reminder message displayed on the terminal display unit, and intuitively understand the results of this performance test, providing the user with a specific reference for subsequent debugging of the target application or target module.
[0073] When the scheme of the embodiment of the present application is executed, the terminal generates a test instruction corresponding to the start-test operation in response to the user's start-test operation performed on the application in the electronic device, monitors whether the program code corresponding to the target application has changed based on the test instruction, monitors whether the program code corresponding to the target application has changed, and in the case that the content of the program code corresponding to the target application has changed, determines at least two modules to be tested corresponding to the changed program code in the target application, prioritizes the at least two modules to be tested, selects one module to be tested from the at least two modules to be tested as the target module according to the priority ranking, performs mock processing on the modules other than the target module in the at least two modules called by the target application, performs performance testing on the target module to obtain performance share data, and obtains the target application program code. When the performance ratio value corresponding to the performance ratio data is less than the performance ratio value corresponding to the standard performance data, it is determined that the performance test result meets the performance ratio standard; or when the performance ratio value corresponding to the performance ratio data is greater than or equal to the performance ratio value corresponding to the standard performance data, it is determined that the performance test result does not meet the performance ratio standard, and a reminder message is generated based on the performance test result, and the reminder message is displayed through the display unit. The working status of other modules in the same running process as the target module (that is, other modules except the target module in the target application program) are simulated through the Mock test processing method, so as to accurately distinguish the performance data generated by the target module in the running process of the target application program, thereby improving the efficiency and accuracy of the performance test, and intuitively displaying the performance test results to the user, thereby improving the user's testing experience.
[0074] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.
[0075] See also Figure 5 , which shows a schematic diagram of the structure of a performance test device provided by an exemplary embodiment of the present application. Hereinafter referred to as device 5, device 5 can be implemented as all or part of the terminal through software, hardware or a combination of both. Device 5 includes a first monitoring module 501, a first processing module 502 and an analysis module 503.
[0076] A first monitoring module 501 is used to monitor whether a program code corresponding to a target application program has changed; wherein the at least one application program includes the target application program;
[0077] A first processing module 502 is used to perform a mock test on the target application to obtain performance share data corresponding to a target module when a program code corresponding to the target application changes; wherein the at least two modules include the target module;
[0078] The analysis module 503 is used to analyze the performance ratio data to obtain the performance test result of the target module.
[0079] Optionally, the first processing module 502 includes:
[0080] A first determining unit is used to determine, when a program code corresponding to the target application program changes, that a module corresponding to the changed program code in the target application program is the target module;
[0081] The first processing unit is used to perform Mock processing on the other modules of the at least two modules called by the target application except the target module, and perform performance testing on the target module to obtain the performance share data.
[0082] Optionally, the first determining unit includes:
[0083] A first determining subunit is used to determine at least two modules to be tested corresponding to the changed program code in the target application when the program code corresponding to the target application changes in content;
[0084] A sorting subunit, used for sorting the priorities of the at least two modules to be tested;
[0085] The selection subunit is used to select one module to be tested from the at least two modules to be tested as the target module in sequence according to the priority ranking.
[0086] Optionally, the device 5 further comprises:
[0087] A second processing module, configured to generate a test instruction corresponding to a start-test operation performed by a user on an application in the electronic device;
[0088] The second monitoring module is used to monitor whether the program code corresponding to the target application program has changed based on the test instruction.
[0089] Optionally, the analysis module 503 includes:
[0090] An acquisition unit, used for acquiring standard performance data corresponding to the target application;
[0091] The analysis unit is used to compare and analyze the performance ratio data with the standard performance data to obtain the performance test result.
[0092] Optionally, the analysis unit comprises:
[0093] A second determining subunit is used to determine that the performance test result meets the performance proportion standard when the performance proportion value corresponding to the performance proportion data is less than the performance proportion value corresponding to the standard performance data; or
[0094] The third determination subunit is used to determine that the performance test result does not meet the performance proportion standard when the performance proportion value corresponding to the performance proportion data is greater than or equal to the performance proportion value corresponding to the standard performance data.
[0095] Optionally, the device 5 further comprises:
[0096] A third processing module, configured to generate a reminder message based on the performance test result;
[0097] The display module is used to display the reminder message through a display unit.
[0098] It should be noted that, when the device 5 provided in the above embodiment executes the performance test method, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the performance test method embodiments provided in the above embodiment belong to the same concept, and the implementation process thereof is detailed in the method embodiment, which will not be repeated here.
[0099] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0100] The present application also provides a computer storage medium, which can store multiple instructions, and the instructions are suitable for being loaded and executed by a processor as described above. Figure 2-3 The method steps of the embodiment shown in the figure can be found in the specific implementation process. Figure 2-3 The specific description of the illustrated embodiment will not be repeated here.
[0101] The present application also provides a computer program product, which stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the performance testing method described in the above embodiments.
[0102] Figure 6 The following is a schematic diagram of a performance test device structure provided in an embodiment of the present application, hereinafter referred to as device 6, which can be integrated into the aforementioned terminal device. Figure 6 As shown, the device includes: a memory 602, a processor 601, an input device 603, an output device 604 and a communication interface.
[0103] The memory 602 may be an independent physical unit, and may be connected to the processor 601, the input device 603, and the output device 604 via a bus. The memory 602, the processor 601, the input device 603, and the output device 604 may also be integrated together and implemented by hardware.
[0104] The memory 602 is used to store programs for implementing the above method embodiments or various modules of the device embodiments, and the processor 601 calls the program to execute the operations of the above method embodiments.
[0105] The input device 602 includes but is not limited to a keyboard, a mouse, a touch panel, a camera and a microphone; the output device includes but is not limited to a display screen.
[0106] The communication interface is used to send and receive various types of messages, and the communication interface includes but is not limited to a wireless interface or a wired interface.
[0107] Optionally, when part or all of the performance test method of the above embodiment is implemented by software, the device may also include only a processor. The memory for storing the program is located outside the device, and the processor is connected to the memory through a circuit / wire to read and execute the program stored in the memory.
[0108] The processor may be a central processing unit (CPU), a network processor (NP), or a combination of a CPU and a NP.
[0109] The processor may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD) or a combination thereof. The PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof.
[0110] The memory may include volatile memory, such as random-access memory (RAM); the memory may also include non-volatile memory, such as flash memory, hard disk drive (HDD) or solid-state drive (SSD); the memory may also include a combination of the above types of memory.
[0111] The processor 601 calls the program code in the memory 602 to perform the following steps:
[0112] Monitoring whether a program code corresponding to a target application program has changed; wherein the at least one application program includes the target application program;
[0113] In the case where the program code corresponding to the target application program changes, a Mock simulation test process is performed on the target application program to obtain performance share data corresponding to the target module; wherein the at least two modules include the target module;
[0114] The performance ratio data is analyzed to obtain the performance test result of the target module.
[0115] In one or more embodiments, when the processor 601 performs a Mock simulation test process on the target application to obtain performance share data corresponding to the target module when the program code corresponding to the target application changes, it is specifically used to execute:
[0116] In the case where the program code corresponding to the target application program changes, determining the module corresponding to the changed program code in the target application program as the target module;
[0117] Mock processing is performed on the modules other than the target module among the at least two modules called by the target application, and performance testing is performed on the target module to obtain the performance share data.
[0118] In one or more embodiments, when the program code corresponding to the target application program changes, the processor 601 determines that the running module in which the program code in the target application program changes is the target module, specifically performs:
[0119] In the case where the program code corresponding to the target application program changes in content, determining at least two modules to be tested corresponding to the changed program code in the target application program;
[0120] Prioritizing the at least two modules to be tested;
[0121] A module to be tested is selected from the at least two modules to be tested in sequence according to the priority ranking as the target module.
[0122] In one or more embodiments, before the processor 601 monitors whether the program code corresponding to the target application program has changed, it is specifically configured to execute:
[0123] In response to a user performing a start-test operation on an application in the electronic device, generating a test instruction corresponding to the start-test operation;
[0124] The monitoring target application program corresponding to the program code is executed based on the test instruction to determine whether the program code changes.
[0125] In one or more embodiments, when the processor 601 analyzes the performance proportion data to obtain the performance test result of the target module, it is specifically used to execute:
[0126] Obtaining standard performance data corresponding to the target application;
[0127] The performance ratio data is compared and analyzed with the standard performance data to obtain the performance test result.
[0128] In one or more embodiments, when the processor 601 compares and analyzes the performance ratio data with the standard performance data to obtain the performance test result, it is specifically used to perform:
[0129] When the performance ratio value corresponding to the performance ratio data is less than the performance ratio value corresponding to the standard performance data, determining that the performance test result meets the performance ratio standard; or
[0130] When the performance proportion value corresponding to the performance proportion data is greater than or equal to the performance proportion value corresponding to the standard performance data, it is determined that the performance test result does not meet the performance proportion standard.
[0131] In one or more embodiments, after the processor 601 analyzes the performance ratio data to obtain the target module performance test result, it is specifically configured to execute:
[0132] generating a reminder message based on the performance test result;
[0133] The reminder message is displayed through a display unit.
[0134] An embodiment of the present application also provides a computer storage medium storing a computer program, which is used to execute the performance testing method provided in the above embodiment.
[0135] An embodiment of the present application also provides a computer program product including instructions, which, when executed on a computer, enables the computer to execute the performance testing method provided in the above embodiment.
[0136] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0137] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0138] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
Claims
1. A performance testing method, the performance testing method is applied to an electronic device, the electronic device has at least one application installed in it, the program code of each application corresponds to at least two modules, characterized in that: The method comprises: Monitoring whether a program code corresponding to a target application program has changed; wherein the at least one application program includes the target application program; In the case where the program code corresponding to the target application program changes, a Mock simulation test process is performed on the target application program to obtain performance share data corresponding to the target module; wherein the at least two modules include the target module; and the Mock simulation test process includes Mock simulation processing and performance testing; Analyze the performance ratio data to obtain the performance test result of the target module; The Mock simulation test process of the target application to obtain the performance share data corresponding to the target module includes: In the case where the program code corresponding to the target application program changes, determining the module corresponding to the changed program code in the target application program as the target module; Mock processing is performed on the modules other than the target module among the at least two modules called by the target application, and performance testing is performed on the target module to obtain the performance share data.
2. The method according to claim 1, characterized in that When the program code corresponding to the target application program changes, determining the running module in which the program code of the target application program changes as the target module includes: In the case where the program code corresponding to the target application program changes in content, determining at least two modules to be tested corresponding to the changed program code in the target application program; Prioritizing the at least two modules to be tested; A module to be tested is selected from the at least two modules to be tested in sequence according to the priority ranking as the target module.
3. The method according to claim 1, characterized in that: Before monitoring whether the program code corresponding to the target application program has changed, the method further includes: In response to a user performing a start-test operation on an application in the electronic device, generating a test instruction corresponding to the start-test operation; The monitoring target application program corresponding to the program code is executed based on the test instruction to determine whether the program code changes.
4. The method according to claim 1, characterized in that The analyzing the performance ratio data to obtain the performance test result of the target module includes: Obtaining standard performance data corresponding to the target application; The performance ratio data is compared and analyzed with the standard performance data to obtain the performance test result.
5. The method according to claim 4, characterized in that The comparing and analyzing the performance proportion data with the standard performance data to obtain the performance test result includes: When the performance ratio value corresponding to the performance ratio data is less than the performance ratio value corresponding to the standard performance data, determining that the performance test result meets the performance ratio standard; or When the performance proportion value corresponding to the performance proportion data is greater than or equal to the performance proportion value corresponding to the standard performance data, it is determined that the performance test result does not meet the performance proportion standard.
6. The method according to claim 1, characterized in that After analyzing the performance proportion data to obtain the target module performance test result, the method further includes: generating a reminder message based on the performance test result; The reminder message is displayed through a display unit.
7. A performance testing device, the performance testing device is applied to an electronic device, the electronic device has at least one application installed in it, the program code of each application corresponds to at least two modules, characterized in that: The device comprises: A monitoring module, used to monitor whether a program code corresponding to a target application program has changed; wherein the at least one application program includes the target application program; A processing module, used for performing a Mock simulation test process on the target application to obtain performance share data corresponding to the target module when the program code corresponding to the target application changes; wherein the at least two modules include the target module; the Mock simulation test process includes Mock simulation process and performance test; An analysis module, used for analyzing the performance ratio data to obtain the performance test result of the target module; The analysis module is specifically used to: when the program code corresponding to the target application program changes, determine that the module corresponding to the changed program code in the target application program is the target module; Mock processing is performed on the modules other than the target module among the at least two modules called by the target application, and performance testing is performed on the target module to obtain the performance share data.
8. A computer storage medium, characterized in that: The computer storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor and executing the method steps as claimed in any one of claims 1 to 6.
9. A terminal, characterized in that: include: A processor, a memory, and a display screen; wherein the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the method steps as claimed in any one of claims 1 to 6.
