Self-adaptive test execution method and device, electronic equipment and storage medium

By dynamically adjusting the test case execution order and resource monitoring of hardware in ring testing, the problems of low testing efficiency and low resource utilization are solved, and more efficient testing resource utilization and problem positioning and repair are achieved.

CN119226151APending Publication Date: 2024-12-31CHINA FAW CO LTD
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202411198189.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-29
Publication Date
2024-12-31

AI Technical Summary

Technical Problem

The execution order of hardware test cases in loop tests is fixed, resulting in low testing efficiency and low resource utilization, failure use cases cannot be optimized in time, and lack of real-time resource monitoring and feedback.

Method used

By obtaining test case collection and resources, performing execution tracking and monitoring, dynamically adjusting the execution order of test cases, generating test reports, and positioning and fixing the reports, and optimizing the test process using the scheduling model.

Benefits of technology

It improves the utilization rate of test resources, reduces resource waste, timely discovers and optimizes test cases with low efficiency or failed, and improves problem-solving efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119226151A_ABST
    Figure CN119226151A_ABST
Patent Text Reader

Abstract

The invention discloses a self-adaptive test execution method and device, electronic equipment and a storage medium. The method comprises the steps that a test case set and test resources are acquired; performing test execution and tracking record processing on the test case set to obtain an execution result; monitoring the occupancy condition of the test resources to obtain a resource occupancy result; according to the execution result and the resource occupation result, executing sequence dynamic adjustment processing is conducted on the test case set, and a test process is obtained; performing execution processing on the test case set according to the test process to obtain a test report; and performing problem positioning and repairing processing on the test report to obtain a feedback result. The embodiment of the invention can improve the testing efficiency, and can be widely applied to the technical field of automatic testing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of automatic testing technology, and in particular to an adaptive testing execution method, device, electronic device and storage medium. Background Art

[0002] Hardware-in-the-loop (HIL) testing is an important means of functional verification of automotive electronic control units (ECUs), among which the sequential execution of test cases is a key issue in HIL testing. However, the execution order of test cases in related technologies is usually fixed and cannot be dynamically adjusted according to the actual execution situation. This may lead to low test efficiency or test cases that fail to be paid attention to and optimized in a timely manner. At the same time, related technologies are also unable to monitor resource usage in real time, resulting in low utilization of test resources and affecting test development efficiency. In summary, the technical problems existing in related technologies need to be improved. Summary of the invention

[0003] The main purpose of the embodiments of the present application is to provide an adaptive test execution method, device, electronic device and storage medium, which can improve test efficiency.

[0004] To achieve the above object, an embodiment of the present application provides an adaptive test execution method, the method comprising:

[0005] Get test case collections and test resources;

[0006] Performing test execution and tracking record processing on the test case set to obtain execution results;

[0007] Monitor and process the occupancy of the test resources to obtain resource occupancy results;

[0008] Dynamically adjust the execution order of the test case set according to the execution result and the resource occupation result to obtain a test process;

[0009] Execute the test case set according to the test process to obtain a test report;

[0010] The test report is used to locate and repair problems and obtain feedback results.

[0011] In some embodiments, the test execution and tracking record processing of the test case set to obtain the execution result includes the following steps:

[0012] Tracking the execution status of each test case in the test case set to obtain the case execution status;

[0013] Record the execution time of the completed test cases to obtain the execution time;

[0014] An execution result is obtained according to the use case execution status and the execution time.

[0015] In some embodiments, obtaining the execution result according to the use case execution status and the execution time includes the following steps:

[0016] Performing statistical processing on the execution status of the use case to obtain statistical indicators;

[0017] A statistical report generation process is performed on the test case according to the statistical indicators and the execution time to obtain an execution result.

[0018] In some embodiments, dynamically adjusting the execution order of the test case set according to the execution result and the resource occupation result to obtain a test process includes at least one of the following steps:

[0019] Performing priority scheduling processing on the test case set according to the execution result and the resource occupancy result to obtain a test process;

[0020] Alternatively, the execution result, the resource occupancy result and the test case set are input into a scheduling model for execution order prediction processing, and the test flow is outputted.

