A feedback fuzz testing method for autonomous driving system configuration defects

By integrating static analysis and dynamic fuzz testing, combined with closed-loop feedback optimization mechanism, the problem of defect detection of automatic driving system configuration is solved, and the stability and safety of the system are improved.

CN120316016BActive Publication Date: 2025-09-02SHANDONG UNIV OF TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510795735.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-16
Publication Date
2025-09-02
Estimated Expiration
2045-06-16

AI Technical Summary

Technical Problem

It is difficult for the prior art to efficiently detect and repair configuration defects in autonomous driving systems, especially in autonomous driving systems with large configuration space, frequent dynamic changes and high requirements for real-time and safety. The feedback mechanism lacks in-depth analysis of system behavior.

Method used

By integrating static analysis, dynamic fuzz testing and closed-loop feedback optimization mechanisms, a collection of test cases is generated, genetic algorithms are used to iteratively evolve, combined with CARLA simulator to simulate the behavior of autonomous vehicles, capture exceptions and optimize test case generation strategies, and form a closed-loop feedback optimization mechanism.

Benefits of technology

It realizes accurate and efficient detection of configuration defects of autonomous driving system, improves the stability and safety of the system, and reduces safety hazards caused by configuration errors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120316016B_ABST
    Figure CN120316016B_ABST
Patent Text Reader

Abstract

The present invention belongs to the field of software testing technology, and specifically relates to a feedback fuzzy testing method for configuration defects in autonomous driving systems. The steps include: generating a configuration parameter information set by parsing the autonomous driving system source code; extracting the value range constraints and dependencies of the configuration parameters, and obtaining the legal constraints of the configuration parameters; constructing a seed pool to generate initial test cases, and then iteratively evolving a diverse test case set with the help of a genetic algorithm; uploading the generated test case set to a simulator to capture abnormal behavior; identifying potentially dangerous behaviors that can cause abnormal behavior, retaining test cases where the potential dangerous behavior exceeds a threshold, and optimizing the fitness function of the genetic algorithm accordingly to guide the iterative evolution direction of the next round of configuration parameters, thereby forming a closed-loop feedback optimization mechanism. By integrating static analysis, dynamic fuzzy testing, and a closed-loop feedback mechanism, the present invention can accurately and efficiently detect configuration defects in autonomous driving systems.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of software testing technology, and specifically relates to a feedback fuzzy testing method for configuration defects of an autonomous driving system. Background Art

[0002] An autonomous driving system (ADS) is a highly integrated and complex system whose operation relies on the synergy of key technical modules and configuration parameters, including perception, decision-making, control, and positioning. The perception module uses high-precision sensors such as lidar, cameras, and radar to capture and analyze the vehicle's surroundings in real time, including obstacles, traffic signs, pedestrians, other vehicles, and road conditions. These configuration parameters encompass multiple aspects, including sensor settings, control algorithms, path planning, and communication protocols. Due to the diversity and complexity of these configuration items, misconfiguration can lead to system performance degradation and even serious safety incidents. For example, incorrect sensor configuration can cause environmental perception failure, compromising the accuracy of the decision-making system; improper control algorithm parameter settings can lead to irrational driving behavior, such as sudden acceleration, braking, or erratic steering. Therefore, effectively detecting and remediating configuration flaws in autonomous driving systems is crucial for ensuring their safety and reliability.

[0003] Currently, configuration defect detection technologies for software systems are primarily categorized into two categories: static analysis and dynamic testing. Static analysis extracts configuration constraints by analyzing source code or configuration files, but its results often suffer from false positives and false negatives and fail to capture the dynamic behavior of the program at runtime. Dynamic testing techniques, such as fuzz testing, detect system anomalies by generating random or semi-random input data. However, their test case generation strategies are typically fixed and lack dynamic adjustment capabilities, making it difficult to fully cover potential defects. Furthermore, existing methods are mostly designed for traditional software systems, which are difficult to directly apply to autonomous driving systems due to their larger configuration space, more frequent dynamic changes, and higher real-time and safety requirements.

[0004] In recent years, feedback mechanisms have been widely used in software testing. By feeding back status information from the testing process into the test case generation strategy, the test direction can be dynamically adjusted, improving the relevance and effectiveness of the test. For example, coverage-guided fuzz testing optimizes test case generation through code coverage feedback, enabling more efficient discovery of potential vulnerabilities. However, existing feedback mechanisms often focus on code coverage or program crash detection, lacking in-depth analysis of system behavior (such as the driving behavior of unmanned vehicles). For autonomous driving systems, how to use vehicle status information during operation (such as sudden acceleration, sudden braking, understeer, etc.) as feedback to dynamically optimize test case generation strategies remains an urgent problem. Summary of the Invention

