A test task execution time prediction method and optimal execution node selection method
By applying the machine learning algorithm polynomial regression algorithm in the automated testing framework, the execution time of the test task in each test node is predicted, and the problem of the test task completion time in the existing technology is solved, and the selection of test nodes with the shortest running time is realized. Improve the execution efficiency of test tasks.
Patent Information
- Application Number
- CN202010717167.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-07-23
- Publication Date
- 2025-02-21
- Estimated Expiration
- 2040-07-23
AI Technical Summary
When the existing automated testing framework selects test nodes to perform test tasks, it is difficult to select the most suitable node, which leads to the test task completion time being too long, affecting the time for software problems to be discovered and repaired.
The machine learning algorithm polynomial regression algorithm is used as the time prediction model. By obtaining the job files of the test task, the execution components and test cases are extracted, the predicted execution time is generated, and the existing task completion time is accumulated to determine the optimal execution node.
The predictive execution time capability of each test node of the automated test framework is realized, and the test node with the shortest running time is selected to execute tasks, which improves the predictive execution time accuracy of the test task and reduces the test task completion time.
Smart Images

Figure CN111861012B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of automated testing, and in particular relates to a test task execution time prediction method and an optimal execution node selection method. Background Art
[0002] Automated testing generally refers to the automation of software testing. Software testing is to run the system or application under preset conditions and evaluate the running results. The preset conditions should include normal conditions and abnormal conditions. Automated testing frameworks have been widely used in software testing and have brought efficient quality assurance to software products. The sooner the test results are obtained, the sooner developers can find and solve problems.
[0003] When the control node in the automated testing framework receives a test request from the client, how to select the test node to execute this test? Currently, there are two typical ways. The first is to use a loop method, in which all test nodes are called in sequence; the other is that the user specifies the test node to be used in the request.
[0004] Both methods have a common disadvantage, that is, the control node only distributes test tasks to each test node, and it is difficult to select the most suitable test node among all test nodes to test the test task, which leads to a long time to complete the test task, thus affecting the time to discover and fix software product problems. Summary of the invention
[0005] The purpose of the present invention is to provide a test task execution time prediction method and an optimal execution node selection method, which can reasonably allocate test nodes for test tasks by predicting the predicted execution time of test tasks on test nodes.
[0006] The present invention adopts the following technical solution: a method for predicting the execution time of a test task in an automated test, characterized in that it is applied to a test node in an automated test framework, comprising the following steps:
[0007] Get the job file of the test task;
[0008] Extracting an execution component from the job file and generating a first execution time of the execution component; wherein the execution component is composed of a plurality of execution steps with fixed execution times;
[0009] Extracting a test case from the job file, and generating a second execution time according to the test case; wherein the second execution time is the execution time of the test case in the job file on the test node;
[0010] A predicted execution time of the task to be tested on the test node is determined according to the first execution time and the second execution time.
[0011] Further, after determining the predicted execution time of the task to be tested on the test node, the method further includes:
[0012] The predicted execution time and the completion time of the existing execution tasks of the test node are accumulated to generate the predicted completion time of the task to be tested on the test node.
[0013] Further, generating the second execution time according to the test case includes:
[0014] Extract multiple scale parameters for each test case to be executed;
[0015] Taking multiple scale parameters of each test case to be executed as input values and based on the trained time prediction model, generate the predicted execution time of each test case to be executed on the test node;
[0016] The predicted execution times of all the test execution cases in the task to be executed are accumulated to obtain the second execution time.
[0017] Furthermore, the trained time prediction model is a polynomial regression algorithm estimation model based on machine learning, specifically:
[0018] Y=a+b1*X1+b2*X2+...+bn*Xn,
[0019] Among them, Y is the predicted execution time of the test case on the test node, X1, X2, ..., Xn are all scale parameters of the test case, and a, b1, b2, ..., bn are all coefficients in the time prediction model, which are obtained by training with multiple known data sets.
[0020] Another technical solution of the present invention: a device for predicting the execution time of a test task in an automated test, applied to a test node in an automated test framework, comprising:
[0021] A first acquisition module is used to acquire the job file of the test task;
[0022] A first generating module is used to extract an execution component from a job file and generate a first execution time of the execution component; wherein the execution component is composed of a plurality of execution steps with fixed execution time;
[0023] A second generating module is used to extract test cases from the job file and generate a second execution time according to the test cases; wherein the second execution time is the execution time of the test cases in the job file on the test node;
[0024] The first determining module is used to determine the execution time of the task to be tested on the test node according to the first execution time and the second execution time.
[0025] Another technical solution of the present invention: a device for predicting the execution time of a test task in automated testing, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, a method for predicting the execution time of a test task in automated testing is implemented according to any one of the above-mentioned technical solutions.
[0026] Another technical solution of the present invention: a method for selecting the optimal execution node in automated testing, applied to a control node in an automated testing framework, specifically comprising the following steps:
[0027] Get the job file of the task to be tested;
[0028] Sending the job file to each test node; wherein the job file is used by the test node to predict the predicted execution time of the task to be tested on the test node;
[0029] Receive return information from each test node; wherein the return information includes the predicted execution time of the task to be tested on the corresponding test node;
[0030] Determine the predicted completion time of the task to be tested on the test node according to the predicted execution time;
[0031] The test node corresponding to the earliest predicted completion time is selected as the optimal execution node for the task to be tested.
[0032] Furthermore, the test node predicts the predicted execution time of the task to be tested on the test node, including:
[0033] Get the job file of the test task;
[0034] Extracting an execution component from the job file and generating a first execution time of the execution component; wherein the execution component is composed of a plurality of execution steps with fixed execution times;
[0035] Extracting a test case from the job file, and generating a second execution time according to the test case; wherein the second execution time is the execution time of the test case in the job file on the test node;
[0036] A predicted execution time of the task to be tested on the test node is determined according to the first execution time and the second execution time.
[0037] Further, determining the predicted completion time of the task to be tested on the test node according to the predicted execution time includes:
[0038] The predicted execution time and the completion time of the existing execution tasks of the test node are accumulated to generate the predicted completion time of the task to be tested on the test node.
[0039] Another technical solution of the present invention: a device for selecting execution nodes in automated testing, applied to control nodes in an automated testing framework, specifically comprising:
[0040] The second acquisition module acquires the job file of the task to be tested;
[0041] A sending module, used to send the job file to each test node; wherein the job file is used by the test node to predict the predicted execution time of the task to be tested on the test node;
[0042] A receiving module, used to receive the return information of each test node; wherein the return information includes the predicted execution time of the task to be tested on the corresponding test node;
[0043] A second determination module is used to determine the predicted completion time of the task to be tested on the test node according to the predicted execution time;
[0044] The selection module is used to select the test node corresponding to the earliest predicted completion time as the optimal execution node for the task to be tested.
[0045] The beneficial effect of the present invention is as follows: the present invention applies the machine learning algorithm polynomial regression algorithm to the test node as a time prediction model, so that each test node of the automated testing framework has the ability to predict the execution time of the test task, and finally selects a test node that makes the test task run in the shortest time to execute the task, and when the test node completes the test task, uses actual information as a training set to update the time prediction model, making its accuracy higher and higher, thereby improving the test node's prediction accuracy of the execution time of the test task. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 A schematic diagram of a typical automated testing framework workflow in the prior art;
[0047] Figure 2 A flow chart of a method for predicting the execution time of a test task in an automated test in one embodiment of the present invention;
[0048] Figure 3 A schematic diagram of the module structure of a test task execution time prediction device in an automated test in one embodiment of the present invention;
[0049] Figure 4 A schematic diagram of the structure of a test task execution time prediction device in an automated test in one embodiment of the present invention;
[0050] Figure 5 A flowchart of a method for selecting an optimal execution node in an automated test in one embodiment of the present invention;
[0051] Figure 6 A schematic diagram of the module structure of an optimal execution node selection device in an automated test in one embodiment of the present invention;
[0052] Figure 7 The flowchart of the predicted execution time of a test task in one embodiment of the present invention. DETAILED DESCRIPTION
[0053] The present invention is described in detail below with reference to the accompanying drawings and specific embodiments.
[0054] An automated testing framework is a framework used for automated testing. According to the definition of the framework, an automated testing framework either provides reusable basic automated testing modules, such as selenium, watir, etc. They mainly provide the most basic automated testing functions, such as opening a program, simulating the mouse and keyboard to click or operate the object under test, and finally verifying the properties of the object under test to determine the correctness of the program. Or it is an architecture module that can provide automated test execution and management functions, such as Phoenix Framework, robot, STAF, etc. They do not provide basic automated testing support themselves, but are only used to organize, manage and execute those independent automated test cases. After the test is completed, the test results are counted and returned to the client.
[0055] like Figure 1 As shown, in the prior art, in a general automated testing framework, there is a control node and multiple test nodes. The control node is the center of the testing framework, which is responsible for receiving test requests sent from multiple clients and notifying the corresponding clients of the final test results after the test task is completed.
[0056] The actual test task is run on the test node, and each test node has different configurations and performance conditions, such as different CPU models, different memory sizes, different performance parameter settings, etc. Currently, after receiving a test request, the control node does not have the ability to find a test node from multiple test nodes that can complete the task faster. Therefore, its logic of selecting a test node to execute the test task is unreasonable, and the test task is likely to be assigned to a test node that takes more time to complete.
[0057] Through the above analysis of the implementation method of the current control node selecting test nodes for test tasks, we can clearly understand the reason why it cannot distribute tasks reasonably. The reason is that the control node does not know the idle time points of each test node and the time required for the test tasks to be executed on each test node, so it cannot select an optimal test node to complete the test task as soon as possible.
[0058] Therefore, according to the existing automated testing framework, the current implementation has the following shortcomings:
[0059] 1. Without a job scheduler, jobs are randomly distributed to test nodes for execution in an unreasonable manner.
[0060] 2. Resources are wasted, including time, manpower and hardware.
[0061] 3. The time to discover test task problems is delayed, thus affecting the bug fixing time.
[0062] A test case is a description of a test task for a specific software product, reflecting the test plan, method, technology and strategy. Its content includes test objectives, test environment, input data, test steps, expected results, test scripts, etc., and finally forms a document. Simply put, a test case is a set of test inputs, execution conditions and expected results compiled for a special goal, used to verify whether a specific software requirement is met.
[0063] The present invention proposes to use machine learning in an automated testing framework to achieve intelligent allocation of test tasks to better support automated software integration testing.
[0064] The present invention can utilize a machine learning algorithm to train each test node according to a real automated test case execution history data set with different parameters and different configurations in the test task. In this way, each test node can gradually learn to predict the time required for each test case in a new test task to be executed on it. Then, by adding the time required for the task currently being executed on the node, the completion time of the new task on it can be predicted. When a new test task is sent to the control node, it will send a message to each test node, asking each test node for the predicted completion time of the new task, and then select the test node that requires the shortest time to execute the task.
[0065] An embodiment of the present invention discloses a method for predicting the execution time of a test task in an automated test, which is applied to a test node in an automated test framework, such as Figure 1 As shown, the following steps are included:
[0066] S110, obtaining the job file of the test task;
[0067] S120, extracting an execution component from the job file and generating a first execution time of the execution component; wherein the execution component is composed of a plurality of execution steps with fixed execution times;
[0068] S130, extracting a test case from the job file, and generating a second execution time according to the test case; wherein the second execution time is the execution time of the test case in the job file on the test node;
[0069] S140: Determine a predicted execution time of the task to be tested on the test node according to the first execution time and the second execution time.
[0070] The present invention applies a machine learning algorithm polynomial regression algorithm to a test node as a time prediction model, so that each test node of an automated testing framework has the ability to predict the execution time of a test task, and ultimately selects a test node that minimizes the running time of the test task to execute the task. After the test node completes the test task, the actual information is used as a training set to update the time prediction model, making it more and more accurate, thereby improving the test node's accuracy in predicting the execution time of the test task.
[0071] For execution components, in end-to-end testing, a task may include operating system installation, product installation, third-party software installation, and the execution of multiple test cases. The execution components are composed of execution steps such as operating system installation, product installation, third-party software installation, etc., whose time can be pre-calculated.
[0072] The following program principle framework shows a possible test task description file (i.e., job file). The first three items generally have fixed execution times (i.e., execution steps), so when the test task includes these options, these preset times can be directly added.
[0073]
[0074]
[0075] More specifically, after determining the predicted execution time of the task to be tested on the test node, the following steps are also included:
[0076] The predicted execution time and the completion time of the existing execution tasks of the test node are accumulated to generate the predicted completion time of the task to be tested on the test node.
[0077] By combining the deadline of the current task on the test node and the predicted execution time of the task to be tested, the completion time of each test node executing the test task can be accurately estimated, and the predicted execution time of each test node can be compared more intuitively and accurately.
[0078] In this embodiment, generating the second execution time according to the test case includes:
[0079] Extract multiple scale parameters of each test case to be executed; use the multiple scale parameters of each test case to be executed as input values and generate a predicted execution time of the test case to be executed on the test node based on the trained time prediction model.
[0080] In this embodiment, since the predicted execution time of the test case is related to the scale parameters, such as the number of file systems to be created, the size of each file system, the size of the space to write data in the file system, etc., it is only necessary to extract multiple scale parameters of the test case to accurately estimate the predicted execution time of the test case on the node.
[0081] In the embodiment of the present invention, when predicting the execution time of an automated test case based on its various parameters, only those parameters related to scale need to be considered. For example, there is an automated test case named "create_filesystem_and_write_data", and its execution process can be simply described as creating multiple file systems and then writing data on them. Among them, the parameters related to scale may be as follows:
[0082] 1. "NumOfFs" is used to specify the number of file systems to be created.
[0083] 2. "SizeOfFs" is used to specify the size of each file system.
[0084] 3. "DataPercentage" is used to specify the size of the space in the file system where data is to be written.
[0085] In addition, in this embodiment, the trained time prediction model is a polynomial regression algorithm estimation model based on machine learning, specifically:
[0086] Y=a+b1*X1+b2*X2+...+bn*Xn,
[0087] Among them, Y is the predicted execution time of the test case on the test node, X1, X2, ..., Xn are all scale parameters of the test case, and a, b1, b2, ..., bn are all coefficients in the time prediction model, which are obtained by training with multiple known data sets.
[0088] Polynomial regression is one of the machine learning algorithms, and its main goal is to discover the relationship between several independent predictor variables and a dependent variable or standard variable through learning. For example, real estate agents can use this algorithm to derive a prediction model for predicting house prices based on the area of each house (in square meters), the number of bedrooms, the average income of the community based on census data, and subjective evaluation of the attractiveness of the house. The goal of an embodiment of the present invention is to execute an algorithm, such as stochastic gradient descent, to obtain regression coefficients a, b1, b2, ..., bn on a training set of real experimental data. In actual application, in this model, the input data X1, X2, ..., Xn is a set of parameters related to the scale of the test case, and the output data is the execution time required for the test task on the test node.
[0089] The training set that the algorithm will use can be constructed as follows: For each valid value of the parameter, if it is a number, it can be used directly. Otherwise, for ease of implementation, it needs to be converted to a numeric value. For example, the valid values of the parameter "configurationscale" are small, medium, and big, which are represented by 1, 2, and 3 respectively, so the training set is as follows:
[0090]
[0091] Each time the test node receives a query message with a job file from the control node, it will analyze the job file. For components with relatively fixed execution time, it will use the pre-set time. For automated test cases, it will loop through the case list and use the regression coefficients a, b1, b2, …, bn obtained from the existing training set and bring in the new parameter values in the test case to predict the time required for each test case. All time values are added together to get the total time required for the test task on a certain test node.
[0092] The following pseudo code shows how to use gradient descent in the polynomial regression algorithm to calculate the coefficients for an automated test case based on historical data in the training set.
[0093]
[0094]
[0095] like Figure 7As shown, a specific workflow on a test node is shown. When the test node receives a message (i.e., a job file) from the control node, it starts to analyze the task file. First, it determines whether the test task requires the installation of an operating system. If the operating system needs to be installed, the preset information in the test node is called to extract the time required to install the operating system. If the operating system does not need to be installed, it then determines in turn whether the product to be tested needs to be installed and whether a third-party software product needs to be installed. Similarly, when installation is required, the time corresponding to the installation is extracted and added to the total time for executing the task. If not, continue to perform the following steps.
[0096] After checking whether the above fixed execution steps need to be installed, the test cases are judged. The execution time of each test case is predicted based on the machine learning algorithm and added to the total execution time of the task. When all the test cases are calculated, the total execution time is packaged and sent to the control node. The control node can then determine which test node is more reasonable to assign to the current task to be tested based on the predicted time of each test node received.
[0097] This embodiment proposes to use a polynomial regression algorithm in an automated testing framework to achieve automatic and intelligent allocation of test tasks among multiple test nodes, so as to achieve the fastest completion of test tasks. The entire learning process does not require manual intervention by the user; and as the test tasks are executed, the test nodes can continuously learn and improve the prediction accuracy. By allocating test tasks to the ones that can be executed the fastest, software integration testing can be better supported.
[0098] This embodiment proposes to use machine learning in an automated testing framework to achieve intelligent allocation of test tasks to better support software integration testing, which has the following main advantages:
[0099] 1. Assign tasks to the most appropriate test nodes to complete the tasks as quickly as possible.
[0100] 2. Save time. Users do not need to wait unnecessary extra time.
[0101] 3. No manual work is required at prediction time, as the test node can continuously learn with each task and become more and more accurate.
[0102] Another embodiment of the present invention is a test task execution time prediction device in automated testing, which is applied to a test node in an automated testing framework, such as Figure 3 As shown, including:
[0103] The first acquisition module 210 is used to acquire the job file of the test task; the first generation module 220 is used to extract the execution component from the job file and generate the first execution time of the execution component; wherein the execution component is composed of multiple execution steps with fixed execution time; the second generation module 230 is used to extract the test case from the job file and generate the second execution time according to the test case; wherein the second execution time is the execution time of the test case in the job file on the test node; the first determination module 240 is used to determine the execution time of the task to be tested on the test node according to the first execution time and the second execution time.
[0104] It should be noted that the information interaction, execution process and other contents between the above-mentioned modules are based on the same concept as the above-mentioned method embodiment of the present invention. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0105] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example for illustration. In practical applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. The functional modules in the embodiment can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the modules in the above-mentioned device can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0106] Another embodiment of the present invention also discloses a device 3 for predicting the execution time of a test task in an automated test, comprising a memory 31, a processor 32, and a computer program 33 stored in the memory 31 and executable on the processor 32. When the processor 32 executes the computer program 33, it implements any one of the above-mentioned embodiments of a method for predicting the execution time of a test task in an automated test.
[0107] The present invention also discloses an embodiment, which is a method for selecting the optimal execution node in an automated test, which is applied to a control node in an automated test framework, such as Figure 5 As shown, the specific steps include:
[0108] S410, obtain the job file of the task to be tested; S420, send the job file to each test node; wherein, the job file is used by the test node to predict the predicted execution time of the task to be tested on the test node; S430, receive the return information of each test node; wherein, the return information includes the predicted execution time of the task to be tested on the corresponding test node; S440, determine the predicted completion time of the task to be tested on the test node according to the predicted execution time; S450, select the test node corresponding to the earliest predicted completion time as the optimal execution node for the task to be tested.
[0109] As a possible implementation method, the test node predicts the predicted execution time of the task to be tested on the test node including:
[0110] Obtain the job file of the test task; extract the execution component from the job file and generate a first execution time of the execution component; wherein the execution component is composed of multiple execution steps with fixed execution time; extract the test case from the job file and generate a second execution time according to the test case; wherein the second execution time is the execution time of the test case in the job file on the test node; determine the predicted execution time of the task to be tested on the test node according to the first execution time and the second execution time.
[0111] Specifically, determining the predicted completion time of the task to be tested on the test node according to the predicted execution time includes:
[0112] The execution time is accumulated and the completion time of the existing execution tasks of the test node is added to generate the predicted completion time of the task to be tested on the test node.
[0113] The control node will obtain the predicted completion time of the test task from each test node, and then select the test node that can complete the task the fastest to run; and accumulate the predicted time to the busy time value of the selected test node. Once the task is completed, the actual execution time of the use case can be added to the training set, and the coefficients in the polynomial can be continuously corrected with real data to improve the prediction accuracy, making the test node more intelligent and accurate.
[0114] Another embodiment of the present invention also discloses an optimal execution node selection device in automated testing, which is applied to a control node in an automated testing framework, such as Figure 6 As shown, specifically including:
[0115] A second acquisition module 510 is used to acquire the job file of the task to be tested; a sending module 520 is used to send the job file to each test node; wherein the job file is used by the test node to predict the predicted execution time of the task to be tested on the test node; a receiving module 530 is used to receive the return information of each test node; wherein the return information includes the predicted execution time of the task to be tested on the corresponding test node; a second determination module 540 is used to determine the predicted completion time of the task to be tested on the test node based on the predicted execution time; a selection module 550 is used to select the test node corresponding to the earliest predicted completion time as the optimal execution node for the task to be tested.
Claims
1. A method for predicting the execution time of a test task in an automated test, characterized in that: Applied to the test node in the automated testing framework, including the following steps: Obtaining the job file of the test task; Extracting an execution component from the job file and generating a first execution time of the execution component; wherein the execution component is composed of a plurality of execution steps with fixed execution times; Extracting a test case from the job file, and generating a second execution time according to the test case; wherein the second execution time is the execution time of the test case in the job file on the test node; Determine a predicted execution time of the task to be tested on the test node according to the first execution time and the second execution time; Generating a second execution time according to the test case includes: Extracting multiple scale parameters for each test case to be executed; the scale parameters include the number of file systems to be created, the size of each file system, and the size of the space in the file system to be written; Taking the multiple scale parameters of each test case to be executed as input values and based on the trained time prediction model, generating a predicted execution time of each test case to be executed on the test node; Accumulating the predicted execution time of all the test cases to be executed in the task to be executed to obtain the second execution time; The trained time prediction model is a polynomial regression algorithm estimation model based on machine learning, specifically: Y=a+b1*X1+b2*X2+...+bn*Xn, Among them, Y is the predicted execution time of the test case on the test node, X1, X2, ..., Xn are all scale parameters of the test case, a, b1, b2, ..., bn are all coefficients in the time prediction model, which are obtained by training with multiple known data sets.
2. A method for predicting the execution time of a test task in an automated test according to claim 1, characterized in that: After determining the predicted execution time of the task to be tested on the test node, the following steps are also included: The predicted execution time and the completion time of the existing execution tasks of the test node are accumulated to generate the predicted completion time of the task to be tested on the test node.
3. A device for predicting the execution time of a test task in an automated test, characterized in that: Test nodes used in the automated testing framework include: A first acquisition module, used to acquire the job file of the test task; A first generating module, configured to extract an execution component from the job file and generate a first execution time of the execution component; wherein the execution component is composed of a plurality of execution steps with fixed execution times; A second generating module is used to extract a test case from the job file and generate a second execution time according to the test case; wherein the second execution time is the execution time of the test case in the job file on the test node; A first determining module, used to determine the execution time of the task to be tested on the test node according to the first execution time and the second execution time; Generating a second execution time according to the test case includes: Extract multiple scale parameters for each test case to be executed; the scale parameters include the number of file systems to be created, the size of each file system, and the size of the space in the file system to be written. Taking the multiple scale parameters of each test case to be executed as input values and based on the trained time prediction model, generating a predicted execution time of each test case to be executed on the test node; Accumulating the predicted execution time of all the test cases to be executed in the task to be executed to obtain the second execution time; The trained time prediction model is a polynomial regression algorithm estimation model based on machine learning, specifically: Y=a+b1*X1+b2*X2+...+bn*Xn, Among them, Y is the predicted execution time of the test case on the test node, X1, X2, ..., Xn are all scale parameters of the test case, a, b1, b2, ..., bn are all coefficients in the time prediction model, which are obtained by training with multiple known data sets.
4. A device for predicting the execution time of a test task in an automated test, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method for predicting the execution time of a test task in an automated test as described in any one of claims 1 to 2 is implemented.
5. A method for selecting the optimal execution node in automated testing, characterized in that: The control node used in the automated testing framework includes the following steps: Get the job file of the task to be tested; Sending the job file to each test node; wherein the job file is used by the test node to predict the predicted execution time of the task to be tested on the test node; Receive return information from each of the test nodes; wherein the return information includes the predicted execution time of the task to be tested on the corresponding test node; Determine the predicted completion time of the task to be tested on the test node according to the predicted execution time; Selecting the test node corresponding to the earliest predicted completion time as the optimal execution node for the task to be tested; The test node predicts the predicted execution time of the task to be tested on the test node, including: Obtaining the job file of the test task; Extracting an execution component from the job file and generating a first execution time of the execution component; wherein the execution component is composed of a plurality of execution steps with fixed execution times; Extracting a test case from the job file, and generating a second execution time according to the test case; wherein the second execution time is the execution time of the test case in the job file on the test node; Determine a predicted execution time of the task to be tested on the test node according to the first execution time and the second execution time; Generating a second execution time according to the test case includes: Extracting multiple scale parameters for each test case to be executed; the scale parameters include the number of file systems to be created, the size of each file system, and the size of the space in the file system to be written; Taking the multiple scale parameters of each test case to be executed as input values and based on the trained time prediction model, generating a predicted execution time of each test case to be executed on the test node; Accumulating the predicted execution time of all the test cases to be executed in the task to be executed to obtain the second execution time; The trained time prediction model is a polynomial regression algorithm estimation model based on machine learning, specifically: Y=a+b1*X1+b2*X2+...+bn*Xn, Among them, Y is the predicted execution time of the test case on the test node, X1, X2, ..., Xn are all scale parameters of the test case, a, b1, b2, ..., bn are all coefficients in the time prediction model, which are obtained by training with multiple known data sets.
6. The method for selecting the optimal execution node in automated testing according to claim 5, characterized in that: Determining the predicted completion time of the task to be tested on the test node according to the predicted execution time includes: The predicted execution time and the completion time of the existing execution tasks of the test node are accumulated to generate the predicted completion time of the task to be tested on the test node.
7. A device for selecting the best execution node in automated testing, characterized in that: Control nodes used in the automated testing framework include: The second acquisition module acquires the job file of the task to be tested; A sending module, used to send the job file to each test node; wherein the job file is used by the test node to predict the predicted execution time of the task to be tested on the test node; A receiving module, configured to receive the return information of each of the test nodes; wherein the return information includes the predicted execution time of the task to be tested on the corresponding test node; A second determination module is used to determine the predicted completion time of the task to be tested on the test node according to the predicted execution time; A selection module, used to select the test node corresponding to the earliest predicted completion time as the optimal execution node of the task to be tested; The test node predicts the predicted execution time of the task to be tested on the test node, including: Obtaining the job file of the test task; Extracting an execution component from the job file and generating a first execution time of the execution component; wherein the execution component is composed of a plurality of execution steps with fixed execution times; Extracting a test case from the job file, and generating a second execution time according to the test case; wherein the second execution time is the execution time of the test case in the job file on the test node; Determine a predicted execution time of the task to be tested on the test node according to the first execution time and the second execution time; Generating a second execution time according to the test case includes: Extracting multiple scale parameters for each test case to be executed; the scale parameters include the number of file systems to be created, the size of each file system, and the size of the space in the file system to be written; Taking the multiple scale parameters of each test case to be executed as input values and based on the trained time prediction model, generating a predicted execution time of each test case to be executed on the test node; Accumulating the predicted execution time of all the test cases to be executed in the task to be executed to obtain the second execution time; The trained time prediction model is a polynomial regression algorithm estimation model based on machine learning, specifically: Y=a+b1*X1+b2*X2+...+bn*Xn, Among them, Y is the predicted execution time of the test case on the test node, X1, X2, ..., Xn are all scale parameters of the test case, a, b1, b2, ..., bn are all coefficients in the time prediction model, which are obtained by training with multiple known data sets.
Citation Information
Patent Citations
Task scheduling device and task scheduling method in multimode distributive system
CN102831012A
Distributed assignment method and system
CN107239344A