[0021] In some embodiments, the priority scheduling process is performed on the test case set according to the execution result and the resource occupation result to obtain a test process, including the following steps:

[0022] Prioritize the test cases in the test case set according to the execution status and execution time of the execution results to obtain a sorted set;

[0023] The execution order of the sorted sets is adjusted according to the resource occupation result to obtain a test process.

[0024] In some embodiments, the step of inputting the execution result, the resource occupancy result and the test case set into a scheduling model for execution order prediction processing and outputting a test process specifically includes the following steps:

[0025] Performing data preprocessing on the execution result and the resource occupation result to obtain a first data set;

[0026] Performing feature extraction processing on the test case set to obtain a second data set;

[0027] Perform execution order prediction processing on the first data set and the second data set by using the scheduling model to obtain an initial process;

[0028] According to the initial process, the test case set is tested by an automated testing tool to obtain feedback results;

[0029] The scheduling model is updated according to the feedback result, and after reaching an update threshold, a test process is obtained through the scheduling model output.

[0030] In some embodiments, the problem location and repair processing of the test report to obtain a feedback result includes the following steps:

[0031] Determine the failed test case according to the test report;

[0032] Perform exception analysis and log troubleshooting on the failed use case to obtain the exception problem;

[0033] The abnormal problem is repaired and a feedback result is obtained.

[0034] To achieve the above object, another aspect of an embodiment of the present application provides an adaptive test execution device, the device comprising:

[0035] The first module is used to obtain test case collections and test resources;

[0036] The second module is used to perform test execution and tracking record processing on the test case set to obtain execution results;

[0037] The third module is used to monitor the occupancy of the test resources and obtain resource occupancy results;

[0038] A fourth module is used to dynamically adjust the execution order of the test case set according to the execution result and the resource occupation result to obtain a test process;

[0039] The fifth module is used to execute the test case set according to the test process to obtain a test report;

[0040] The sixth module is used to locate and repair the problem in the test report and obtain feedback results.

[0041] In some embodiments, the second module is used to perform test execution and tracking record processing on the test case set to obtain execution results, including:

[0042] The first unit is used to track the execution status of each test case in the test case set to obtain the case execution status;

[0043] The second unit is used to record the execution time of the completed test cases to obtain the execution time;

[0044] The third unit is used to obtain an execution result according to the use case execution status and the execution time.

[0045] In some embodiments, the third unit, used to obtain an execution result according to the use case execution state and the execution time, includes:

[0046] The first subunit is used to perform statistical processing on the execution status of the use case to obtain statistical indicators;

[0047] The second subunit is used to generate a statistical report for the test case according to the statistical indicators and the execution time to obtain an execution result.

[0048] In some embodiments, the fourth module is used to dynamically adjust the execution order of the test case set according to the execution result and the resource occupation result to obtain a test process, including at least one of the following units:

[0049] A fourth unit is used to perform priority scheduling processing on the test case set according to the execution result and the resource occupation result to obtain a test process;

[0050] The fifth unit is used to input the execution result, the resource occupancy result and the test case set into the scheduling model for execution order prediction processing, and output a test process.

[0051] In some embodiments, the fourth unit is used to perform priority scheduling processing on the test case set according to the execution result and the resource occupation result to obtain a test process, including:

[0052] A third subunit is used to prioritize the test cases in the test case set according to the case execution status and execution time of the execution result to obtain a sorted set;

[0053] The fourth subunit is used to adjust the execution order of the sorted set according to the resource occupation result to obtain a test process.

[0054] In some embodiments, the fifth unit is used to input the execution result, the resource occupancy result and the test case set into the scheduling model for execution order prediction processing, and output a test process, including:

[0055] A fifth subunit, configured to perform data preprocessing on the execution result and the resource occupation result to obtain a first data set;

[0056] A sixth subunit is used to perform feature extraction processing on the test case set to obtain a second data set;

[0057] A seventh subunit is used to perform execution order prediction processing on the first data set and the second data set by using the scheduling model to obtain an initial process;

[0058] An eighth subunit is used to execute test processing on the test case set through an automated testing tool according to the initial process to obtain feedback results;