[0005] In view of the above deficiencies in the prior art, the purpose of the present invention is to provide a feedback fuzzy testing method for autonomous driving system configuration defects. By integrating static analysis, dynamic fuzzy testing and closed-loop feedback optimization mechanism, the configuration defects of autonomous driving systems can be accurately and efficiently detected.

[0006] To achieve the above objectives, the present invention provides a feedback fuzzy testing method for configuration defects of an autonomous driving system, comprising the following steps:

[0007] S1. By parsing the autonomous driving system source code and using static analysis technology to locate the configuration item reading point, a configuration parameter information set including the configuration item name, variable name, and default value is generated to achieve the mapping between configuration items and configuration parameters;

[0008] S2. Based on the definition and usage rules of the configuration parameters, extract the value range constraints and dependencies of the configuration parameters, and automatically identify the error handling code segments in the logical judgment based on the source code to obtain the legal constraints of the configuration parameters;

[0009] S3: Build a seed pool based on the legal constraints of the configuration parameters, then use a random algorithm to generate initial test cases within the constraints, and then use a genetic algorithm to iteratively evolve a diverse set of test cases;

[0010] S4. Upload the generated test case set to the simulator to simulate the behavior of the autonomous driving system under different configuration conditions. Through simulation testing, analyze the operating status of the autonomous driving vehicle in real time and capture abnormal behavior.

[0011] S5. Identify potential dangerous behaviors that can cause abnormal behaviors in simulation tests, set a threshold for the number of potential dangerous behaviors, and retain test cases where the potential dangerous behaviors exceed the threshold. Based on this, optimize the fitness function of the genetic algorithm and guide the iterative evolution direction of the next round of configuration parameters, thereby forming a closed-loop feedback optimization mechanism.

[0012] As a preferred solution of the present invention, in S1, the process of generating the configuration parameter information set is:

[0013] Parse the source code through the Clang / LLVM tool chain and convert it into a structured abstract syntax tree (AST) and extensible markup language (XML) format to form AST files and XML files;

[0014] For XML files, use XPath syntax to locate the Param and GetParam call points, and record the configuration item name, variable name, and default value to form a configuration parameter information set R, which is expressed as:

[0015] ;

[0016] in, , which represents a triple vector consisting of the configuration item name, variable name, and default value extracted from the mth call site, where the number of call sites is n.

[0017] As a preferred solution of the present invention, in S2, the process of obtaining the legal constraints of the configuration parameters is:

[0018] The type information of configuration parameters includes basic type and semantic type. The basic type is obtained by extracting the semantic information related to the configuration parameters in the AST file and parsing the type definition and context information in the AST node; the semantic type is inferred based on the characteristic information of the configuration item name and default value.

[0019] Based on the XML file, use the If control statement or Switch selection statement to traverse and locate the branch structure related to the configuration parameters. Then, use the mapping relationship between configuration items and configuration parameters to traverse the XML file using XPath syntax to locate all branch structure nodes, determine whether the branch structure contains logical judgments related to the configuration parameters, and obtain the value range constraints of the configuration parameters. Use data flow analysis technology to further trace the transmission path of the configuration parameters during the function call process, identify whether there is conditional judgment logic based on the configuration parameters in the current function or other called functions, and extract the dependency relationship between configuration parameters.

[0020] Locate the usage of configuration parameters in branch statements from the source code, extract logical judgment information and subsequent processing code segment information, and automatically identify whether the subsequent processing code segment is an error handling code segment. If so, reversely infer the illegal value boundary to obtain complete legal constraint information of the configuration parameters.

[0021] As a preferred solution of the present invention, when automatically identifying whether a subsequent processing code segment is an error handling code segment, an automatic determination is made based on multiple identification features of the error handling code segment, the identification features including:

[0022] Error handling function naming features: Identify whether the function name contains keywords related to error handling, including "error", "err", "warn", "warning", and "fail". If the function name contains these keywords, it is determined to have error handling semantics;

[0023] Error message keyword features: Analyze whether function call parameters contain string information related to errors or abnormal conditions, including "null," "invalid," "disable," "conflict," and "not," as a basis for determining whether the code segment is used to handle illegal configurations;

[0024] Configuration parameter reassignment feature: When a configuration parameter is reassigned in the branch processing logic, it means that the parameter has exceeded the normal value range, and the processing code segment is marked as an error processing code segment.

[0025] As a preferred solution of the present invention, in S3, a bounded random generation algorithm is used to generate an initial test case, which is expressed as:

[0026] ;

[0027] ;

[0028] Where, represents the random test case generated by the i-th configuration item; N is the number of configuration items; 、 Respectively represent the upper and lower bounds of the value range of the i-th configuration item; Indicates Generate random numbers within the interval; Represents an initial population consisting of test cases for N configuration items.

