Automatic test parameter configuration method and device, vehicle and storage medium
By automatically generating and optimizing test scripts, the problems of traditional manual testing inefficient and automation tools cannot automate configuration parameters are solved, efficient and accurate automotive software testing is achieved, and testing quality and efficiency are improved.
Patent Information
- Application Number
- CN202411212750.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2024-12-06
AI Technical Summary
Traditional manual testing methods are difficult to meet the efficient and accurate needs of automotive software testing, and existing automation tools cannot realize automated configuration of test parameters, resulting in low testing efficiency and low quality.
By obtaining the test parameters of the target vehicle, generating test scripts, executing and optimizing the test parameters, forming a closed loop, and automatically generating updated test scripts, minimizing manual intervention and improving parameter configuration efficiency.
It significantly improves the testing work efficiency, ensures continuous improvement of test quality, reduces human errors, and improves the reliability of defect detection capabilities and software quality.
Smart Images

Figure CN119088702A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of automated testing, and in particular to an automated testing parameter configuration method, device, vehicle, and storage medium. Background Art
[0002] Automated test parameter configuration is an important research direction in the testing field. As the complexity of products continues to increase, traditional manual testing methods can no longer meet the needs of efficiency and accuracy. Therefore, automated testing technology has emerged and has made significant progress in recent years. Among them, automotive software operating conditions are complex, the complexity of automated testing is also high, and the testing workload is relatively large. All aspects of automotive software testing strive to achieve the greatest degree of automation and intelligence.
[0003] In related technologies, automation platforms are inseparable from common tools such as code repositories, product repositories, and integration platforms. However, these tools can only enable the test platform to achieve systematic and online development management, and still require frequent manual modifications, and cannot achieve automated configuration of test parameters. Summary of the invention
[0004] The main purpose of the embodiments of the present application is to propose an automated test parameter configuration method, device, vehicle and storage medium, aiming to improve the parameter configuration efficiency of automated testing.
[0005] To achieve the above object, a first aspect of an embodiment of the present application proposes an automated test parameter configuration method, the method comprising:
[0006] Obtaining test parameters corresponding to the target vehicle and generating a corresponding target test script;
[0007] Execute the target test script to obtain first test data corresponding to the test parameters;
[0008] Optimizing the test parameters according to the first test data to obtain optimized test parameters;
[0009] Update the target test script according to the optimized test parameters to obtain the updated target test script;
[0010] Execute the updated target test script to obtain second test data corresponding to the updated target test script;
[0011] In response to the second test data satisfying a preset test condition, the optimized test parameters are determined as target configuration parameters of the target vehicle.
[0012] In some embodiments, obtaining test parameters corresponding to the target vehicle and generating a corresponding target test script includes:
[0013] Obtaining the test parameters and a preset test script template data set;
[0014] According to the test parameters, a target test template is determined in the test script template data set, and the target test script is generated.
[0015] In some embodiments, the test parameters include a test type, a test environment, a test object, and a test indicator, and determining a target test template in the test script template data set according to the test parameters includes:
[0016] According to the test type, the test environment and the test object, determining a corresponding target test script template in the script template data set; wherein the script template data set includes a plurality of test script templates, each of the test script templates corresponding to a combination of one or more test types, test environments and test objects;
[0017] Replace the preset placeholders in the target test script template according to the test indicators to generate an initial test script;
[0018] Performing logic verification on the initial test script based on preset test logic rules;
[0019] When the initial test script satisfies the preset test logic rule, the initial test script is determined as the target test script corresponding to the test parameter.
[0020] In some embodiments, when the first test data is numerical data, optimizing the test parameter according to the first test data to obtain the optimized test parameter includes:
[0021] Comparing the first test data with preset standard data to obtain numerical deviation data;
[0022] Analyzing the numerical deviation data according to a preset optimization rule to determine the optimization direction and optimization range of the first test parameter;
[0023] The test parameters are adjusted according to the optimization direction and the optimization range to obtain optimized test parameters.
[0024] In some embodiments, analyzing the numerical deviation data according to a preset optimization rule to determine the optimization direction and optimization range of the first test parameter includes:
[0025] Comparing the numerical deviation data with a preset deviation threshold range, wherein the deviation threshold range includes an upper threshold and a lower threshold;
[0026] When the numerical deviation data is greater than the upper threshold, the optimization direction of the test parameter is determined to be decreasing, and the difference between the numerical deviation data and the upper threshold is multiplied by a preset first weight coefficient to obtain the optimization amplitude of the test parameter;
[0027] When the numerical deviation data is less than the lower limit threshold, the optimization direction of the test parameter is determined to be increasing, and the difference between the lower limit threshold and the numerical deviation data is multiplied by a preset second weight coefficient to obtain the optimization amplitude of the test parameter;
[0028] When the numerical deviation data is between the upper threshold and the lower threshold, the optimization direction of the test parameter is determined to remain unchanged, and the optimization amplitude of the test parameter is determined to be zero.
[0029] In some embodiments, before executing the updated target test script, the method further includes:
[0030] Performing a risk assessment on the updated test parameters according to a preset risk assessment rule to determine the risk level of the updated test parameters;
[0031] When the risk level exceeds the preset risk condition, a risk warning is triggered, and the updated test parameters are adjusted according to the preset risk handling strategy;
[0032] The test script is updated with the adjusted test parameters, and the updated test script is executed to obtain third test data corresponding to the adjusted test parameters.
[0033] In some embodiments, before executing the target test script to obtain the first test data corresponding to the test parameter, the method further includes:
[0034] Acquire dynamic environmental test data of the target vehicle; wherein the dynamic environmental data includes at least one of the geographical location, weather conditions, road type and traffic conditions of the vehicle;
[0035] Dynamically adjusting the test parameters according to the dynamic environmental test data to obtain environmental test parameters adapted to the current environment;
[0036] Generate a corresponding target test script according to the environmental test parameters and the target test script template.
[0037] To achieve the above-mentioned purpose, a second aspect of an embodiment of the present application provides an automated test parameter configuration device, the device comprising:
[0038] An acquisition module, used to acquire test parameters corresponding to a target vehicle and generate a corresponding target test script;
[0039] A first execution module, used for executing the target test script to obtain first test data corresponding to the test parameters;
[0040] an optimization module, used for optimizing the test parameters according to the first test data to obtain optimized test parameters;
[0041] A second execution module, used to execute the updated target test script, obtain second test data corresponding to the updated target test script, and when the second test data meets the preset test conditions, determine the optimized test parameters as target configuration parameters;
[0042] A response module is used to determine the optimized test parameters as target configuration parameters of the target vehicle in response to the second test data satisfying a preset test condition.
[0043] To achieve the above-mentioned purpose, a third aspect of an embodiment of the present application proposes a vehicle, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the method described in the first aspect when executing the computer program.
[0044] To achieve the above-mentioned purpose, the fourth aspect of an embodiment of the present application proposes 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 in the first aspect is implemented.
[0045] The present application proposes an automated test parameter configuration method, device, vehicle and storage medium, including obtaining test parameters corresponding to a target vehicle and generating a corresponding target test script; executing the target test script to obtain first test data corresponding to the test parameters; optimizing the test parameters according to the first test data to obtain optimized test parameters; updating the target test script according to the optimized test parameters to obtain an updated target test script; executing the updated target test script to obtain second test data corresponding to the updated target test script; in response to the second test data satisfying a preset test condition, determining the optimized test parameters as the target configuration parameters of the target vehicle. After obtaining the test parameters, the present application can automatically generate the corresponding test script, avoiding the cumbersome process of manually writing scripts. At the same time, by analyzing the results of the first round of tests, the parameters are automatically optimized and adjusted, and an updated test script is generated again, forming a closed loop to improve the configuration quality and the efficiency of parameter configuration. The entire parameter configuration process minimizes manual intervention, avoids human errors, and greatly improves the efficiency of parameter configuration. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1is a flow chart of the automated test parameter configuration method provided in an embodiment of the present application;
[0047] Figure 2 Another schematic diagram of the process of configuring the automated test parameters provided in the embodiment of the present application;
[0048] Figure 3 Another schematic diagram of the process of configuring the automated test parameters provided in the embodiment of the present application;
[0049] Figure 4 Another schematic diagram of the process of configuring the automated test parameters provided in the embodiment of the present application;
[0050] Figure 5 Another schematic diagram of the process of configuring the automated test parameters provided in the embodiment of the present application;
[0051] Figure 6 Another schematic diagram of the process of configuring the automated test parameters provided in the embodiment of the present application;
[0052] Figure 7 Another schematic diagram of the process of configuring the automated test parameters provided in the embodiment of the present application;
[0053] Figure 8 It is a structural diagram of an automated test parameter configuration device provided in an embodiment of the present application;
[0054] Fig. 9 It is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION
[0055] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0056] It should be noted that, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first", "second", etc. in the specification, claims and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0057] 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.
[0058] As automotive electronics and software systems become increasingly complex, the workload of automotive software testing is also increasing. Traditional manual testing methods can no longer meet the needs of efficiency and accuracy, so automated testing technology has emerged and made great progress. The automotive software testing process is complex and the working conditions are changeable, which puts more stringent requirements on automated testing and urgently needs to realize the automation and intelligence of the testing process.
[0059] Currently, tools such as code warehouses, product warehouses, and continuous integration platforms (such as Jenkins) are widely used in the field of software development and testing, which have achieved the systematization and onlineization of software development management. However, these tools mainly solve the problems of development process and product management, and cannot directly improve the efficiency of software testing, nor can they effectively solve the challenges faced by software testing, such as insufficient manpower, tight construction time, and huge workload.
[0060] For automotive software testing, there are many test cases and the test scenarios are complex and changeable. Each test case requires the configuration of a large number of test parameters, such as test input data, expected results, execution environment, etc. The traditional manual configuration method is not only inefficient but also prone to errors, which brings a heavy burden to the testing work. On the other hand, different car models correspond to different software versions, and the test parameters need to be frequently adjusted according to the actual situation, and the workload of manual configuration is even greater. In addition, during the software testing process, it is often necessary to optimize the test parameters based on the preliminary test results to discover more potential defects. The process of manually optimizing parameters is also very inefficient and time-consuming. If the parameter optimization is not in place, it will directly affect the final test quality.
[0061] Therefore, in the field of automotive software testing, there is an urgent need for an automated test parameter configuration method to improve configuration efficiency, reduce manpower input, and ensure test quality through intelligent optimization, thereby truly solving the problems faced in this field.
[0062] Based on this, the embodiments of the present application provide an automated test parameter configuration method, device, vehicle and storage medium, aiming to improve the parameter configuration efficiency of automated testing.
[0063] Further explanation is given below based on the accompanying drawings.
[0064] The automated test parameter configuration method provided in the embodiment of the present application relates to the field of artificial intelligence technology. The automated test parameter configuration method provided in the embodiment of the present application can be applied to a terminal, can also be applied to a server side, and can also be software running in a terminal or a server side. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a vehicle-mounted computer, etc.; 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 as a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application that implements the automated test parameter configuration method, etc., but is not limited to the above forms.
[0065] 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.
[0066] It should be noted that in each specific implementation of the present application, when it comes to the need to perform relevant processing based on data related to user identity or characteristics such as user information, user behavior data, user historical data, and user location information, the user's permission or consent will be obtained first, and the collection, use, and processing of these data will comply with the relevant laws, regulations, and standards of the relevant countries and regions. In addition, when the embodiment of the present application needs to obtain the user's sensitive personal information, the user's separate permission or consent will be obtained through a pop-up window or by jumping to a confirmation page. After clearly obtaining the user's separate permission or consent, the necessary user-related data for the normal operation of the embodiment of the present application will be obtained.
[0067] Figure 1 is an optional flowchart of the automated test parameter configuration method provided in the embodiment of the present application. Figure 1The method may include but is not limited to steps S101 to S106.
[0068] Step S101, obtaining test parameters corresponding to a target vehicle and generating a corresponding target test script.
[0069] Step S102, executing the target test script to obtain first test data corresponding to the test parameters.
[0070] Step S103, optimizing the test parameters according to the first test data to obtain optimized test parameters.
[0071] Step S104, updating the target test script according to the optimized test parameters to obtain an updated target test script.
[0072] Step S105, execute the updated target test script to obtain second test data corresponding to the updated target test script.
[0073] Step S106 , in response to the second test data satisfying the preset test conditions, determining the optimized test parameters as target configuration parameters of the target vehicle.
[0074] Steps S101 to S106 shown in the embodiment of the present application, by automatically acquiring the test parameters of the target vehicle and automatically generating the corresponding test script, greatly reduce manual repetitive work and significantly improve the work efficiency of the test. Compared with the cumbersome process that required manual configuration and writing bit by bit before, this automated method enables a large amount of testing work to be completed efficiently in a short time, saving a lot of time and cost. At the same time, the test parameter optimization link is introduced. By analyzing the results of the first round of tests, the original parameters are optimized and adjusted, and then the test script is regenerated and executed. This closed-loop optimization mechanism ensures the continuous improvement of test quality, allowing more potential defects to be discovered and resolved. Compared with traditional testing, this method significantly improves the defect detection capability and ensures the reliability of software quality.
[0075] In step S101 of some embodiments, relevant information of the target vehicle may be collected first, such as vehicle model, software version, etc. Then, according to preset rules and templates, a list of test parameters to be configured is automatically determined, such as test cases, input data, expected results, execution environment, etc. Finally, the system will parse the specific parameter values from the parameter list and call the script generation engine to automatically generate the corresponding executable test script.
[0076] For example, the target vehicle is X, and the software version is V2.0.5. The system parses this information to determine that the test parameters must include the use case ID, input vector, expected CAN message, and execution OS version. Then fill in the actual values from the parameter template, such as use case ID = TC_PWR_001, input vector {0x123, 0x456, ...}, etc., and finally generate the test script X_V2.0.5_PWR_Test.py.
[0077] In step S102 of some embodiments, after obtaining the initial test script, the system will execute the script and run the test cases to obtain the result data of the first round of testing. Such data may include information such as test pass rate, failed cases, and abnormal logs, reflecting the quality and effect of the current test parameter configuration.
[0078] Exemplarily, when the above test script X_V2.0.5_PWR_Test.py is executed, the test process generates result data resu l t_1.xml, which includes 20 test cases, 15 of which pass, 5 fail, and a small number of exception logs.
[0079] In step S103 of some embodiments, based on the first round of test data, the original test parameters can be intelligently analyzed and optimized, such as modifying the test input data, updating the expected results, adjusting the execution environment parameters, etc. The optimization strategy can be rule-based or machine learning model-based. After optimization, a set of test parameters with better quality is obtained.
[0080] For example, analysis found that the failure of 5 use cases was mainly due to the mismatch between input data and actual data. The system traverses the input vectors of these use cases and makes fine adjustments to the input vectors, such as adjusting 0x123 to 0x127. At the same time, the expected CAN message and Linux version configuration can be optimized based on historical data to obtain optimized test parameters.
[0081] In step S104 of some embodiments, the optimized test parameters obtained in step S103 may be used to re-update and generate a test script. Specifically, the script generation engine is called again using the new test parameters as input to output an updated executable test script.
[0082] In step S105 of some embodiments, the updated test script may be executed to run the optimized test case and obtain result data of the second round of testing. The result data may have better quality than the initial data and may detect more potential defects.
[0083] In step S106 of some embodiments, it is possible to evaluate whether the second round of test results meet pre-set quality standards, such as test coverage, defect detection rate, etc. If the standards are met, the optimized test parameters are determined as the final configuration parameters of the target vehicle, and subsequent tests will reuse this set of parameters. Otherwise, it may be necessary to optimize and adjust again and re-execute the test until the quality meets the standards.
[0084] See also Figure 2 In some embodiments, step S101 may include but is not limited to steps S201 to S202:
[0085] Step S201, obtaining the test parameters and a preset test script template data set.
[0086] Step S202: determining a target test template in the test script template data set according to the test parameters, and generating the target test script.
[0087] In step S201 of some embodiments, the test parameters may be composed of multiple types, and common ones include: use case type, use case ID, execution use case, test description, download path, test task ID, test standard, execution development board, execution type (shell / CANoe), shell path / CANoe number, execution parameters, copy location, file generation location, etc. These parameters reflect the specific requirements and conditions of the test to be executed.
[0088] Among them, the test script template data set is a set of script templates prepared in advance by the system. The templates vary according to different test frameworks, language environments, test types, etc., such as unittest templates, selenium templates, API test templates, etc.
[0089] In step S202 of some embodiments, the most matching target test template can be determined in the template data set according to the test parameters obtained in step S201. Based on parameters such as test type, framework language, execution environment, etc., after pattern matching or rule judgment, the most suitable template is selected from the template set, and the target test template is filled with the relevant parameters in S201 to obtain the target test script.
[0090] Through step S201 to step S202, a personalized test script can be automatically generated by combining the test parameters and the template, thereby greatly improving the configuration efficiency and reducing the workload of manual coding. The method can also flexibly select different script templates according to different test requirements, providing good adaptability and scalability.
[0091] See also Figure 3In some embodiments, step S202 may include but is not limited to steps S301 to S304:
[0092] Step S301: determining a corresponding target test script template in the script template data set according to the test type, the test environment and the test object.
[0093] Step S302: Replace the preset placeholders in the target test script template according to the test indicators to generate an initial test script.
[0094] Step S303: Perform logic verification on the initial test script based on preset test logic rules.
[0095] Step S304: in response to the initial test script satisfying the preset test logic rule, determining the initial test script as the target test script corresponding to the test parameter.
[0096] In step S301 of some embodiments, the applicable target test script template can be accurately matched and determined according to the information of the three dimensions of test type, test environment and test object specified by the test parameters. The script template data set contains a variety of different types of test script templates, each of which is designed for a specific test type, environment and object scenario. Only by correctly matching these three conditions can the most suitable template be selected. For example, the a-class template is more suitable for UI function testing, the b-class template is more suitable for API testing, and the c-class template is more suitable for embedded system testing. Therefore, only by accurately obtaining and judging the test type, environment and object information can the test script generated subsequently be ensured to meet the actual needs. For example, if the test parameters are API testing, Linux environment, and weather data interface, the c-class template is matched.
[0097] In step S302 of some embodiments, after the target test script template is determined, the task of this step is to replace the relevant placeholders in the template according to the actual test indicator data, so as to generate an initialized test script. The so-called test indicator data includes specific information such as the test case name, test description, test input parameters, and expected test results. Only by correctly replacing the placeholders can the generated initial script be ensured to match the actual test requirements.
[0098] In step S303 of some embodiments, after the initialization test script is generated, in order to ensure its logical correctness and compliance, a logic verification step needs to be performed. The basis for the logic verification is a series of pre-set test logic rules, which reflect the basic logic and best practices that the test script should follow. For example, common rules include "the test preparation part must be located before the main test step", "test data and test steps must correspond one to one", etc. By comparing these rules, a comprehensive structure, grammar and logic check is performed on the generated initial script, which can effectively discover and point out any logical defects or non-compliance in the script. Only after logical verification to ensure compliance with all preset rules can the script be considered qualified.
[0099] In step S304 of some embodiments, it can be determined whether the initialization test script satisfies all logic rules according to the result of the logic check. If it passes the check, the initialization script is confirmed as the final target test script and can be directly used in the subsequent execution and optimization links. If it fails to pass the check, it is necessary to return to step S302 according to the problems pointed out by the check results, and supplement or correct the initial script until its logic is correct.
[0100] Through step S301 to step S304, not only can a personalized test script be automatically generated, but also a logic verification link is introduced to ensure the correctness and compliance of the test script, effectively improving the reliability of automated testing.
[0101] See also Figure 4 In some embodiments, when the first test data is numerical data, step S103 may include but is not limited to steps S401 to S403:
[0102] Step S401, comparing the first test data with preset standard data to obtain numerical deviation data.
[0103] Step S402: Analyze the numerical deviation data according to a preset optimization rule to determine the optimization direction and optimization range of the first test parameter.
[0104] Step S403: adjusting the test parameters according to the optimization direction and the optimization range to obtain optimized test parameters.
[0105] In step S401 of some embodiments, the first test data may be compared with pre-set standard data to calculate the numerical deviation data between the two. The so-called standard data refers to the expected ideal test result value, which may be an empirical value, a theoretical value, or a historical baseline value. By comparing with the standard data, the degree of deviation between the first test data and the expectation can be quantified, providing a basis for subsequent optimization and adjustment.
[0106] For example, the first test data is the response time data of a certain functional module, which is 120ms, while the standard response time is 100ms, so the numerical deviation between the two is 120ms-100ms=20ms.
[0107] In step S402 of some embodiments, the deviation data can be analyzed according to a pre-set optimization rule to determine the optimization direction and optimization range of the test parameters. The so-called optimization rule refers to a series of strategies and principles for guiding parameter optimization, which can be empirical rules or rules based on mathematical models. Through rule analysis, it can be determined whether to increase or decrease the value of the parameter, as well as the specific value that needs to be adjusted.
[0108] For example, the optimization rule is "for every 10 ms increase in the response time deviation, the CPU frequency is reduced by 100 MHz". Then for a deviation of 20 ms, the optimization direction is to reduce the CPU frequency, and the optimization range is 200 MHz.
[0109] In step S403 of some embodiments, according to the optimization direction and optimization range determined in step S402, the original test parameter value can be adjusted accordingly to obtain a new optimized parameter value. The adjustment method can be to directly modify the parameter value or to reselect a value from the candidate parameter set. In any case, the purpose is to reduce the numerical deviation during the second test by adjusting the parameter value.
[0110] Through the close coordination of the above three steps, with the help of numerical deviation analysis and optimization rules, the test parameters can be automatically and efficiently optimized and adjusted, constantly approaching the ideal standard test data, and improving the test quality. This data-driven optimization method is more objective and accurate than manual tuning, and is an innovative optimization method in automated testing.
[0111] See also Figure 5 In some embodiments, step S402 may also include but is not limited to steps S501 to S504:
[0112] Step S501 : comparing the numerical deviation data with a preset deviation threshold range, where the deviation threshold range includes an upper threshold and a lower threshold.
[0113] Step S502, when the numerical deviation data is greater than the upper threshold, the optimization direction of the test parameter is determined to be decreasing, and the difference between the numerical deviation data and the upper threshold is multiplied by a preset first weight coefficient to obtain the optimization range of the test parameter.
[0114] Step S503, when the numerical deviation data is less than the lower limit threshold, the optimization direction of the test parameter is determined to be increasing, and the difference between the lower limit threshold and the numerical deviation data is multiplied by a preset second weight coefficient to obtain the optimization range of the test parameter.
[0115] Step S504, when the numerical deviation data is between the upper threshold and the lower threshold, the optimization direction of the test parameter is determined to remain unchanged, and the optimization amplitude of the test parameter is determined to be zero.
[0116] In step S501 of some embodiments, the numerical deviation data obtained in step S401 is compared with a pre-set deviation threshold range. The so-called deviation threshold range refers to a range of upper and lower limits, which is used to determine whether the deviation data is within an acceptable range. The upper threshold is the maximum tolerable value of the deviation, and the lower threshold is the minimum tolerable value of the deviation. By comparing with this interval range, it can be determined whether the current deviation is too large, too small, or normal.
[0117] In step S502 of some embodiments, if the numerical deviation is greater than the upper threshold, it means that the deviation is too large and the test parameter needs to be reduced. This step first determines the optimization direction as reduction, then calculates the difference between the numerical deviation and the upper threshold, and then multiplies it by a preset first weight coefficient to obtain the optimization amplitude value of the test parameter. The weight coefficient is used to adjust the size of the optimization amplitude, and different weight values can be set for different test scenarios.
[0118] In step S503 of some embodiments, if the numerical deviation is less than the lower threshold, it means that the deviation is too small and the test parameter needs to be increased. This step first determines the optimization direction as increasing, then calculates the difference between the lower threshold and the numerical deviation, and then multiplies it by a preset second weight coefficient to obtain the optimization amplitude value of the test parameter. The second weight coefficient here is usually different from the first weight coefficient.
[0119] In step S504 of some embodiments, if the numerical deviation is within the normal range between the upper and lower thresholds, there is no need to adjust the test parameters, and the optimization direction can be determined to remain unchanged and the optimization amplitude can be set to 0, indicating that the test parameters remain unchanged.
[0120] Through steps S501 to S504, not only can the optimization direction and amplitude be automatically determined according to the deviation size, but also the concept of threshold range is introduced, so that normal deviations can be tolerated without adjustment, avoiding unnecessary frequent optimization, and improving the rationality and stability of parameter optimization. At the same time, the weight coefficient provides an adjustable means suitable for different test scenarios. This optimization rule based on threshold interval and weight is more flexible and practical than a single linear rule.
[0121] See also Figure 6 In some embodiments, after step S105, the following steps may also be performed, including but not limited to steps S601 to S602:
[0122] Step S601, performing risk assessment on the updated test parameters according to preset risk assessment rules to determine the risk level of the updated test parameters.
[0123] Step S602: When the risk level exceeds the preset risk condition, a risk warning is triggered, and the updated test parameters are adjusted according to the preset risk handling strategy.
[0124] Step S603: update the test script with the adjusted test parameters, and execute the updated test script to obtain third test data corresponding to the adjusted test parameters.
[0125] In step S601 of some embodiments, after the test parameter optimization and update is completed, a risk assessment process may be performed to ensure the reliability and safety of the new parameters. In automotive software testing, the test parameters may involve key parameters such as engine speed, vehicle speed, throttle opening, braking force, etc. After optimizing and adjusting these parameters, it is necessary to assess the possible risks to ensure the safety and reliability of the automotive system.
[0126] In step S602 of some embodiments, if the evaluation result shows that the risk level of the updated parameter is higher than the preset condition, it is necessary to trigger a risk warning and execute a risk avoidance strategy to adjust the parameter.
[0127] In step S603 of some embodiments, the risk-adjusted parameters are used as test parameters to update the test script to obtain more reliable test data.
[0128] Through these steps, the automated testing of automotive software can not only optimize key parameters, but also integrate risk assessment and avoidance mechanisms to ensure the safety of testing. Risk rules and handling strategies combine engineering practice experience and meet the special requirements of the automotive industry. Automatic optimization and risk control work together to improve test quality while maximizing the reliable operation of automotive systems under various working conditions.
[0129] See also Figure 7 In some embodiments, before step S102, the following steps may also be performed, including but not limited to steps S701 to S703:
[0130] Step S701, obtaining dynamic environment test data of the target vehicle.
[0131] Step S702: dynamically adjust the test parameters according to the dynamic environment test data to obtain environmental test parameters that are suitable for the current environment.
[0132] Step S703: Generate a corresponding target test script according to the environmental test parameters and the target test script template.
[0133] In step S701 of some embodiments, after generating the target test script, the dynamic environment test data of the target vehicle can be obtained. The so-called dynamic environment test data refers to a series of real-time data that can reflect the vehicle's operating environment, such as geographical location, weather conditions, road types, and traffic conditions. These environmental data will have an impact on the configuration of vehicle test parameters. There are many ways to obtain dynamic environment data, which can be read from on-board sensors or collected from external data sources (such as meteorological departments, map services, etc.).
[0134] In step S702 of some embodiments, after the dynamic environment data is obtained, the original test parameters can be dynamically adjusted according to the environment data to obtain a new set of test parameters adapted to the current environment, i.e., the environment test parameters. Under different environments, the corresponding optimal test parameters are different, so they need to be flexibly adjusted according to the environment data. The rules for dynamic adjustment can be pre-set or based on a machine learning model.
[0135] In step S703 of some embodiments, according to the environmental test parameters obtained in step S702, the target test script template may be combined to generate a corresponding final executable test script.
[0136] Through step S701 to step S703, the customized test script can be automatically adjusted and generated according to the real-time dynamic environmental data of the vehicle, thereby improving the pertinence and effectiveness of the test. This dynamic adjustment capability is very important because the vehicle is in a constantly changing and complex environment. Only when the test parameters are dynamically adapted to the environment can the performance of the system under various working conditions be truly reflected, thereby ensuring the comprehensiveness and reliability of the test.
[0137] See also Figure 8 The embodiment of the present application also provides an automated test parameter configuration device, which can implement the above-mentioned automated test parameter configuration method, and the device includes:
[0138] An acquisition module, used to acquire test parameters corresponding to a target vehicle and generate a corresponding target test script;
[0139] A first execution module, used for executing a target test script to obtain first test data corresponding to a test parameter;
[0140] An optimization module, used for optimizing the test parameters according to the first test data to obtain optimized test parameters;
[0141] A second execution module is used to execute the updated target test script to obtain second test data corresponding to the updated target test script, and when the second test data meets the preset test conditions, determine the optimized test parameters as the target configuration parameters;
[0142] The response module is used to determine the optimized test parameters as target configuration parameters of the target vehicle in response to the second test data satisfying the preset test conditions.
[0143] The specific implementation of the automatic test parameter configuration device is basically the same as the specific implementation of the above-mentioned automatic test parameter configuration method, and will not be repeated here.
[0144] The vehicle provided according to the embodiment of the present application may include:
[0145] The vehicle stores a program, and the program is executed to implement any one of the automated test parameter configuration methods provided in the embodiments of the present application. It can be seen that the contents in the above-mentioned automated test parameter configuration method embodiments are applicable to the embodiments of the present vehicle, and the functions specifically implemented by the embodiments of the present vehicle are the same as those in the above-mentioned automated test parameter configuration method embodiments, and the beneficial effects achieved are also the same as those achieved by the above-mentioned automated test parameter configuration method embodiments.
[0146] 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 automatic test parameter configuration method when executing the computer program. The electronic device can be any intelligent terminal including a tablet computer, a car computer, etc.
[0147] See also Fig. 9 , Fig. 9 The hardware structure of an electronic device of another embodiment is illustrated, and the electronic device includes:
[0148] 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;
[0149] 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 automated test parameter configuration method of the embodiment of this application;
[0150] Input / output interface 903, used to implement information input and output;
[0151] 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.);
[0152] 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);
[0153] 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 .
[0154] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the above-mentioned automatic test parameter configuration method is implemented.
[0155] 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.
[0156] The automated test parameter configuration method, device, electronic device and storage medium provided in the embodiment of the present application obtain the test parameters corresponding to the target vehicle and generate the corresponding target test script; execute the target test script to obtain the first test data corresponding to the test parameters; optimize the test parameters according to the first test data to obtain the optimized test parameters; update the target test script according to the optimized test parameters to obtain the updated target test script; execute the updated target test script to obtain the second test data corresponding to the updated target test script; in response to the second test data satisfying the preset test conditions, determine the optimized test parameters as the target configuration parameters of the target vehicle. After obtaining the test parameters, the method of the present application can automatically generate the corresponding test script, avoiding the cumbersome process of manually writing scripts. At the same time, by analyzing the results of the first round of tests, the parameters are automatically optimized and adjusted, and an updated test script is generated again, forming a closed loop to improve the configuration quality and the parameter configuration efficiency. The entire parameter configuration process minimizes manual intervention, avoids human errors, and greatly improves the parameter configuration efficiency.
[0157] 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.
[0158] 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.
[0159] 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.
[0160] 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.
[0161] 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.
[0162] 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.
[0163] 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.
[0164] 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.
[0165] 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.
[0166] 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.
[0167] 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 automated test parameter configuration method, characterized in that: The method comprises: Obtaining test parameters corresponding to the target vehicle and generating a corresponding target test script; Execute the target test script to obtain first test data corresponding to the test parameters; Optimizing the test parameters according to the first test data to obtain optimized test parameters; Update the target test script according to the optimized test parameters to obtain the updated target test script; Execute the updated target test script to obtain second test data corresponding to the updated target test script; In response to the second test data satisfying a preset test condition, the optimized test parameters are determined as target configuration parameters of the target vehicle.
2. The method according to claim 1, characterized in that The step of obtaining test parameters corresponding to the target vehicle and generating a corresponding target test script includes: Obtaining the test parameters and a preset test script template data set; According to the test parameters, a target test template is determined in the test script template data set, and the target test script is generated.
3. The method according to claim 2, characterized in that The test parameters include a test type, a test environment, a test object, and a test indicator. The step of determining a target test template in the test script template data set according to the test parameters and generating the target test script includes: According to the test type, the test environment and the test object, determining a corresponding target test script template in the script template data set; wherein the script template data set includes a plurality of test script templates, each of the test script templates corresponding to a combination of one or more test types, test environments and test objects; Replace the preset placeholders in the target test script template according to the test indicators to generate an initial test script; Performing logic verification on the initial test script based on preset test logic rules; In response to the initial test script satisfying the preset test logic rule, the initial test script is determined as a target test script corresponding to the test parameter.
4. The method according to claim 1, characterized in that When the first test data is numerical data, optimizing the test parameters according to the first test data to obtain optimized test parameters includes: Comparing the first test data with preset standard data to obtain numerical deviation data; Analyzing the numerical deviation data according to a preset optimization rule to determine the optimization direction and optimization range of the first test parameter; The test parameters are adjusted according to the optimization direction and the optimization range to obtain optimized test parameters.
5. The method according to claim 4, characterized in that The analyzing the numerical deviation data according to a preset optimization rule to determine the optimization direction and optimization range of the first test parameter includes: Comparing the numerical deviation data with a preset deviation threshold range, wherein the deviation threshold range includes an upper threshold and a lower threshold; When the numerical deviation data is greater than the upper threshold, the optimization direction of the test parameter is determined to be decreasing, and the difference between the numerical deviation data and the upper threshold is multiplied by a preset first weight coefficient to obtain the optimization amplitude of the test parameter; When the numerical deviation data is less than the lower limit threshold, the optimization direction of the test parameter is determined to be increasing, and the difference between the lower limit threshold and the numerical deviation data is multiplied by a preset second weight coefficient to obtain the optimization amplitude of the test parameter; When the numerical deviation data is between the upper threshold and the lower threshold, the optimization direction of the test parameter is determined to remain unchanged, and the optimization amplitude of the test parameter is determined to be zero.
6. The method according to claim 1, characterized in that Before executing the updated target test script, the method further includes: Performing a risk assessment on the updated test parameters according to a preset risk assessment rule to determine the risk level of the updated test parameters; When the risk level exceeds the preset risk condition, a risk warning is triggered, and the updated test parameters are adjusted according to the preset risk handling strategy; The test script is updated with the adjusted test parameters, and the updated test script is executed to obtain third test data corresponding to the adjusted test parameters.
7. The method according to claim 1, characterized in that Before executing the target test script to obtain the first test data corresponding to the test parameter, the method further includes: Acquire dynamic environmental test data of the target vehicle; wherein the dynamic environmental data includes at least one of the geographical location, weather conditions, road type and traffic conditions of the vehicle; Dynamically adjusting the test parameters according to the dynamic environmental test data to obtain environmental test parameters adapted to the current environment; Generate a corresponding target test script according to the environmental test parameters and the target test script template.
8. An automated test parameter configuration device, characterized in that: The device comprises: An acquisition module, used to acquire test parameters corresponding to a target vehicle and generate a corresponding target test script; A first execution module, used for executing the target test script to obtain first test data corresponding to the test parameters; an optimization module, used for optimizing the test parameters according to the first test data to obtain optimized test parameters; A second execution module, used to execute the updated target test script, obtain second test data corresponding to the updated target test script, and when the second test data meets the preset test conditions, determine the optimized test parameters as target configuration parameters; A response module is used to determine the optimized test parameters as target configuration parameters of the target vehicle in response to the second test data satisfying a preset test condition.
9. A vehicle, characterized in that: include: A memory and a processor, wherein the memory stores a computer program, and the processor implements the automated test parameter configuration method according to any one of claims 1 to 8 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, an automated test parameter configuration method according to any one of claims 1 to 7 is implemented.
Citation Information
Cited By
Test system and test method
CN119882686A
Test system and test method
CN119882686B
Vehicle performance test method and device, electronic equipment and storage medium
CN121165696A
A vehicle performance testing method and device, electronic equipment and storage medium
CN121165696B