[0059] The ninth subunit is used to update the scheduling model according to the feedback result, and after reaching the update threshold, obtain the test process through the scheduling model output.

[0060] In some embodiments, the sixth module is used to locate and repair the problem in the test report to obtain a feedback result, including:

[0061] A sixth unit is used to determine a failed case according to the test report;

[0062] The seventh unit is used to perform abnormal analysis and log troubleshooting on the failed case to obtain the abnormal problem;

[0063] The eighth unit is used to repair the abnormal problem and obtain a feedback result.

[0064] To achieve the above-mentioned purpose, another aspect of an embodiment of the present application provides an electronic device, the electronic device comprising a memory and a processor, the memory storing a computer program, and the processor implementing the above-mentioned method when executing the computer program.

[0065] To achieve the above objective, another aspect of an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described above is implemented.

[0066] The embodiments of the present application include at least the following beneficial effects: the present application provides an adaptive test execution method, device, electronic device and storage medium, which obtains execution results and resource occupancy results by tracking and monitoring a set of test cases and test resources, thereby dynamically adjusting the execution order of the test case set to obtain a test process, and can dynamically adjust the test order according to the monitoring situation, thereby reducing resource waste and improving test resource utilization; and, the present solution also locates and repairs problems in the test report to obtain feedback results, which can help developers locate and repair problems based on the feedback results and improve problem solving efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0067] Figure 1 is a flowchart of an adaptive test execution method provided by an embodiment of the present application;

[0068] Figure 2 yes Figure 1 Flow chart of step S102 in FIG.

[0069] Figure 3 yes Figure 2 Flow chart of step S203 in FIG.

[0070] Figure 4 yes Figure 1 Flow chart of step S104 in FIG.

[0071] Figure 5 yes Figure 4 Flow chart of step S401 in FIG.

[0072] Figure 6 yes Figure 4 Flow chart of step S402 in FIG.

[0073] Figure 7 yes Figure 1 Flow chart of step S106 in FIG.

[0074] Figure 8 It is a structural diagram of an adaptive test execution device provided in an embodiment of the present application;

[0075] Fig. 9 is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application;

[0076] Fig.10 It is a schematic diagram of the hardware structure of the storage medium provided in the embodiment of the present application. DETAILED DESCRIPTION

[0077] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is further described in detail below in conjunction with the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the embodiments of the present application. They are only examples of devices and methods consistent with some aspects of the embodiments of the present application as detailed in the attached claims.

[0078] It is understood that the terms "first", "second", etc. used in this application can be used to describe various concepts in this article, but unless otherwise specified, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another concept. For example, without departing from the scope of the embodiment of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the words "if" and "if" as used herein can be interpreted as "at the time of" or "when" or "in response to determination".

[0079] The terms "at least one", "multiple", "each", "any", etc. used in this application, at least one includes one, two or more, multiple includes two or more, each refers to each of the corresponding multiple, and any refers to any one of the multiple.

[0080] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0081] Before describing the embodiments of the present application in detail, some nouns and terms involved in the embodiments of the present application are first described. The nouns and terms involved in the embodiments of the present application are subject to the following explanations.

[0082] 1) Hardware-in-the-Loop (HIL) is a powerful testing method that can be used to test embedded control systems more effectively. Hardware-in-the-Loop testing is a key step in the development of hybrid controllers and component controllers. It can verify the controller function before bench tests and road tests, shortening the controller development cycle. Build a hybrid hardware-in-the-loop test system to perform hardware-in-the-loop testing on the vehicle controller and component controller.

[0083] 2) Test Case is a description of the 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.

[0084] 3) An intelligent vehicle is a comprehensive system that integrates environmental perception, planning and decision-making, multi-level assisted driving and other functions. It concentrates on the use of computers, modern sensors, information fusion, communications, artificial intelligence and automatic control technologies. It can exchange information with people, vehicles, roads, etc. through the on-board environmental perception system and information terminals, so that the vehicle has intelligent environmental perception capabilities and can automatically analyze the safety and dangerous status of vehicle driving.