[0029] As a preferred embodiment of the present invention, in S3, the initial test case is the starting point of the genetic algorithm optimization. During the iterative evolution process of the genetic algorithm, the mutation operation and crossover operation are used to continuously optimize the population to generate test cases covering more potential abnormal behaviors and configuration defects.

[0030] In the genetic algorithm, an elite retention strategy is adopted to directly copy the individual with the highest current fitness to the next generation, and the remaining individuals are mutated through differential mutation operations based on their fitness to generate new candidate individuals. The calculation formula for the mutation operation is:

[0031] ;

[0032] Where g represents the evolutionary generation; represents the target individual in the gth generation; For the g generation The corresponding mutant individual represents the jth mutant individual in the gth generation; 、 represents different individuals randomly selected in the gth generation; 、 is the scaling factor; represents the individual with the highest fitness in the gth generation;

[0033] Subsequently, the binomial distribution crossover strategy is used to cross the mutant individual with the target individual to generate a new individual:

[0034] ;

[0035] Where, represents the jth newly generated individual in the gth generation; represents the jth original individual in the gth generation; Indicates Generate random numbers within a range; represents the crossover probability.

[0036] As a preferred embodiment of the present invention, in the aforementioned S4, a simulation test scenario is constructed based on the CARLA simulator as the driving environment of the autonomous vehicle. The construction of the simulation test scenario includes configuring a city map, setting weather conditions, adding dynamic interference elements, and simulating complex road structures. By randomly selecting two locations as the starting point and the target point, different driving paths of the autonomous vehicle are simulated; the dynamic interference elements are the introduction of dynamic traffic participants, including pedestrians and other vehicles, into the driving path, and the arrangement of obstacles.

[0037] During the test, a target test vehicle is first generated as an autonomous vehicle at the simulation starting point, and a test case from the test case collection is loaded. The autonomous vehicle is then controlled to drive to the preset target point according to the autonomously planned path. During the simulation, the CARLA simulator applies the control instructions of each frame to the autonomous vehicle and records its status data in real time during operation, including position information, speed, acceleration, and control instructions.

[0038] During the autonomous driving test, the system status is continuously monitored to determine whether it has triggered abnormal criteria, thereby detecting abnormal behavior. Abnormal criteria include:

[0039] Collision: The autonomous vehicle comes into physical contact with an obstacle or other participant during operation;

[0040] Startup failure: The autonomous vehicle cannot start normally due to configuration errors or initialization abnormalities;

[0041] Logical error: The autonomous vehicle experiences logical anomalies without any physical faults and is unable to operate according to the set route or expected strategy;

[0042] All detected abnormal behaviors will be output in the form of logs and bug reports.

[0043] As a preferred solution of the present invention, when monitoring the status of the autonomous driving system, all detected behavior information is fed back to the fitness function of the genetic algorithm to evaluate the abnormal exposure ability of the configuration parameter combination of the current test case in the test.

[0044] As a preferred embodiment of the present invention, in S5, the potentially dangerous behaviors include sudden acceleration, sudden braking, sharp turns, oversteering, and understeering. Based on the state data recorded by the autonomous driving vehicle in the simulation test, the method for identifying the potentially dangerous behaviors is as follows:

[0045] For sudden acceleration and braking, the ratio of the longitudinal acceleration to the gravitational acceleration g at a certain moment is used to measure the severity of the acceleration behavior:

[0046] ;

[0047] Where, Indicates the acceleration intensity index, which is used to evaluate the driving smoothness; represents the longitudinal acceleration; when When the vehicle is in a state of emergency, it is regarded as sudden acceleration or sudden braking;

[0048] Sharp turns, based on the lateral speed and steering wheel angle at a certain moment The ratio of measures the turning dynamic behavior:

[0049] ;

[0050] Where, Indicates the turning dynamic behavior index; is the lateral velocity; when and When , it is considered as a sharp turn;

[0051] Oversteer and understeer, a fuzzy logic controller is introduced, whose fuzzy input is the steering wheel angle , yaw angular velocity and lateral acceleration The fuzzy outputs are the understeer degree us and the oversteer degree os. In addition, the reduction ratio of the lateral acceleration gain is introduced to achieve objective quantification of the understeer phenomenon:

[0052] ;

[0053] ;

[0054] Where, represents the lateral acceleration gain; Indicates the ratio of lateral acceleration gain decrease, reflecting the degree of decrease in steering sensitivity; Indicates the maximum value of the lateral acceleration gain;

[0055] Formulate fuzzy rules, through 、 、 、 and Determine oversteer and understeer.

[0056] The simulation and algorithm involved in the present invention can be executed by an electronic device, which includes a memory, a processor, and a computer program stored in the memory and run on the processor. The above-mentioned simulation and algorithm calculation are realized by executing the software through the processor.

