arXiv:2610.29969cs.SEOct 2026

Manuscript Offprint

arXiv:2610.29969

FaultGene: LLM-Assisted Fault-Augmented Test Generation for Hardware-in-the-Loop Validation of Autonomous Driving Systems

Chaoran Yuan, Fadi Kurdahi

1st1^{st} Chaoran Yuan

Center for Embedded and Cyber-Physical Systems

University of California, Irvine

Irvine, USA

chaory2@uci.edu

2nd2^{nd} Fadi kurdahi

Center for Embedded and Cyber-Physical Systems

University of California, Irvine

Irvine, USA

kurdahi@uci.edu

Abstract—Reliable validation of autonomous driving cyber-physical systems requires testing not only nominal driving behavior but also failures arising from faults in sensing and embedded computation. Physical road testing provides realistic system behavior but is costly and difficult to reproduce, while simulation enables scalable evaluation but cannot fully capture hardware-dependent behavior and fault propagation. Hardware-in-the-loop (HIL) validation bridges this gap by executing the driving stack on real embedded hardware within a simulated environment. However, preparing fault-augmented scenarios for HIL testing remains largely a manual process, limiting test coverage, scalability, and efficiency.

We present FaultGene, an LLM-assisted framework for automated generation of executable fault-augmented tests for HIL fault-resilience validation. Given a baseline Scenic/CARLA scenario and a structured fault specification, FaultGene generates a fault-augmented test case that captures the effects of HIL-level fault injection. During offline refinement, semantic-consistency checks and execution-level feedback are used to correct candidates that fail to preserve the intended scenario context or produce the desired fault-induced degradation, and to construct high-quality supervision for fine-tuning. The resulting generator then produces fault-augmented tests directly at deployment time without requiring manually engineered reference executions or repeated refinement loops.

On held-out scenario–fault combinations, FaultGene improves semantic alignment and executability over one-shot LLM generation across both modular and end-to-end autonomous driving architectures. It also preserves the main sensor- and compute-fault sensitivity trends observed in HIL evaluation, capturing hardware-level fault effects beyond simulation-based verification and falsification alone. Compared with conventional manual fault-scenario engineering, FaultGene reduces estimated fault-scenario preparation time by 72×, enabling scalable HIL-based dependability validation.

I. INTRODUCTION

The rapid advancement of Automated Driving Systems (ADS) has created an urgent need for testing environments that can reliably expose safety-critical failures [1]. Road testing provides high-fidelity evaluation but is costly, time-consuming, difficult to reproduce, and limited in its ability to systematically exercise rare fault conditions. Simulation-based testing offers scalable and reproducible alternatives through controllable scenario generation using platforms such as CARLA [2]. Existing probabilistic, constraint-based, and search-based approaches [3], [4] further expand the scenario space for systematic verification. However, simulation alone cannot fully capture hardware-dependent effects, such as timing variations, scheduling jitter, and embedded computation faults, motivating hardware-in-the-loop (HIL) testing, where the driving stack executes on real hardware within a simulated environment.

Despite these advantages, preparing fault-augmented scenarios for HIL testing remains a practical bottleneck. A fault-oriented test must define both the driving context and the intended sensor or compute fault while preserving scenario semantics and producing meaningful system-level effects. Manually constructing scenarios across fault types, activation times, and severities is labor-intensive and difficult to scale.

Large language models (LLMs) offer a potential solution by translating high-level specifications into executable scenario programs [5]. However, one-shot generation may produce scenarios that violate the intended context, fail to compile or execute, or fail to expose the specified fault meaningfully. These limitations motivate combining LLM-based generation with execution-guided refinement grounded in HIL behavior.

This paper presents FaultGene, an LLM-assisted framework for automated generation of fault-augmented HIL test cases. Given a baseline Scenic [3]/CARLA scenario and a structured specification of fault type, activation timing, and severity, FaultGene generates a fault-augmented test while preserving the underlying driving context. The framework integrates structured LLM generation with execution-guided refinement in the Autonomous Driving Digital Twin (ADDT) environment [6]. HIL executions provide fault-grounded reference behavior and system-level feedback that are used offline to refine generated scenarios and construct supervision for fine-tuning the generator. After tuning, the generator produces fault-augmented tests in a single pass without reference executions or iterative refinement during deployment.

We evaluate FaultGene on held-out scenario–fault combinations across modular and end-to-end AD architectures. Experimental results show improved scenario validity and executability over one-shot LLM generation, while the generated tests reproduce the main sensor- and compute-fault sensitivity trends observed in ADDT. Compared with conventional manual fault-scenario engineering, FaultGene reduces fault-engineering effort by 72×72\times per fault type.

In summary, this work makes the following contributions:

• An LLM-assisted framework for automatically transforming baseline driving scenarios and structured fault specifications into executable fault-augmented test cases;

• A feedback-driven refinement and tuning mechanism that uses execution feedback as supervision to improve semantic consistency and fault-induced system behavior;

• An empirical evaluation showing improved scenario validity, ADDT-consistent fault trends, and higher testing efficiency compared with conventional HIL workflows.

References (36)