[0085] Hardware-in-the-loop (HIL) testing is an important means of functional verification of automotive electronic control units (ECUs), among which the sequential execution of test cases is a key issue in HIL testing. However, the execution order of test cases in related technologies is usually fixed and cannot be dynamically adjusted according to the actual execution situation. This may lead to low test efficiency or test cases that fail to be paid attention to and optimized in a timely manner. At the same time, related technologies are also unable to monitor resource usage in real time, resulting in low utilization of test resources and affecting test development efficiency. In addition, the existing technologies lack test result feedback, which is not conducive to the location and repair of problems. These problems affect the efficiency and quality of HIL testing.

[0086] For example, in hardware-in-the-loop testing, testing is performed using pre-established test cases, and the order of these test cases has been fixed. When a test case fails or occupies a high level of test resources, the test order cannot be dynamically adjusted, which affects test development efficiency.

[0087] In view of this, an adaptive test execution method, device, electronic device and storage medium are provided in the embodiments of the present application. The scheme obtains execution results and resource occupancy results by tracking and monitoring the test case set and test resources, thereby dynamically adjusting the execution order of the test case set to obtain a test process, and can dynamically adjust the test order according to the monitoring situation, reduce resource waste, and improve test resource utilization; in addition, the scheme also locates and repairs problems in the test report to obtain feedback results, which helps developers locate and repair problems based on the feedback results and improves problem solving efficiency.

[0088] An adaptive test execution method provided in an embodiment of the present application relates to the field of automatic testing technology. An adaptive test execution method provided in an embodiment of the present application can be applied to a terminal, can be applied to a server, or can be software running in a terminal or a server. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, and a car terminal, etc., but is not limited to this; the server side can be configured as an independent physical server, or can be configured as a server cluster or a distributed system composed of multiple physical servers, and can also be configured to provide cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and cloud servers for basic cloud computing services such as big data and artificial intelligence platforms. The server can also be a node server in a blockchain network; the software can be an application that implements an adaptive test execution method, etc., but is not limited to the above forms.

[0089] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.

[0090] Figure 1 is an optional flowchart of an adaptive test execution method provided in an embodiment of the present application. Figure 1 The method may include but is not limited to steps S101 to S106.

[0091] Step S101, obtaining a test case set and test resources;

[0092] Step S102, performing test execution and tracking and recording processing on the test case set to obtain execution results;

[0093] Step S103, monitoring the occupancy of the test resources to obtain resource occupancy results;

[0094] Step S104, dynamically adjusting the execution order of the test case set according to the execution result and the resource occupation result to obtain a test process;

[0095] Step S105, executing the test case set according to the test process to obtain a test report;

[0096] Step S106: locate and repair the problem in the test report to obtain a feedback result.

[0097] Steps S101 to S106 shown in the embodiment of the present application track and record the execution of all test cases in the test case set to obtain the execution results, and monitor the test resources in real time to obtain the resource occupancy results, so as to dynamically adjust the execution order of the test cases according to the execution results and resource occupancy, reduce resource waste, and improve the utilization rate of test resources. The test case set is executed according to the dynamically adjusted test process to obtain the corresponding test report. Through the test report, problems that occurred during the test process can be found, so as to locate the problem location, which helps developers locate and fix problems and improve test development efficiency.

[0098] In step S101 of some embodiments, the test case set includes test cases formed according to hardware-in-the-loop testing, and the test case set can be obtained by a user writing a test case, or it can be obtained from a test case library. Test resources are system environment resources required by the test case, such as memory, network bandwidth and other resources. It is conceivable that the test cases in the embodiments of the present application include not only test cases applied to hardware-in-the-loop testing, but also test cases applied to other software testing.

[0099] See also Figure 2 In step S102 of some embodiments, the test execution and tracking record processing of the test case set to obtain the execution result includes the following steps:

[0100] Step S201, tracking the execution status of each test case in the test case set to obtain the case execution status;

[0101] Step S202, recording the execution time of the completed test case to obtain the execution time;

[0102] Step S203, obtaining an execution result according to the use case execution status and the execution time.