[0057] The beneficial effects of the present invention are:

[0058] This invention combines static analysis and dynamic fuzz testing techniques to efficiently and accurately detect configuration defects in autonomous driving systems. Static analysis extracts configuration items and their constraints from the source code, constructs a seed pool, and uses genetic algorithms to generate diverse configuration parameter test cases. This allows for extensive exploration of the configuration space, improving test coverage and effectively identifying potential configuration issues.

[0059] This invention introduces a closed-loop feedback optimization mechanism to optimize the testing process, demonstrating strong self-improvement capabilities, enhancing the pertinence and effectiveness of the test, improving overall performance and reliability, thereby improving the stability and safety of the autonomous driving system and reducing safety hazards caused by configuration errors. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] Figure 1 It is a schematic diagram of the process of the present invention;

[0061] Figure 2 It is a detailed flow diagram of the present invention;

[0062] Figure 3 It is a process diagram of the present invention from seed pool construction to output logs and BUG reports. DETAILED DESCRIPTION

[0063] The embodiments of the present invention are further described below with reference to the accompanying drawings:

[0064] like Figure 1 As shown in FIG, a feedback fuzz testing method for configuration defects of an autonomous driving system includes the following steps:

[0065] S1. By parsing the autonomous driving system source code and using static analysis technology to locate the configuration item reading point, a configuration parameter information set including the configuration item name, variable name, and default value is generated to achieve the mapping between configuration items and configuration parameters;

[0066] S2. Based on the definition and usage rules of the configuration parameters, extract the value range constraints and dependencies of the configuration parameters, and automatically identify the error handling code segments in the logical judgment based on the source code to obtain the legal constraints of the configuration parameters;

[0067] S3: Build a seed pool based on the legal constraints of the configuration parameters, then use a random algorithm to generate initial test cases within the constraints, and then use a genetic algorithm to iteratively evolve a diverse set of test cases;

[0068] S4. Upload the generated test case set to the simulator to simulate the behavior of the autonomous driving system under different configuration conditions. Through simulation testing, analyze the operating status of the autonomous driving vehicle in real time and capture abnormal behavior.

[0069] S5. Identify potential dangerous behaviors that can cause abnormal behaviors in simulation tests, set a threshold for the number of potential dangerous behaviors, and retain test cases where the potential dangerous behaviors exceed the threshold. Based on this, optimize the fitness function of the genetic algorithm and guide the iterative evolution direction of the next round of configuration parameters, thereby forming a closed-loop feedback optimization mechanism.

[0070] To achieve efficient static analysis, source code typically needs to be converted into a structured and easily processable intermediate format. In this embodiment, XML and AST formats are selected to structure the source code. The source code is parsed using the relevant APIs provided by Clang / LLVM, providing a clear and easy-to-process data structure for subsequent static analysis.

[0071] In the process of mapping configuration items to configuration parameters, the key step is to identify and locate the configuration items in the system. This embodiment analyzes the ROS autonomous driving platform, which uses the startup text file Launch file as the configuration file. By parsing these startup text files, the configuration item information can be extracted. In the communication mechanism of ROS, topic communication adopts a publish-subscribe model, which mainly involves three roles: ROS Master, Talker and Listener. Talker defines the configuration items in detail in the Launch file according to the system configuration specification; ROS Master loads the configuration items to the parameter server; Listener reads the configuration items from the parameter space through the Param and GetParam methods provided by ROS, and maps them to the corresponding configuration parameters. Based on the analysis of the communication mechanism of ROS and the content related to the configuration items, a mapping method between configuration items and configuration parameters is designed.

[0072] In S1, the process of generating a configuration parameter information set is as follows:

[0073] Parse the source code through the Clang / LLVM tool chain and convert it into a structured abstract syntax tree (AST) (a tree representation of the abstract syntax structure of the source code) and extensible markup language (XML) format to form AST files and XML files;

[0074] For XML files, use XPath syntax to locate the Param and GetParam call points, and record the configuration item name, variable name, and default value to form a configuration parameter information set R, which is expressed as:

[0075] ;

[0076] in, , which represents a triple vector consisting of the configuration item name, variable name, and default value extracted from the mth call site, where the number of call sites is n.

[0077] The Clang / LLVM toolchain is a compiler infrastructure widely used in software development for compiling, optimizing, and analyzing code. XPath, short for XML Path Language, is a language for finding information in XML documents. It is used to locate and extract specific nodes or sets of nodes in XML documents.

[0078] In S2, the process of obtaining the legal constraints of configuration parameters is as follows:

[0079] The type information of configuration parameters includes basic types and semantic types. The basic types are obtained by extracting the semantic information related to the configuration parameters in the AST file and parsing the type definitions and context information in the AST nodes; the semantic types are inferred based on the characteristic information of the configuration item name and default value; specifically, it includes: identifying whether the parameters are predefined semantic types such as file path, directory path, IP address or port number through string matching and format rules, thereby constructing a type constraint set for the configuration parameters.

