Software testing optimization prediction method, device, electronic device and storage medium
By receiving the execution commands from the control terminal, performance analysis and correction are performed based on the software running status parameters, the data storage limitations of the software test system for multiple operating programs are solved, and the accuracy and comprehensiveness of software performance evaluation are achieved. , improves the smoothness and stability of the software.
Patent Information
- Application Number
- CN202411206643.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2044-08-30
AI Technical Summary
Due to the limitations of data storage, existing software testing systems are difficult to conduct comprehensive and accurate optimization tests on the synchronous operation scenarios of multiple running programs, resulting in poor software operation and fluctuations in stability.
By receiving execution commands from the control terminal, perform performance analysis and correction based on the operating status parameters of the software running program, evaluate the comprehensive performance of the software, and optimize prediction based on this to ensure the accuracy and comprehensiveness of the test results.
It realizes optimization tests of the synchronous runtime of multiple running programs in the software, ensuring the accuracy and stability of the software's performance evaluation, and thus improving the smoothness and stability of the software's operation.
Smart Images

Figure CN118733474B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of software testing, and in particular to an optimization prediction method, device, electronic equipment and storage medium for software testing. Background Art
[0002] Software testing is an important part of software engineering, and its main purpose is to discover possible defects and problems in the software. Software testing usually includes a variety of methods, such as black box testing, white box testing, static testing, dynamic testing, etc. Through these testing methods, the software's functions, performance, compatibility, security, etc. can be evaluated and verified to ensure the quality and reliability of the software.
[0003] At present, the existing software testing method is mainly implemented by a software testing system, which includes an auxiliary program and a host application. The host application includes a dynamic loading unit, which is injected when the host application is started. The auxiliary program is used to receive the task data sent by the software testing platform, generate task instructions based on the task data, and send the task instructions to the dynamic loading unit in the host application. The dynamic loading unit is used to receive the task instructions and generate application parameters for indicating the operation of the host application based on the task instructions. The host application is used to run based on the application parameters and send operation data to the auxiliary program. The auxiliary program is also used to receive the operation data sent by the host application and send the operation data to the software testing platform. The test data and test files used by the software testing system in the software testing process need to be obtained through the application server, but due to the limitations of the application server data storage, there is a situation where the application server does not contain the required test data and test files, which makes it difficult for the system to perform a more comprehensive verification of the application software.
[0004] In addition, the current software functions are diversified, resulting in a large number of running programs loaded into the software. Most of these running programs can run synchronously, but the synchronous running of multiple running programs in the software may cause problems such as unsmooth running of the software and fluctuations in stability. In this regard, due to the limitations of data storage, the existing software testing system has low comprehensiveness and accuracy in optimizing the software for the scenario of synchronous running of multiple running programs in the software. Summary of the invention
[0005] Based on this, it is necessary to provide an optimization prediction method, device, electronic device and storage medium for software testing that can ensure the comprehensiveness and accuracy of software optimization testing when multiple running programs in the software are running synchronously to address the above technical problems.
[0006] The present invention provides a software testing optimization prediction method, the method comprising:
[0007] Receiving an execution command from the control terminal, and in response to the execution command, driving the software program to run according to the set driving logic to obtain the running state parameters of the software running program;
[0008] Performing performance analysis on the running software according to the running status parameters of the software running program to obtain software performance analysis results, and correcting the software performance analysis results;
[0009] Based on the corrected software performance analysis result, the comprehensive performance of the running software is evaluated to obtain an evaluation result, and optimization prediction is performed on the running software according to the evaluation result;
[0010] Among them, the running status parameters include the memory usage and response time of the software running program loading phase, the memory usage and response time of the initialization phase, the memory usage and response time of the execution phase, the memory usage and response time of the interaction phase, and the memory usage and response time of the end phase of the operation. The software performance analysis result is the software performance value. The lower the software performance value, the better the performance of the running software. The evaluation result is the mean between the software performance value and the corrected software performance value.
[0011] In one embodiment, the receiving of the execution command from the control terminal and driving the software program to run according to the set driving logic in response to the execution command to obtain the running state parameters of the software running program include:
[0012] Acquire the driving logic of the set driving software program, and collect the memory usage and response time of the software program at different stages to obtain the running state parameters;
[0013] Obtaining the weight of each software running program set by the running software, and arranging the software running programs in descending order based on the weight corresponding to each software running program to obtain an arrangement result;
[0014] Determine the software running program with the largest weight as a test reference target based on the arrangement result, and use other software running programs except the software running program with the largest weight as test verification targets;
[0015] The different stages include a loading stage, an initialization stage, an interaction stage, and an end-of-run stage, and the weight of each software running program is proportional to the memory usage and usage frequency of the corresponding software running program during its execution stage.
[0016] In one embodiment, the weights of the various software running programs correspond to the following formula:
[0017] ;
[0018] In the formula, f is the weight of the software running program, which is used to represent the importance of the software running program, G IN The software runs the program and loads it to occupy memory. S is the running memory consumed by the software running the program, P is the score of the source software of the software running the program, q(sim) is the number of the same type of software containing the same functional program, m is the set of all programs in the software, G j For the j The software running program loads and occupies memory. m-1 means it does not include G IN A collection of all programs in the software.
[0019] In one embodiment, the receiving of the execution command from the control terminal and driving the software program to run according to the set driving logic in response to the execution command to obtain the running state parameters of the software running program also includes:
[0020] Acquire multiple groups of operating status parameters corresponding to the test reference target by using the operating status parameters of the test reference target when the test reference target is run alone, and selecting any one of the test verification targets to run together with the test reference target;
[0021] Wherein, when the test verification target and the test reference target are run together, there are two groups of test verification targets involved in a single run.
[0022] In one embodiment, the performing performance analysis on the running software according to the running status parameters of the software running program to obtain the software performance analysis result, and correcting the software performance analysis result includes:
[0023] Calculate the software performance value according to the running stage of the software running program, the memory usage and response time when the software running program corresponding to the test verification target and the software running program corresponding to the test reference target are running together, and the memory usage and response time when the software running program corresponding to the test reference target is running alone;
[0024] The calculation formula of the software running performance value is:
[0025] ;
[0026] In the formula, K is the software performance value, n The running phase of the software is the running phase of the program. M i When the software running program corresponding to the test verification target and the software running program corresponding to the test reference target are run together, the software running program corresponding to the test reference target is iMemory usage of the stage run, m i When the software running program corresponding to the test reference target is run separately i Memory usage of the stage run, T i When the software running program corresponding to the test verification target and the software running program corresponding to the test reference target are run together, the software running program corresponding to the test reference target is i The response time of the phase operation, t i When the software running program corresponding to the test reference target is run separately i The response time of the phase run.
[0027] In one embodiment, the performing performance analysis on the running software according to the running status parameters of the software running program to obtain the software performance analysis result and correcting the software performance analysis result also includes:
[0028] Based on the software performance analysis results, obtaining a software running program corresponding to a test verification target that runs together with a software running program corresponding to the test reference target and corresponds to a set of software performance analysis results with the smallest software performance value, so as to correct the software performance analysis results with the smallest software performance value;
[0029] The correction formula of the software performance analysis result is:
[0030] ;
[0031] Where K' is the corrected software performance analysis result, K min is the software performance analysis result with the minimum software performance value. The software running program corresponding to the test reference target and the software running program corresponding to the test verification target , A is a software running program corresponding to the test reference target and a software running program corresponding to the test verification target. d Arrange the unit distance in the queue in descending order of software running program weight, is the normalization factor, and >0.
[0032] In one embodiment, the comprehensive performance of the running software is evaluated based on the corrected software performance analysis result to obtain an evaluation result, and optimization prediction of the running software is performed according to the evaluation result, including:
[0033] Real-time monitoring of whether software performance analysis results corresponding to a plurality of software running programs ranked not less than a first threshold in a queue in which each software running program in the running software is arranged in descending order according to weights are corrected;
[0034] After the software performance analysis results corresponding to the multiple software running programs ranked not lower than the first threshold in the queue arranged in descending order according to weight are corrected, the average value between the software performance values corresponding to the corrected multiple software performance analysis results is calculated to obtain the evaluation result.
[0035] The present invention also provides a software testing optimization prediction device, the device comprising:
[0036] A program driving module, used to receive an execution command from the control terminal, and drive the software program to run according to a set driving logic in response to the execution command, so as to obtain the running state parameters of the software running program;
[0037] A performance analysis and correction module, used to perform performance analysis on the running software according to the running status parameters of the software running program, obtain software performance analysis results, and correct the software performance analysis results;
[0038] An evaluation and optimization module, used to evaluate the comprehensive performance of the running software based on the corrected software performance analysis result, obtain an evaluation result, and perform optimization prediction on the running software according to the evaluation result;
[0039] Among them, the running status parameters include the memory usage and response time of the software running program loading phase, the memory usage and response time of the initialization phase, the memory usage and response time of the execution phase, the memory usage and response time of the interaction phase, and the memory usage and response time of the end phase of the operation. The software performance analysis result is the software performance value. The lower the software performance value, the better the performance of the running software. The evaluation result is the mean between the software performance value and the corrected software performance value.
[0040] The present invention also provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements any one of the above-described optimization prediction methods for software testing when executing the computer program.
[0041] The present invention also provides a computer storage medium storing a computer program, wherein when the computer program is executed by a processor, the optimization prediction method for software testing as described in any one of the above is implemented.
[0042] The above-mentioned software test optimization prediction method, device, electronic device and storage medium receive an execution command from a control terminal, and respond to the execution command to drive the software program to run according to the set driving logic to obtain the running state parameters of the software running program. Subsequently, the running software is analyzed for performance according to the running state parameters of the software running program to obtain the corresponding software performance analysis results, and the software performance analysis results are corrected. Finally, the comprehensive performance of the running software is evaluated based on the corrected software performance analysis results to obtain the evaluation results, and the running software is optimized and predicted according to the evaluation results. The method collects the state parameters of the program running in the software by controlling the linkage operation of each program in the software, so as to make an evaluation prediction of the performance of the software based on the comparison analysis of the program running state parameters in the software. In addition, in the linkage operation stage of each program in the control software, the program in the software is controlled and operated with the specified logic, so that the program running state parameters in the software applied in the final analysis stage of the system can truly reflect the actual performance of the software, ensure the accuracy and comprehensiveness of the software test results, and then further optimize and improve the software according to the output results. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0044] Figure 1 This is one of the flow charts of the optimization prediction method for software testing provided by the present invention;
[0045] Figure 2 A schematic diagram of the structure of an optimization prediction system for software testing of an optimization prediction method for software testing in a specific embodiment provided by the present invention;
[0046] Figure 3 The second flowchart of the optimization prediction method for software testing provided by the present invention;
[0047] Figure 4 The third flowchart of the optimization prediction method for software testing provided by the present invention;
[0048] Figure 5 The fourth flowchart of the optimization prediction method for software testing provided by the present invention;
[0049] Figure 6 A schematic diagram of the structure of the optimization prediction device for software testing provided by the present invention;
[0050] Figure 7This is a diagram of the internal structure of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0051] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0052] Combine the following Figures 1 to 7 The invention describes the optimization prediction method, device, electronic device and storage medium for software testing.
[0053] like Figure 1 As shown, in one embodiment, a method for optimizing prediction of software testing includes the following steps:
[0054] Step S110, receiving an execution command from the control terminal, and driving the software program to run according to the set driving logic in response to the execution command to obtain the running status parameters of the software running program.
[0055] Among them, the running status parameters include the memory usage and response time of the software running program loading phase, the memory usage and response time of the initialization phase, the memory usage and response time of the execution phase, the memory usage and response time of the interaction phase, and the memory usage and response time of the running end phase.
[0056] Specifically, the software testing system receives an execution command from the control terminal, and drives the software program to run according to the set driving logic in response to the execution command, so as to obtain various operating parameters of the software program during operation, that is, operating status parameters.
[0057] Step S120, performing performance analysis on the running software according to the running status parameters of the software running program, obtaining software performance analysis results, and correcting the software performance analysis results.
[0058] The software performance analysis result is a software performance value. The lower the software performance value is, the better the performance of the running software is.
[0059] Specifically, the software testing system performs performance analysis on the running software according to the running status parameters of the software running program in the software obtained in step S110 to obtain software performance analysis results, and corrects the software performance analysis results to obtain corrected software performance analysis results.
[0060] Step S130, evaluating the comprehensive performance of the running software based on the corrected software performance analysis result to obtain an evaluation result, and optimizing the running software according to the evaluation result.
[0061] The evaluation result is the average of the software performance value and the corrected software performance value.
[0062] Specifically, the software testing system evaluates the comprehensive performance of the running software based on the corrected software performance analysis result obtained in step S120 to obtain an evaluation result, and performs optimization prediction on the running software according to the evaluation result.
[0063] The above-mentioned optimization prediction method for software testing receives an execution command from a control terminal, and drives the software program to run according to the set driving logic in response to the execution command, so as to obtain the running state parameters of the software running program. Subsequently, the running software is analyzed for performance according to the running state parameters of the software running program, and the corresponding software performance analysis results are obtained, and the software performance analysis results are corrected. Finally, the comprehensive performance of the running software is evaluated based on the corrected software performance analysis results to obtain the evaluation results, and the running software is optimized and predicted according to the evaluation results. The method collects the state parameters of the program running in the software by controlling the linkage operation of each program in the software, so as to make an evaluation prediction of the performance of the software based on the comparison analysis of the program running state parameters in the software. In addition, in the linkage operation stage of each program in the control software, the program in the software is controlled and operated with the specified logic, so that the program running state parameters in the software applied in the final analysis stage of the system can truly reflect the actual performance of the software, ensure the accuracy and comprehensiveness of the software test results, and then further optimize and improve the software according to the output results.
[0064] See also Figure 2 As shown, in a specific embodiment, the optimization prediction method for software testing provided by the present invention is mainly implemented by an optimization prediction system for software testing, which includes a control terminal, a driver module, an analysis module, a correction module and its submodule capture unit, a jump module and an evaluation module. Among them, the control terminal is the main control end of the optimization prediction system for software testing, which is used to issue corresponding execution commands. The driver module is used to drive the corresponding program in the software to run in response to the execution command from the control terminal, and obtain the running state parameters of the software running program. The software contains several groups of running programs, and the driver module is provided with submodules at the lower level, including a logic unit and a collection unit, wherein the logic unit is used to set the driving logic when the driver module drives the software program to run. The collection unit is used to collect the state parameters of the software program when it runs.
[0065] In this embodiment, the driving module drives the software program to run based on the driving logic set in the logic unit, and the program running status parameters of the software collected in the collection unit include: memory usage and response time in the loading phase, memory usage and response time in the initialization phase, memory usage and response time in the execution phase, memory usage and response time in the interaction phase, and memory usage and response time in the ending phase.
[0066] In addition, the analysis module is used to receive the running status parameters of the software program, and analyze the software performance based on the running status parameters of the software program, and the analysis logic of the software performance in the analysis module is expressed as:
[0067] .
[0068] In the formula, K is the software performance value, n The running phase of the software is the running phase of the program. M i When the software running program corresponding to the test verification target is run together with the software running program corresponding to the test reference target, the software running program corresponding to the test reference target is i Memory usage of the stage run, m i When the software running program corresponding to the test reference target is run separately i Memory usage of the stage run, T i When the software running program corresponding to the test verification target is run together with the software running program corresponding to the test reference target, the software running program corresponding to the test reference target is i The response time of the phase operation, t i When the software running program corresponding to the test reference target is run separately i The response time of the phase run.
[0069] It should be noted that the smaller the software performance value K is, the better the software performance is, and vice versa, the worse the software performance is. Each selected test verification target is run together with the test reference target, and the running state parameters of the test reference target are obtained. After the software performance value K is obtained by the software performance analysis logic, the analysis module stores the software performance value K obtained by each group. For example, when the software performance is performing an analysis operation, the performance analysis operation is performed three times continuously on the same software, and the software performance values obtained by the three consecutive analyses are averaged, and the average value obtained is recorded as the final software performance value.
[0070] In this embodiment, the correction module is used to obtain the software performance analysis results in the analysis module, correct the software performance analysis results, and a submodule, namely a capture unit, is provided inside. The capture unit is used to capture a set of analysis results with the smallest software performance value analyzed in the analysis module. The capture unit feeds back the captured analysis results to the correction module. Based on the analysis results, the correction module determines the test verification target corresponding software program corresponding to the analysis results and runs together with the test reference target corresponding software program, and further corrects the software performance analysis results obtained by the correction module based on the determined test verification target corresponding software program. The jump module is used to execute the jump and restore to the driving module running stage. The evaluation module is used to receive further correction results of the software performance analysis results in the correction module, and evaluate the comprehensive performance of the software based on the correction results.
[0071] Among them, the correction logic of the software performance analysis results in the correction module is expressed as:
[0072] .
[0073] Where K' is the corrected software performance analysis result, K min is the software performance analysis result with the minimum software performance value. The software running program corresponding to the test reference target and the software running program corresponding to the test verification target , A is a software running program corresponding to the test reference target and a software running program corresponding to the test verification target. d Arrange the unit distance in the queue in descending order of software running program weight, is the normalization factor, and > 0. The smaller the corrected software performance analysis result K' is, the better the software performance is, and vice versa.
[0074] In this embodiment, the jump module runs to execute the jump, and after returning to the driving module running stage, the logic unit refreshes and runs, excluding the test reference target determined last time, and the driving logic is applied to determine the test reference target again, and the analysis module and the correction module are further run and processed until the software programs in the leading position of half of the programs in the descending order of importance of each program are processed by the correction module to obtain the correction result. The analysis module and the correction module are further run and processed until the software programs in the leading position of half of the programs in the descending order of importance of each program are processed by the correction module to obtain the correction result, and the target ratio is customized by the system end user, and the target ratio is initially defaulted to one-half.
[0075] The evaluation module runs in real time to monitor whether the software programs in the leading position of half of the programs in descending order of importance are all processed by the correction module and output the correction results. After the software programs in the leading position of half of the programs in descending order of importance are all processed by the correction module to obtain the correction results, the operation is triggered to execute the software performance evaluation operation. During the evaluation module operation phase, the correction result received is: the software performance analysis result K' of the software programs in the leading position of half of the programs in descending order of importance run by the jump module. The evaluation module evaluates the comprehensive performance of the software, that is, the operation of averaging all the received correction results.
[0076] In addition, when it is necessary to evaluate whether the software is qualified, a qualified judgment threshold can be set in the evaluation module, and the qualified judgment threshold can be compared with the averaged correction result to accurately determine whether the software is qualified.
[0077] It should be noted that the control terminal is interactively connected to the driving module through a wireless network, the driving module is interactively connected to the logic unit and the acquisition unit through a wireless network, the driving module is interactively connected to the analysis module through a wireless network, the analysis module is interactively connected to the acquisition unit through a wireless network, the analysis module is interactively connected to the correction module through a wireless network, the correction module is electrically connected to the capture unit through a medium, and the correction module is interactively connected to the jump module and the evaluation module through a wireless network.
[0078] In this embodiment, the control terminal controls the driving module to run the program of the driving software, obtains the running state parameters of the software running program, the logic unit synchronously sets the driving logic of the driving module when the driving software program is running, the acquisition unit collects the state parameters of the software program in real time, the analysis module post-operates to receive the running state parameters of the software program, analyzes the software performance based on the running state parameters of the software program, the correction module further obtains the software performance analysis results in the analysis module, corrects the software performance analysis results, the capture unit synchronizes the analysis module to analyze the software performance performance value of the smallest group of analysis results, and then the jump module executes the jump to restore to the driving module running stage, and finally receives the further correction results of the software performance analysis results in the correction module through the evaluation module, and evaluates the comprehensive performance of the software based on the correction results. By comprehensively testing the program running performance in the software, it is ensured that the problem of lack of robustness in software operation can be detected by the operation analysis of the system, and then the software is optimized and improved, ensuring the stable operation of the system test software.
[0079] In this embodiment, the driving logic set in the logic unit is expressed as:
[0080] Logic 1: Set the importance of each program included in the software, and sort the programs in descending order based on their importance.
[0081] Logic 2: Use the most important program as the test reference target and the remaining programs as the test verification targets.
[0082] Logic 3: Record the running status parameters of the test reference target when it runs alone, select the test verification target to run together with the test reference target, and obtain the running status parameters of the test reference target.
[0083] Among them, the importance (i.e., weight) of each program included in the software is based on the memory usage and usage frequency during the program execution phase. The larger the memory usage and the higher the usage frequency during the program execution phase, the higher the importance of the program, and vice versa. When the test verification target is selected to run together with the reference target, the number of test verification targets participating in a single run is two groups, and they are two random groups of test verification targets.
[0084] In this embodiment, the importance of each program included in the software complies with the following formula:
[0085] .
[0086] In the formula, f is the weight of the software running program, which is used to represent the importance of the software running program, G IN The software runs the program and loads it to occupy memory. S is the running memory consumed by the software running the program, P is the score of the source software of the software running the program, q(sim) is the number of the same type of software containing the same functional program, m is the set of all programs in the software, G j For the j The software running program loads and occupies memory. m-1 means it does not include G IN The collection of all programs in the software. The greater the importance of a program, the more important it is, and vice versa.
[0087] In summary, by controlling the linked operation of each program in the software, the state parameters of the program operation in the software are collected, so as to make an evaluation and prediction of the software performance based on the comparative analysis of the program operation state parameters in the software, and specify the driving logic to control the operation of representative programs in the software in the linked operation stage of each program in the control software, so that the program operation state parameters in the software applied in the final analysis stage of the system can more truly reflect the actual performance of the software, ensure the accuracy and comprehensiveness of the software test results, and realize further optimization and improvement of the software with the system output results.
[0088] like Figure 3As shown, in one embodiment, the software test optimization prediction method provided by the present invention receives an execution command from a control terminal, and drives the software program to run according to a set driving logic in response to the execution command to obtain the running state parameters of the software running program, specifically including the following steps:
[0089] Step S112, obtaining the set driving logic of the driving software program, and collecting the memory usage and response time of the software program at different stages to obtain the running status parameters.
[0090] Among them, the different stages include loading stage, initialization stage, interaction stage and end of operation stage.
[0091] Step S114, obtaining the weight of each software running program set by the running software, and arranging the software running programs in descending order based on the weight corresponding to each software running program to obtain an arrangement result.
[0092] The weight of each software running program is proportional to the memory usage and usage frequency during the execution phase of the corresponding software running program.
[0093] Step S116, determining the software running program with the largest weight as a test reference target based on the arrangement result, and determining other software running programs except the software running program with the largest weight as test verification targets.
[0094] It should be noted that the weight of each software running program corresponds to the following formula:
[0095] .
[0096] In the formula, f is the weight of the software running program, which is used to represent the importance of the software running program, G IN The software runs the program and loads it to occupy memory. S is the running memory consumed by the software running the program, P is the score of the source software of the software running the program, q(sim) is the number of the same type of software containing the same functional program, m is the set of all programs in the software, G j For the j The software running program loads and occupies memory. m-1 means it does not include G IN A collection of all programs in the software.
[0097] Step S118, by testing the running status parameters of the reference target when it runs alone, and selecting any test verification target to run together with the test reference target, multiple groups of running status parameters corresponding to the test reference target are obtained.
[0098] Among them, when the test verification target and the test reference target are run together, there are two groups of test verification targets involved in a single run.
[0099] like Figure 4 As shown, in one embodiment, the optimization prediction method for software testing provided by the present invention performs performance analysis on the running software according to the running state parameters of the software running program, obtains the software performance analysis result, and corrects the software performance analysis result, specifically comprising the following steps:
[0100] Step S122, calculate the software performance value according to the running stage of the software running program, the memory usage and response time when the software running program corresponding to the test verification target and the software running program corresponding to the test reference target run together, and the memory usage and response time when the software running program corresponding to the test reference target runs alone.
[0101] The calculation formula of software performance value is:
[0102] .
[0103] In the formula, K is the software performance value, n The running phase of the software is the running phase of the program. M i When the software running program corresponding to the test verification target is run together with the software running program corresponding to the test reference target, the software running program corresponding to the test reference target is i Memory usage of the stage run, m i When the software running program corresponding to the test reference target is run separately i Memory usage of the stage run, T i When the software running program corresponding to the test verification target is run together with the software running program corresponding to the test reference target, the software running program corresponding to the test reference target is i The response time of the phase operation, t i When the software running program corresponding to the test reference target is run separately i The response time of the phase run.
[0104] Step S124, based on the software performance analysis results, obtain the software running program corresponding to the test verification target that runs together with the software running program corresponding to the test reference target and corresponds to a set of software performance analysis results with the smallest software performance value, so as to correct the software performance analysis result with the smallest software performance value.
[0105] Among them, the correction formula for the software performance analysis result is:
[0106] .
[0107] Where K' is the corrected software performance analysis result, K min is the software performance analysis result with the minimum software performance value. The software running program corresponding to the test reference target and the software running program corresponding to the test verification target , A is a software running program corresponding to the test reference target and a software running program corresponding to the test verification target. d Arrange the unit distance in the queue in descending order of software running program weight, is the normalization factor, and >0.
[0108] like Figure 5 As shown, in one embodiment, the software testing optimization prediction method provided by the present invention evaluates the comprehensive performance of the running software based on the corrected software performance analysis result to obtain the evaluation result, and optimizes the running software according to the evaluation result, specifically comprising the following steps:
[0109] Step S132, real-time monitoring of whether software performance analysis results corresponding to a plurality of software running programs ranked not less than a first threshold in a queue in which each software running program in the running software is arranged in descending order according to weights are corrected.
[0110] Step S134, after the software performance analysis results corresponding to multiple software running programs ranked not lower than the first threshold in the queue arranged in descending order according to weight are corrected, the average value between the software performance values corresponding to the corrected multiple software performance analysis results is calculated to obtain an evaluation result.
[0111] The optimization prediction device for software testing provided by the present invention is described below. The optimization prediction device for software testing described below and the optimization prediction method for software testing described above can be referenced to each other.
[0112] like Figure 6 As shown, in one embodiment, a software testing optimization prediction device includes a program driving module 610 , a performance analysis and correction module 620 , and an evaluation and optimization module 630 .
[0113] The program driving module 610 is used to receive an execution command from the control terminal, and drive the software program to run according to the set driving logic in response to the execution command to obtain the running status parameters of the software running program.
[0114] The performance analysis and correction module 620 is used to perform performance analysis on the running software according to the running status parameters of the software running program, obtain the software performance analysis result, and correct the software performance analysis result.
[0115] The evaluation and optimization module 630 is used to evaluate the comprehensive performance of the running software based on the corrected software performance analysis results, obtain evaluation results, and perform optimization prediction on the running software according to the evaluation results.
[0116] Among them, the running status parameters include the memory usage and response time of the software running program loading phase, the memory usage and response time of the initialization phase, the memory usage and response time of the execution phase, the memory usage and response time of the interaction phase, and the memory usage and response time of the end phase of the running. The software performance analysis result is the software performance value. The lower the software performance value, the better the performance of the running software. The evaluation result is the average between the software performance value and the corrected software performance value.
[0117] In this embodiment, the optimization prediction device for software testing provided by the present invention, the program driving module is specifically used for:
[0118] The driving logic of the set driving software program is obtained, and the memory usage and response time of the software running program at different stages are collected to obtain the running status parameters.
[0119] The weights of the various software running programs set by the running software are obtained, and the software running programs are arranged in descending order based on the weight corresponding to each software running program to obtain an arrangement result.
[0120] Based on the arrangement results, the software running program with the largest weight is determined as a test reference target, and other software running programs except the software running program with the largest weight are used as test verification targets.
[0121] Among them, the different stages include loading stage, initialization stage, interaction stage and end of operation stage. The weight of each software running program is proportional to the memory usage and usage frequency of the corresponding software running program during the execution stage.
[0122] In this embodiment, in the software test optimization prediction device provided by the present invention, the weight of each software running program corresponds to the following formula:
[0123] .
[0124] In the formula, f is the weight of the software running program, which is used to represent the importance of the software running program, G IN The software runs the program and loads it to occupy memory. S is the running memory consumed by the software running the program, P is the score of the source software of the software running the program, q(sim) is the number of the same type of software containing the same functional program, m is the set of all programs in the software, G j For the j The software running program loads and occupies memory. m-1 means it does not include GIN A collection of all programs in the software
[0125] In this embodiment, the optimization prediction device for software testing provided by the present invention, the program driving module is specifically used for:
[0126] By testing the running status parameters of the reference target when it runs alone, and selecting any test verification target to run together with the test reference target, multiple groups of running status parameters corresponding to the test reference target are obtained.
[0127] Among them, when the test verification target and the test reference target are run together, there are two groups of test verification targets involved in a single run.
[0128] In this embodiment, the optimization prediction device for software testing provided by the present invention, the performance analysis correction module is specifically used for:
[0129] The software performance value is calculated based on the running stage of the software running program, the memory usage and response time when the software running program corresponding to the test verification target and the software running program corresponding to the test reference target run together, and the memory usage and response time when the software running program corresponding to the test reference target runs alone.
[0130] The calculation formula of software performance value is:
[0131] .
[0132] In the formula, K is the software performance value, n The running phase of the software is the running phase of the program. M i When the software running program corresponding to the test verification target is run together with the software running program corresponding to the test reference target, the software running program corresponding to the test reference target is i Memory usage of the stage run, m i When the software running program corresponding to the test reference target is run separately i Memory usage of the stage run, T i When the software running program corresponding to the test verification target is run together with the software running program corresponding to the test reference target, the software running program corresponding to the test reference target is i The response time of the phase operation, t i When the software running program corresponding to the test reference target is run separately i The response time of the phase run.
[0133] In this embodiment, the optimization prediction device for software testing provided by the present invention, the performance analysis and correction module is specifically used for:
[0134] Based on the software performance analysis results, a set of software performance analysis results with the smallest software performance value corresponding to the software running program corresponding to the test verification target is obtained, which is run together with the software running program corresponding to the test reference target, so as to correct the software performance analysis result with the smallest software performance value.
[0135] Among them, the correction formula for the software performance analysis result is:
[0136] .
[0137] Where K' is the corrected software performance analysis result, K min is the software performance analysis result with the minimum software performance value. The software running program corresponding to the test reference target and the software running program corresponding to the test verification target , A is a software running program corresponding to the test reference target and a software running program corresponding to the test verification target. d Arrange the unit distance in the queue in descending order of software running program weight, is the normalization factor, and >0.
[0138] In this embodiment, the optimization prediction device for software testing provided by the present invention, the evaluation optimization module is specifically used for:
[0139] Real-time monitoring is performed to determine whether software performance analysis results corresponding to a plurality of software running programs ranked not less than a first threshold in a queue in which each software running program in the running software is arranged in descending order according to weights are corrected.
[0140] After the software performance analysis results corresponding to multiple software running programs ranked not lower than the first threshold in the queue arranged in descending order according to weight are corrected, the average value of the software performance values corresponding to the corrected multiple software performance analysis results is calculated to obtain an evaluation result.
[0141] Figure 7 An example of a physical structure diagram of an electronic device is shown. The electronic device may be a smart terminal, and its internal structure diagram may be as follows: Figure 7As shown. The electronic device includes a processor, an internal memory and a network interface connected via a system bus. The processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the electronic device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, an optimization prediction method for software testing is implemented, and the method includes:
[0142] Receiving an execution command from the control terminal, and in response to the execution command, driving the software program to run according to the set driving logic to obtain the running state parameters of the software running program;
[0143] Performing performance analysis on the running software according to the running status parameters of the software running program, obtaining software performance analysis results, and correcting the software performance analysis results;
[0144] Based on the corrected software performance analysis results, the comprehensive performance of the running software is evaluated to obtain an evaluation result, and optimization prediction of the running software is performed according to the evaluation result;
[0145] Among them, the running status parameters include the memory usage and response time of the software running program loading phase, the memory usage and response time of the initialization phase, the memory usage and response time of the execution phase, the memory usage and response time of the interaction phase, and the memory usage and response time of the end phase of the running. The software performance analysis result is the software performance value. The lower the software performance value, the better the performance of the running software. The evaluation result is the average between the software performance value and the corrected software performance value.
[0146] Those skilled in the art will understand that Figure 7 The structure shown in the figure is only a block diagram of a part of the structure related to the scheme of the present invention, and does not constitute a limitation on the electronic device to which the scheme of the present invention is applied. The specific electronic device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0147] On the other hand, the present invention also provides a computer storage medium storing a computer program, which implements a software testing optimization prediction method when the computer program is executed by a processor, the method comprising:
[0148] Receiving an execution command from the control terminal, and in response to the execution command, driving the software program to run according to the set driving logic to obtain the running state parameters of the software running program;
[0149] Performing performance analysis on the running software according to the running status parameters of the software running program, obtaining software performance analysis results, and correcting the software performance analysis results;
[0150] Based on the corrected software performance analysis results, the comprehensive performance of the running software is evaluated to obtain an evaluation result, and optimization prediction of the running software is performed according to the evaluation result;
[0151] Among them, the running status parameters include the memory usage and response time of the software running program loading phase, the memory usage and response time of the initialization phase, the memory usage and response time of the execution phase, the memory usage and response time of the interaction phase, and the memory usage and response time of the end phase of the running. The software performance analysis result is the software performance value. The lower the software performance value, the better the performance of the running software. The evaluation result is the average between the software performance value and the corrected software performance value.
[0152] In another aspect, a computer program product or a computer program is provided, the computer program product or the computer program comprising computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium, and when the processor executes the computer instructions, an optimization prediction method for software testing is implemented, the method comprising:
[0153] Receiving an execution command from the control terminal, and in response to the execution command, driving the software program to run according to the set driving logic to obtain the running state parameters of the software running program;
[0154] Performing performance analysis on the running software according to the running status parameters of the software running program, obtaining software performance analysis results, and correcting the software performance analysis results;
[0155] Based on the corrected software performance analysis results, the comprehensive performance of the running software is evaluated to obtain an evaluation result, and optimization prediction of the running software is performed according to the evaluation result;
[0156] Among them, the running status parameters include the memory usage and response time of the software running program loading phase, the memory usage and response time of the initialization phase, the memory usage and response time of the execution phase, the memory usage and response time of the interaction phase, and the memory usage and response time of the end phase of the running. The software performance analysis result is the software performance value. The lower the software performance value, the better the performance of the running software. The evaluation result is the average between the software performance value and the corrected software performance value.
[0157] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing related hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided by the present invention may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory.
[0158] By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0159] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0160] The above-mentioned embodiments only express several implementation methods of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of the patent of the present invention. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.
Claims
1. A software testing optimization prediction method, characterized in that: The method comprises: Receiving an execution command from the control terminal, and in response to the execution command, driving the software program to run according to the set driving logic to obtain the running state parameters of the software running program; Performing performance analysis on the running software according to the running status parameters of the software running program to obtain software performance analysis results, and correcting the software performance analysis results; Based on the corrected software performance analysis result, the comprehensive performance of the running software is evaluated to obtain an evaluation result, and optimization prediction is performed on the running software according to the evaluation result; The running status parameters include the memory usage and response time of the software running program loading phase, the memory usage and response time of the initialization phase, the memory usage and response time of the execution phase, the memory usage and response time of the interaction phase, and the memory usage and response time of the running end phase. The software performance analysis result is a software performance value. The lower the software performance value, the better the performance of the running software. The evaluation result is the average of the software performance value and the corrected software performance value. The receiving of the execution command from the control terminal and driving the software program to run according to the set driving logic in response to the execution command to obtain the running state parameters of the software running program include: Acquire the driving logic of the set driving software program, and collect the memory usage and response time of the software program at different stages to obtain the running state parameters; Obtaining the weight of each software running program set by the running software, and arranging the software running programs in descending order based on the weight corresponding to each software running program to obtain an arrangement result; Determine the software running program with the largest weight as a test reference target based on the arrangement result, and use other software running programs except the software running program with the largest weight as test verification targets; The different stages include a loading stage, an initialization stage, an interaction stage, and an end-of-run stage, and the weight of each software running program is proportional to the memory usage and usage frequency of the corresponding software running program during the execution stage; The performing performance analysis on the running software according to the running state parameters of the software running program to obtain the software performance analysis result and correcting the software performance analysis result also includes: Based on the software performance analysis results, obtaining a software running program corresponding to a test verification target that runs together with a software running program corresponding to the test reference target and corresponds to a set of software performance analysis results with the smallest software performance value, so as to correct the software performance analysis results with the smallest software performance value; The correction formula of the software performance analysis result is: ; In the formula, is the corrected software performance analysis result. is the software performance analysis result with the minimum software performance value. The software running program corresponding to the test reference target and the software running program corresponding to the test verification target , A is a software running program corresponding to the test reference target and a software running program corresponding to the test verification target. d Arrange the unit distance in the queue in descending order of software running program weight, is the normalization factor, and >
0.
2. The software testing optimization prediction method according to claim 1, characterized in that: The weights of the various software running programs correspond to the following formula: ; In the formula, f is the weight of the software running program, which is used to represent the importance of the software running program, G IN The software runs the program and loads it to occupy memory. S is the running memory consumed by the software running the program, P is the score of the source software of the software running the program, q(sim) is the number of the same type of software containing the same functional program, m is the set of all programs in the software, G j For the j The software running program loads and occupies memory. m-1 means it does not include G IN A collection of all programs in the software.
3. The software testing optimization prediction method according to claim 1, characterized in that: The receiving of the execution command from the control terminal and driving the software program to run according to the set driving logic in response to the execution command to obtain the running state parameters of the software running program also includes: Acquire multiple groups of operating status parameters corresponding to the test reference target by using the operating status parameters of the test reference target when the test reference target is run alone, and selecting any one of the test verification targets to run together with the test reference target; Wherein, when the test verification target and the test reference target are run together, there are two groups of test verification targets involved in a single run.
4. The software testing optimization prediction method according to claim 3, characterized in that: The performing performance analysis on the running software according to the running status parameters of the software running program to obtain the software performance analysis result, and correcting the software performance analysis result includes: Calculate the software performance value according to the running stage of the software running program, the memory usage and response time when the software running program corresponding to the test verification target and the software running program corresponding to the test reference target are running together, and the memory usage and response time when the software running program corresponding to the test reference target is running alone; The calculation formula of the software running performance value is: ; In the formula, K is the software performance value, n The running phase of the software is the running phase of the program. M i When the software running program corresponding to the test verification target and the software running program corresponding to the test reference target are run together, the software running program corresponding to the test reference target is i Memory usage of the stage run, m i When the software running program corresponding to the test reference target is run separately i Memory usage of the stage run, T i When the software running program corresponding to the test verification target and the software running program corresponding to the test reference target are run together, the software running program corresponding to the test reference target is i The response time of the phase operation, t i When the software running program corresponding to the test reference target is run separately i The response time of the phase run.
5. The software testing optimization prediction method according to claim 1, characterized in that: The comprehensive performance of the running software is evaluated based on the corrected software performance analysis result to obtain an evaluation result, and optimization prediction of the running software is performed according to the evaluation result, including: Real-time monitoring of whether software performance analysis results corresponding to a plurality of software running programs ranked not less than a first threshold in a queue in which each software running program in the running software is arranged in descending order according to weights are corrected; After the software performance analysis results corresponding to the multiple software running programs ranked not lower than the first threshold in the queue arranged in descending order according to weight are corrected, the average value between the software performance values corresponding to the corrected multiple software performance analysis results is calculated to obtain the evaluation result.
6. An optimization prediction device for software testing, characterized in that: The device comprises: A program driving module, used to receive an execution command from the control terminal, and drive the software program to run according to a set driving logic in response to the execution command, so as to obtain the running state parameters of the software running program; A performance analysis and correction module, used to perform performance analysis on the running software according to the running status parameters of the software running program, obtain software performance analysis results, and correct the software performance analysis results; An evaluation and optimization module, used to evaluate the comprehensive performance of the running software based on the corrected software performance analysis result, obtain an evaluation result, and perform optimization prediction on the running software according to the evaluation result; The running status parameters include the memory usage and response time of the software running program loading phase, the memory usage and response time of the initialization phase, the memory usage and response time of the execution phase, the memory usage and response time of the interaction phase, and the memory usage and response time of the running end phase. The software performance analysis result is a software performance value. The lower the software performance value, the better the performance of the running software. The evaluation result is the average of the software performance value and the corrected software performance value. The program driver module is specifically used for: Obtain the driving logic of the set driving software program, and collect the memory usage and response time of the software program at different stages to obtain the running status parameters; Obtaining the weight of each software running program set by the running software, and arranging the software running programs in descending order based on the weight corresponding to each software running program to obtain an arrangement result; Based on the ranking results, the software running program with the largest weight is determined as a test reference target, and other software running programs except the software running program with the largest weight are used as test verification targets; Among them, the different stages include loading stage, initialization stage, interaction stage and end of operation stage. The weight of each software running program is proportional to the memory usage and usage frequency of the corresponding software running program during its execution stage. The performance analysis and correction module is also used to: Based on the software performance analysis results, obtaining a software running program corresponding to a test verification target that runs together with a software running program corresponding to a test reference target and corresponds to a set of software performance analysis results with the smallest software performance value, so as to correct the software performance analysis results with the smallest software performance value; Among them, the correction formula for the software performance analysis result is: ; In the formula, is the corrected software performance analysis result. is the software performance analysis result with the minimum software performance value. The software running program corresponding to the test reference target and the software running program corresponding to the test verification target , A is a software running program corresponding to the test reference target and a software running program corresponding to the test verification target. d Arrange the unit distance in the queue in descending order of software running program weight, is the normalization factor, and >
0.
7. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.
8. A computer storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.