[0103] In an embodiment of the present application, the use case execution status of each test case in the test case set is tracked in real time, and the use case execution status may include states such as being executed, completed, and failed to execute. The embodiment of the present application can monitor the execution result of each test case in real time through the log or report function of the test framework to obtain the use case execution status. And the execution time of the test case whose use case execution status is completed is recorded, and the execution time includes the execution start time, the execution end time, the execution duration, etc. The execution time can be recorded by a timestamp and saved in a database. The execution result of the test case can be obtained by recording the use case execution status and execution time obtained, and the execution result includes the use case execution status and execution time corresponding to the test case. The embodiment of the present application tracks and records the execution status and execution time of the test case, so that the execution order of the test case can be adjusted according to the execution result of the test case, thereby improving the efficiency of the test.

[0104] See also Figure 3 In step S203 of some embodiments, obtaining the execution result according to the use case execution state and the execution time includes the following steps:

[0105] Step S301, statistically processing the execution status of the use case to obtain statistical indicators;

[0106] Step S302: generating a statistical report for the test case according to the statistical indicators and the execution time to obtain an execution result.

[0107] In an embodiment of the present application, the use case execution status of each test case in the software statistics test set can be used to calculate the corresponding statistical indicators, including the test pass rate, test failure rate, etc. Then, the test case can be analyzed and processed according to the statistical indicators and execution time to generate the corresponding execution results, which can be displayed in the form of a chart to show the execution efficiency and execution quality of the test case. By generating the execution results, the embodiment of the present application can provide a data basis for the subsequent adjustment of the execution order of the test case.

[0108] In step S103 of some embodiments, the occupancy of test resources is monitored and processed. System monitoring tools (such as top, htop, vmstat, etc.) or special performance testing tools (such as JMeter, LoadRunner, etc.) can be used to monitor the occupancy of resources such as CPU, memory, disk I / O, network bandwidth, etc. to obtain resource occupancy results.

[0109] See also Figure 4In step S104 of some embodiments, dynamically adjusting the execution order of the test case set according to the execution result and the resource occupancy result to obtain a test process includes at least one of the following steps:

[0110] Step S401, performing priority scheduling processing on the test case set according to the execution result and the resource occupation result to obtain a test process;

[0111] Step S402, alternatively, the execution result, the resource occupancy result and the test case set are input into a scheduling model for execution order prediction processing, and the test flow is outputted.

[0112] In an embodiment of the present application, the execution order of the test case set is dynamically adjusted according to the execution results and resource occupancy results of the test case. A dynamic adjustment method based on a priority scheduling algorithm can be adopted, or a neural network model based on deep learning can be adopted for dynamic adjustment to obtain an adjusted test process. The embodiment of the present application analyzes the execution results and resource occupancy results to dynamically adjust the execution order and execution strategy of the test case, effectively improving the efficiency and quality of the hardware-in-the-loop test of the vehicle controller.

[0113] See also Figure 5 In step S401 of some embodiments, the priority scheduling process is performed on the test case set according to the execution result and the resource occupancy result to obtain a test process, including the following steps:

[0114] Step S501, performing priority sorting processing on the test cases in the test case set according to the case execution status and execution time of the execution result to obtain a sorted set;

[0115] Step S502: adjusting the execution order of the sorted set according to the resource occupation result to obtain a test process.

[0116] In the embodiment of the present application, the execution result and execution time of each test case in the test case set can be known from the execution result, so as to define the priority of the test case according to the execution result and execution time, for example, the priority of the test case with the execution result of execution failure is increased, or the priority of the test case with a long execution time is increased, so as to give priority to the test case with a long execution time or execution failure during the execution process, so as to find problems and optimize as early as possible. According to the determined priority, the test cases in the test case set can be sorted from high to low by priority to obtain a sorted set. Then, the execution of the test case is dynamically adjusted according to the resource occupancy result, and the test case with insufficient resources is suspended or skipped to obtain a dynamically adjusted test process. For example, if a test case fails to execute and causes system resource shortage, the execution of the test case can be suspended, and other test cases with less resource occupancy can be executed instead, and the test order can be adjusted to ensure the smooth progress of the test process. The embodiment of the present application can timely discover and optimize the test cases with low efficiency or execution failure by dynamically adjusting the execution order of the test case, improve the utilization rate of the test resources, and avoid resource waste.