[0080] Based on the XML file, use the If control statement or Switch selection statement to traverse and locate the branch structure related to the configuration parameters. Then, use the mapping relationship between configuration items and configuration parameters to traverse the XML file using XPath syntax to locate all branch structure nodes, determine whether the branch structure contains logical judgments related to the configuration parameters, and obtain the value range constraints of the configuration parameters. Use data flow analysis technology to further trace the transmission path of the configuration parameters during the function call process, identify whether there is conditional judgment logic based on the configuration parameters in the current function or other called functions, and extract the dependency relationship between configuration parameters.

[0081] Locate the usage of configuration parameters in branch statements from the source code, extract logical judgment information and subsequent processing code segment information, and automatically identify whether the subsequent processing code segment is an error handling code segment. If so, reversely infer the illegal value boundary to obtain complete legal constraint information of the configuration parameters.

[0082] When automatically identifying whether a subsequent processing code segment is an error handling code segment, the system automatically determines whether the subsequent processing code segment is an error handling code segment based on multiple identification features of the error handling code segment. The identification features include:

[0083] Error handling function naming features: Identify whether the function name contains keywords related to error handling, including "error", "err", "warn", "warning", and "fail". If the function name contains these keywords, it is determined to have error handling semantics;

[0084] Error message keyword features: Analyze whether function call parameters contain string information related to errors or abnormal conditions, including "null," "invalid," "disable," "conflict," and "not," as a basis for determining whether the code segment is used to handle illegal configurations;

[0085] Configuration parameter reassignment feature: When a configuration parameter is reassigned in the branch processing logic, it means that the parameter has exceeded the normal value range, and the processing code segment is marked as an error processing code segment.

[0086] Autonomous driving systems typically contain a large number of configuration items with diverse functions. Some of these items are directly related to function switches. Modifying them only affects the activation of a single module, with minimal impact on the vehicle's overall behavior, making it difficult to trigger global defects. Furthermore, enumerated configuration items have predefined constant values ​​and limited variation space. String types, however, involve multiple attributes such as character sets, formats, and semantics, leading to high uncertainty and inefficiency in test input generation. Considering the controllability and coverage of fuzz testing, we prioritized some numeric configuration items as mutation targets for fuzz testing to facilitate the generation of effective test cases.

[0087] In S3, a bounded random generation algorithm is used to generate initial test cases, which can be expressed as:

[0088] ;

[0089] ;

[0090] Where, represents the random test case generated by the i-th configuration item; N is the number of configuration items; 、 Respectively represent the upper and lower bounds of the value range of the i-th configuration item; Indicates Generate random numbers within a range; Represents an initial population consisting of test cases for N configuration items.

[0091] The initial test case is the starting point for genetic algorithm optimization. During the iterative evolution of the genetic algorithm, mutation and crossover operations are used to continuously optimize the population and generate test cases that cover more potential abnormal behaviors and configuration defects.

[0092] In the genetic algorithm, an elite retention strategy is adopted to directly copy the individual with the highest current fitness to the next generation, and the remaining individuals are mutated through differential mutation operations based on their fitness to generate new candidate individuals. The calculation formula for the mutation operation is:

[0093] ;

[0094] Where g represents the evolutionary generation; represents the target individual in the gth generation; For the g generation The corresponding mutant individual represents the jth mutant individual in the gth generation; 、 represents different individuals randomly selected in the gth generation; 、 is the scaling factor (usually 0.5 to 1.0); represents the individual with the highest fitness in the gth generation;

[0095] Subsequently, the binomial distribution crossover strategy is used to cross the mutant individual with the target individual to generate a new individual:

[0096] ;

[0097] Where, represents the jth newly generated individual in the gth generation; represents the jth original individual in the gth generation; represents the crossover probability, which controls the probability of inheriting genes from mutant individuals.

[0098] In S4, a simulation test scenario was constructed based on the CARLA simulator (an open-source autonomous driving simulator designed to support the development, training, and validation of autonomous driving systems). This simulation test scenario served as the driving environment for autonomous vehicles. This included configuring a city map, setting weather conditions (rain, fog, wind, and lighting angles), adding dynamic interference elements, and simulating complex road structures (roundabouts, T-intersections, and residential cul-de-sacs). By randomly selecting two locations as the starting and destination points, different driving paths for autonomous vehicles were simulated. Dynamic interference elements involved introducing dynamic traffic participants, including pedestrians and other vehicles, into the driving path, as well as placing obstacles.