[0117] See also Figure 6 In step S402 of some embodiments, the execution result, the resource occupancy result and the test case set are input into a scheduling model for execution order prediction processing, and the test flow is output, which specifically includes the following steps:

[0118] Step S601, performing data preprocessing on the execution result and the resource occupation result to obtain a first data set;

[0119] Step S602, performing feature extraction processing on the test case set to obtain a second data set;

[0120] Step S603, performing execution order prediction processing on the first data set and the second data set through the scheduling model to obtain an initial process;

[0121] Step S604, performing test processing on the test case set through an automated testing tool according to the initial process to obtain feedback results;

[0122] Step S605, updating the scheduling model according to the feedback result, and obtaining the test process through the scheduling model output after reaching the update threshold.

[0123] In an embodiment of the present application, data preprocessing is performed on the execution results and resource occupancy results, wherein the execution results include the success, failure, blocking and other states of the test case, and the resource occupancy results are resource occupancy data such as CPU, memory, disk I / O, network bandwidth, etc. when each test case is executed. The first data set is obtained by cleaning and formatting the execution results and resource occupancy data, so that it is suitable as the input of the machine learning model. The test case set is converted into a feature vector that the model can understand, for example, by encoding dependency relationships, functional classifications and other information to obtain a second data set. The first data set and the second data set are processed for execution order prediction by the scheduling model, wherein the scheduling model can select a suitable machine learning model such as a decision tree, random forest, neural network, etc. according to the complexity of the problem and the characteristics of the data. In an embodiment of the present application, the scheduling model adopts a recurrent neural network, and the scheduling model is trained with historical data to make the scheduling model learn how to predict the optimal execution order according to the characteristics of the test case and the resource occupancy, and the performance of the model is evaluated using methods such as cross-validation to ensure that the model can accurately predict the test process. The first data set and the second data set are processed for execution order prediction by the trained scheduling model to obtain the initial process. Then the initial process is executed, and the test case set is executed and tested by the automated test tool according to the test process output by the scheduling model. During the execution process, the resource occupancy is continuously monitored, and the test execution strategy is adjusted as needed, and the test results, including success rate, failure rate, and resource usage, are analyzed. The new execution results and resource occupancy data are fed back to the scheduling model for continuous optimization and updating of the model. The embodiment of the present application updates the scheduling model by regularly using new execution results and resource occupancy data to adapt to project changes and improve prediction accuracy. After reaching the update threshold, the final test process is obtained by outputting the scheduling model. It can be imagined that the update threshold can be set according to actual conditions. In the embodiment of the present application, it is set to five times, and the final test process is output after updating the scheduling model five times. The embodiment of the present application predicts the test process through a machine learning model, and can predict the best execution order according to the execution efficiency and execution results of the test case, improve the accuracy of the prediction through artificial intelligence technology, make the test process more accurate, and be able to efficiently complete the test task, and continuously adjust the test process and scheduling strategy to achieve higher test efficiency and quality.

[0124] In step S105 of some embodiments, the test case set is executed according to the adjusted test process, the order of the test cases is adjusted and executed, and a test report is obtained. The test report includes the execution results of the test cases and resource usage. Among them, the actual execution results of the test cases are compared and analyzed with the expected results to evaluate the effectiveness and accuracy of the test. If the actual execution results are consistent with the expected results, it is "passed", and if they are inconsistent, it is "failed". At the same time, the test report indicates the reasons for failure or the reasons and explanations that may lead to failure.

[0125] See also Figure 7 In step S106 of some embodiments, the problem location and repair processing of the test report to obtain a feedback result includes the following steps:

[0126] Step S701, determining a failed test case according to the test report;

[0127] Step S702, performing abnormal analysis and log checking on the failed use case to obtain abnormal problems;

[0128] Step S703, repair the abnormal problem and obtain a feedback result.

[0129] In an embodiment of the present application, a failed case can be found from a test report, and a detailed description of the failure in the test report is analyzed, including the name of the test case, the operating steps when the failure occurred, the comparison between the expected result and the actual result, etc. By performing an exception analysis on the failed case, any abnormal stack trace, error code or error message appearing in the test report is checked according to the abnormal information, and the log content related to the test failure is checked, so as to specifically locate the abnormal problem, and then formulate a corresponding repair plan according to the nature and scope of the abnormal problem, and obtain a feedback result, which includes the abnormal problem and the corresponding repair plan. The embodiment of the present application can provide feedback results, thereby providing problem location and repair plans, which help developers to quickly locate and repair problems and improve problem solving efficiency.

[0130] The following is a detailed description of the embodiments of the present invention with reference to specific application examples:

[0131] The embodiment of the present application can be applied to the field of automatic testing technology. In a feasible implementation mode, the present application is applied to the hardware-in-the-loop test in the intelligent vehicle, and the corresponding test cases are written for the functions of the vehicle controller, such as writing corresponding test cases for the whole vehicle power on and off, accessory control, battery control, etc. to obtain a test case set, and obtain the corresponding test resources. By tracking and recording the test cases in the test case set, and monitoring the test resources, the execution result and resource occupancy of each test case are obtained, and the test case set is dynamically adjusted and processed based on the priority adjustment algorithm or machine learning model, and the execution and resource usage of the test case are monitored in real time, and the test order is dynamically adjusted according to the actual situation to obtain the test process. The test case set is executed according to the dynamically adjusted test process, and the test order is adjusted by pausing or skipping some test cases to obtain the adjusted test report, and the problem is located and repaired according to the test report, and the feedback result is obtained, and the feedback result is sent to the developer, which helps the developer to locate and repair the problem and improve the problem solving efficiency. The adaptive test execution method of the embodiment of the present application can be applied to various types of test cases and test scenarios, and has good scalability.

[0132] See also Figure 8 The embodiment of the present application further provides an adaptive test execution device, which can implement the above-mentioned adaptive test execution method, and the device includes:

[0133] The first module 801 is used to obtain a test case set and test resources;

[0134] The second module 802 is used to perform test execution and tracking and recording processing on the test case set to obtain execution results;

[0135] The third module 803 is used to monitor the occupancy of the test resources and obtain resource occupancy results;

[0136] The fourth module 804 is used to dynamically adjust the execution order of the test case set according to the execution result and the resource occupation result to obtain a test process;

[0137] The fifth module 805 is used to execute the test case set according to the test process to obtain a test report;

[0138] The sixth module 806 is used to locate and repair the problem in the test report to obtain a feedback result.

[0139] It can be understood that the contents of the above method embodiments are all applicable to the present device embodiments, the functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0140] The embodiment of the present application also provides an electronic device, the electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the above-mentioned adaptive test execution method when executing the computer program. The electronic device can be any intelligent terminal including a tablet computer, a car computer, etc.

[0141] It can be understood that the contents of the above method embodiments are all applicable to the present device embodiments, the functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0142] See also Fig. 9 , Fig. 9 The hardware structure of an electronic device of another embodiment is illustrated, and the electronic device includes:

[0143] The processor 901 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application.

[0144] The memory 902 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 902 can store an operating system and other application programs. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 902, and the processor 901 calls and executes the adaptive test execution method of the embodiment of this application;

[0145] Input / output interface 903, used to implement information input and output;

[0146] Communication interface 904, used to realize communication interaction between the device and other devices, which can be realized through wired mode (such as USB, network cable, etc.) or wireless mode (such as mobile network, WI FI, Bluetooth, etc.);

[0147] A bus 905 that transmits information between various components of the device (e.g., the processor 901, the memory 902, the input / output interface 903, and the communication interface 904);

[0148] The processor 901 , the memory 902 , the input / output interface 903 and the communication interface 904 are connected to each other in communication within the device via a bus 905 .

[0149] See also Fig.10 The embodiment of the present application further provides a computer-readable storage medium 1001, which stores a computer program 1002, and when the computer program is executed by a computer processor 1003, the above-mentioned adaptive test execution method is implemented.

[0150] It can be understood that the contents of the above method embodiments are all applicable to the present storage medium embodiments, the functions specifically implemented by the present storage medium embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0151] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0152] An adaptive test execution method, device, electronic device and storage medium provided in an embodiment of the present application, the solution obtains execution results and resource occupancy results by tracking and monitoring a set of test cases and test resources, thereby dynamically adjusting the execution order of the test case set to obtain a test process, and being able to dynamically adjust the test order according to the monitoring situation, thereby reducing resource waste and improving test resource utilization; and, the solution also locates and repairs problems in the test report to obtain feedback results, which are helpful for developers to locate and repair problems based on the feedback results, thereby improving problem solving efficiency.