[0099] During the test, a target test vehicle is first generated as an autonomous vehicle at the simulation starting point, and a test case from the test case collection is loaded. The autonomous vehicle is then controlled to drive to the preset target point according to the autonomously planned path. During the simulation, the CARLA simulator applies the control instructions of each frame to the autonomous vehicle and records its status data in real time during operation, including position information, speed, acceleration, and control instructions.

[0100] During the autonomous driving test, the system status is continuously monitored to determine whether it has triggered abnormal criteria, thereby detecting abnormal behavior. Abnormal criteria include:

[0101] Collision: The autonomous vehicle comes into physical contact with an obstacle or other participant during operation;

[0102] Startup failure: The autonomous vehicle cannot start normally due to configuration errors or initialization abnormalities;

[0103] Logical error: The autonomous vehicle experiences logical anomalies without any physical faults and is unable to operate according to the set route or expected strategy;

[0104] All detected abnormal behaviors will be output in the form of logs and bug reports.

[0105] While monitoring the state of the autonomous driving system, all detected behavior information is fed back into the genetic algorithm's fitness function to evaluate the ability of the current test case's configuration parameter combination to expose anomalies during testing. Based on the fitness function, high-performing test cases are selected to form the next round of seed pools, achieving iterative optimization of the seed pool.

[0106] In S5, potentially dangerous behaviors include sudden acceleration, sudden braking, sharp turns, oversteering, and understeering. Based on the state data recorded by the autonomous vehicle in the simulation test, the method for identifying potentially dangerous behaviors is as follows:

[0107] For sudden acceleration and braking, the ratio of the longitudinal acceleration to the gravitational acceleration g at a certain moment is used to measure the severity of the acceleration behavior:

[0108] ;

[0109] Where, Indicates the acceleration intensity index, which is used to evaluate the driving smoothness; represents the longitudinal acceleration; when When the vehicle is in a state of emergency, it is regarded as sudden acceleration or sudden braking;

[0110] Sharp turns, based on the lateral speed and steering wheel angle at a certain moment The ratio of measures the turning dynamic behavior:

[0111] ;

[0112] Where, Indicates the turning dynamic behavior index; is the lateral velocity; when and When , it is considered as a sharp turn;

[0113] Oversteer and understeer, a fuzzy logic controller is introduced, whose fuzzy input is the steering wheel angle , yaw angular velocity and lateral acceleration The fuzzy outputs are the understeer degree us and the oversteer degree os. In addition, the reduction ratio of the lateral acceleration gain is introduced to achieve objective quantification of the understeer phenomenon:

[0114] ;

[0115] ;

[0116] Where, represents the lateral acceleration gain; Indicates the ratio of lateral acceleration gain decrease, reflecting the degree of decrease in steering sensitivity; Indicates the maximum value of the lateral acceleration gain;

[0117] The domains and quantization levels of the input and output variables are shown in Table 1. The quantization levels use three fuzzy subsets of Low, Mid, and High to represent the low, medium, and high value areas of the variables.

[0118] Table 1 Fuzzy logic controller parameter settings

[0119]

[0120] Formulate fuzzy rules, through 、 、 、 and Judging oversteer and understeer includes 9 corresponding fuzzy rules:

[0121] Rule 1: If Low, and If it is low, then os is low;

[0122] Rule 2: If In, and If it is medium, then the os is medium;

[0123] Rule 3: If High, and If it is high, then os is high;

[0124] Rule 4: If If it is low, then os is low;

[0125] Rule 5: If In, then os in;

[0126] Rule 6: If If it is high, then os is high;

[0127] Rule 7: If If it is low, then us is low;

[0128] Rule 8: If If it is medium, then us;

[0129] Rule 9: If High, then us high.