[0153] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0154] Those skilled in the art will appreciate that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.

[0155] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0156] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.

[0157] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0158] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0159] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0160] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0161] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0162] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.

[0163] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights of the present invention.

Claims

1. An adaptive test execution method, characterized in that: The method comprises the following steps: Get test case collections and test resources; Performing test execution and tracking record processing on the test case set to obtain execution results; Monitor and process the occupancy of the test resources to obtain resource occupancy results; Dynamically adjust the execution order of the test case set according to the execution result and the resource occupation result to obtain a test process; Execute the test case set according to the test process to obtain a test report; The test report is used to locate and repair problems and obtain feedback results.

2. The method according to claim 1, characterized in that The test execution and tracking record processing of the test case set to obtain the execution result includes the following steps: Tracking the execution status of each test case in the test case set to obtain the case execution status; Record the execution time of the completed test cases to obtain the execution time; An execution result is obtained according to the use case execution status and the execution time.

3. The method according to claim 2, characterized in that The step of obtaining the execution result according to the use case execution status and the execution time includes the following steps: Performing statistical processing on the execution status of the use case to obtain statistical indicators; A statistical report generation process is performed on the test case according to the statistical indicators and the execution time to obtain an execution result.

4. The method according to claim 1, characterized in that: The execution order of the test case set is dynamically adjusted according to the execution result and the resource occupation result to obtain a test process, Includes at least one of the following steps: Performing priority scheduling processing on the test case set according to the execution result and the resource occupancy result to obtain a test process; Alternatively, the execution result, the resource occupancy result and the test case set are input into a scheduling model for execution order prediction processing, and the test flow is outputted.

5. The method according to claim 4, characterized in that The step of performing priority scheduling on the test case set according to the execution result and the resource occupancy result to obtain a test process includes the following steps: Prioritize the test cases in the test case set according to the execution status and execution time of the execution results to obtain a sorted set; The execution order of the sorted sets is adjusted according to the resource occupation result to obtain a test process.

6. The method according to claim 4, characterized in that The step of inputting the execution result, the resource occupancy result and the test case set into a scheduling model for execution order prediction processing and outputting a test process specifically includes the following steps: Performing data preprocessing on the execution result and the resource occupation result to obtain a first data set; Performing feature extraction processing on the test case set to obtain a second data set; Perform execution order prediction processing on the first data set and the second data set by using the scheduling model to obtain an initial process; According to the initial process, the test case set is tested by an automated testing tool to obtain feedback results; The scheduling model is updated according to the feedback result, and after reaching an update threshold, a test process is obtained through the scheduling model output.

7. The method according to any one of claims 1 to 6, characterized in that: The problem location and repair processing of the test report to obtain feedback results includes the following steps: Determine the failed test case according to the test report; Perform exception analysis and log troubleshooting on the failed use case to obtain the exception problem; The abnormal problem is repaired and a feedback result is obtained.

8. An adaptive test execution device, characterized in that: The device comprises: The first module is used to obtain test case collections and test resources; The second module is used to perform test execution and tracking record processing on the test case set to obtain execution results; The third module is used to monitor the occupancy of the test resources and obtain resource occupancy results; A fourth module is used to dynamically adjust the execution order of the test case set according to the execution result and the resource occupation result to obtain a test process; The fifth module is used to execute the test case set according to the test process to obtain a test report; The sixth module is used to locate and repair the problem in the test report and obtain feedback results.

9. An electronic device, characterized in that: The electronic device comprises a memory and a processor, the memory stores a computer program, and the processor implements the method according to any one of claims 1 to 7 when executing the computer program.

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

Citation Information

Cited By

  • Automatic testing method and device based on multiple intelligent algorithms and electronic equipment

    CN119621589A

  • An automated testing method, device and electronic equipment based on multi-intelligent algorithm

    CN119621589B

  • Control method, system and device and storage medium

    CN119861591A