[0130] After the fuzzy inference is completed, the output result is still in the fuzzy set and cannot be directly used for quantitative analysis. Therefore, the centroid method is used to defuzzify the fuzzy output. By calculating the output membership function ( 、 、 The center of mass position of the vehicle is calculated using the formula (derived from the formula), resulting in a specific numerical value as the stability score for steering anomalies. This score continuously characterizes the severity of understeer or oversteer, providing a precise quantitative basis for determining whether a condition is potentially dangerous.

[0131] In a closed-loop feedback optimization mechanism, test cases with high fitness values ​​are retained for the next generation of mutation, enabling guided expansion of the configuration space. This feedback-driven mechanism not only improves the detection rate of valid configuration defects during fuzz testing but also, through feedback on driving behavior quality, guides the system to explore more complex, hidden, but real safety risk configuration combinations, significantly enhancing the system's reliability and stability assessment capabilities in actual deployment scenarios.

[0132] In summary, the detailed flow chart of this implementation method is as follows: Figure 2 As shown in the following figure, the process from seed pool construction to output logs and BUG reports is as follows Figure 3 shown. Figure 3The configuration file contains key configuration items such as model parameters, algorithm parameters, and sensor parameters. Model parameters, for example, are used in the perception module to test the autonomous driving system's response to different environmental conditions (such as rain) by varying weather conditions. These parameters serve as the model's input conditions. Algorithm parameters involve path planning, speed control, collision detection, and define the character types in the scene and their navigation style. Sensor parameters determine how the autonomous driving system perceives the environment, indirectly testing the autonomous driving system's perception module by creating and varying sensor states and conditions within the environment.

Claims

1. A feedback fuzzy testing method for configuration defects of autonomous driving systems, characterized by The following steps are involved: S1. By parsing the autonomous driving system source code and using static analysis technology to locate the configuration item reading point, a configuration parameter information set including the configuration item name, variable name, and default value is generated to achieve the mapping between configuration items and configuration parameters; S2. Based on the definition and usage rules of the configuration parameters, extract the value range constraints and dependencies of the configuration parameters, and automatically identify the error handling code segments in the logical judgment based on the source code to obtain the legal constraints of the configuration parameters. The process is as follows: The type information of configuration parameters includes basic types and semantic types. The basic types are obtained by extracting the semantic information related to the configuration parameters in the AST file and parsing the type definition and context information in the AST node; Semantic types are inferred based on the characteristic information of the configuration item name and default value; Based on the XML file, use the If control statement or Switch selection statement to traverse and locate the branch structure related to the configuration parameters. Then, use the mapping relationship between configuration items and configuration parameters to traverse the XML file using XPath syntax to locate all branch structure nodes, determine whether the branch structure contains logical judgments related to the configuration parameters, and obtain the value range constraints of the configuration parameters. Use data flow analysis technology to further trace the transmission path of the configuration parameters during the function call process, identify whether there is conditional judgment logic based on the configuration parameters in the current function or other called functions, and extract the dependency relationship between configuration parameters. Locate the usage of configuration parameters in branch statements from the source code, extract logical judgment information and subsequent processing code segment information, and automatically identify whether the subsequent processing code segment is an error handling code segment. If so, reversely infer the illegal value boundary to obtain complete legal constraint information for the configuration parameters; S3: Build a seed pool based on the legal constraints of the configuration parameters, then use a random algorithm to generate initial test cases within the constraints, and then use a genetic algorithm to iteratively evolve a diverse set of test cases; S4. Upload the generated test case set to the simulator to simulate the behavior of the autonomous driving system under different configuration conditions. Through simulation testing, analyze the operating status of the autonomous driving vehicle in real time and capture abnormal behavior. S5. Identify potential dangerous behaviors that can cause abnormal behaviors in simulation tests, set a threshold for the number of potential dangerous behaviors, and retain test cases where the potential dangerous behaviors exceed the threshold. Based on this, optimize the fitness function of the genetic algorithm and guide the iterative evolution direction of the next round of configuration parameters, thereby forming a closed-loop feedback optimization mechanism.

2. The feedback fuzzy testing method for configuration defects of an autonomous driving system according to claim 1, characterized in that: In the above S1, the process of generating the configuration parameter information set is: Parse the source code through the Clang / LLVM tool chain and convert it into a structured abstract syntax tree (AST) and extensible markup language (XML) format to form AST files and XML files; For XML files, use XPath syntax to locate the Param and GetParam call points, and record the configuration item name, variable name, and default value to form a configuration parameter information set R, which is expressed as: ; in, , which represents a triple vector consisting of the configuration item name, variable name, and default value extracted from the mth call site, where the number of call sites is n.

3. The feedback fuzzy testing method for configuration defects of an autonomous driving system according to claim 1, characterized in that: When automatically identifying whether a subsequent processing code segment is an error handling code segment, the system automatically determines whether the subsequent processing code segment is an error handling code segment based on multiple identification features of the error handling code segment. The identification features include: Error handling function naming features: Identify whether the function name contains keywords related to error handling, including "error", "err", "warn", "warning", and "fail". If the function name contains these keywords, it is determined to have error handling semantics; Error message keyword features: Analyze whether the function call parameters contain string information related to errors or abnormal conditions, including "null", "invalid", "disable", "conflict", and "not", as a basis for determining whether the code segment is used to handle illegal configurations; Configuration parameter reassignment feature: When a configuration parameter is reassigned in the branch processing logic, it means that the parameter has exceeded the normal value range, and the processing code segment is marked as an error processing code segment.

4. The feedback fuzzy testing method for configuration defects of an autonomous driving system according to claim 1, characterized in that: In S3, a bounded random generation algorithm is used to generate initial test cases, which can be expressed as: ; ; Where, represents the random test case generated by the i-th configuration item; N is the number of configuration items; 、 Respectively represent the upper and lower bounds of the value range of the i-th configuration item; Indicates Generate random numbers within the interval; Represents an initial population consisting of test cases for N configuration items.

5. The feedback fuzzy testing method for configuration defects of an autonomous driving system according to claim 1, characterized in that: In S3, the initial test case is the starting point of the genetic algorithm optimization. During the iterative evolution of the genetic algorithm, mutation and crossover operations are used to continuously optimize the population, generating test cases that cover more potential abnormal behaviors and configuration defects. In the genetic algorithm, an elite retention strategy is adopted to directly copy the individual with the highest current fitness to the next generation, and the remaining individuals are mutated through differential mutation operations based on their fitness to generate new candidate individuals. The calculation formula for the mutation operation is: ; Where g represents the evolutionary generation; represents the target individual in the gth generation; For the g generation The corresponding mutant individual represents the jth mutant individual in the gth generation; 、 represents different individuals randomly selected in the gth generation; 、 is the scaling factor; represents the individual with the highest fitness in the gth generation; Subsequently, the binomial distribution crossover strategy is used to cross the mutant individual with the target individual to generate a new individual: ; Where, represents the jth newly generated individual in the gth generation; represents the jth original individual in the gth generation; Indicates Generate random numbers within a range; represents the crossover probability.

6. The feedback fuzzy testing method for configuration defects of an autonomous driving system according to claim 1, characterized in that: In the aforementioned S4, a simulation test scenario is constructed based on the CARLA simulator as the driving environment of the autonomous vehicle. The construction of the simulation test scenario includes configuring a city map, setting weather conditions, adding dynamic interference elements, and simulating complex road structures. By randomly selecting two locations as the starting point and the target point, different driving paths of the autonomous vehicle are simulated. The dynamic interference elements are the introduction of dynamic traffic participants, including pedestrians and other vehicles, into the driving path, and the placement of obstacles. During the test, a target test vehicle is first generated as an autonomous driving vehicle at the simulation starting point, and a test case from the test case set is loaded. The autonomous driving vehicle is then controlled to drive to the preset target point according to the autonomously planned path. During the simulation, the CARLA simulator applies the control instructions of each frame to the autonomous vehicle and records its status data in real time, including position information, speed, acceleration, and control instructions. During the autonomous driving test, the system status is continuously monitored to determine whether it has triggered abnormal criteria, thereby detecting abnormal behavior. Abnormal criteria include: Collision: The autonomous vehicle comes into physical contact with an obstacle or other participant during operation; Startup failure: The autonomous vehicle cannot start normally due to configuration errors or initialization abnormalities; Logical error: The autonomous vehicle experiences logical anomalies without any physical faults and is unable to operate according to the set route or expected strategy; All detected abnormal behaviors will be output in the form of logs and bug reports.

7. The feedback fuzzy testing method for configuration defects of an autonomous driving system according to claim 6, characterized in that: When monitoring the status of the autonomous driving system, all detected behavior information is fed back to the fitness function of the genetic algorithm to evaluate the abnormality exposure ability of the configuration parameter combination of the current test case in the test.

8. The feedback fuzzy testing method for configuration defects of an autonomous driving system according to claim 1, characterized in that: In S5, potentially dangerous behaviors include sudden acceleration, sudden braking, sharp turns, oversteering, and understeering. Based on the state data recorded by the autonomous driving vehicle in the simulation test, the method for identifying potentially dangerous behaviors is as follows: For sudden acceleration and braking, the ratio of the longitudinal acceleration to the gravitational acceleration g at a certain moment is used to measure the severity of the acceleration behavior: ; Where, Indicates the acceleration intensity index, which is used to evaluate the driving smoothness; represents the longitudinal acceleration; when When the vehicle is in a state of emergency, it is regarded as sudden acceleration or sudden braking; Sharp turns, based on the lateral speed and steering wheel angle at a certain moment The ratio of measures the turning dynamic behavior: ; Where, Indicates the turning dynamic behavior index; is the lateral velocity; when and When , it is considered as a sharp turn; Oversteer and understeer, a fuzzy logic controller is introduced, whose fuzzy input is the steering wheel angle , yaw angular velocity and lateral acceleration The fuzzy outputs are the understeer degree us and the oversteer degree os. In addition, the reduction ratio of the lateral acceleration gain is introduced to achieve objective quantification of the understeer phenomenon: ; ; Where, represents the lateral acceleration gain; Indicates the ratio of lateral acceleration gain decrease, reflecting the degree of decrease in steering sensitivity; Indicates the maximum value of the lateral acceleration gain; Formulate fuzzy rules, through 、 、 、 and Determine oversteer and understeer.

Citation Information

Patent Citations

  • Extreme test case generation method based on genetic algorithm

    CN114218064A

  • Large-model-assisted program function automatic sensing fuzzy testing method and large-model-assisted program function automatic sensing fuzzy testing system

    CN119690854A