## 4 Case Study and Experimental Implementation
### HIL System and Experimental Setup  
In this study, a real-time simulation HIL system from dSPACE is employed as a validation platform for the developed failure analysis model. The system is comprised of two distinct levels: a software layer and a hardware layer. At the software level, the Automotive Simulation Model (ASM) vehicle dynamics model [43], developed in MATLAB/Simulink with high fidelity, is considered. In particular, the electric system, gasoline engine, power-train, driver, and environmental system are modeled and simulated in conjunction with the vehicle dynamics system. This approach allows for the comprehensive capture of the system's behavioral characteristics. The model-based development approach allows for the automatic generation of code from the aforementioned model, which can then be deployed directly in HIL at the hardware level. In addition, the ECU system of the gasoline engine has been modeled as a separate entity on the same simulation platform. The interface connection between the entire vehicle system and the ECU is established using the CAN bus protocol, specifically the real-time interface CAN Multimessage Blockset.  
Conversely, at the hardware level, the HIL simulator is connected to MicroAutoBox II via the CAN bus to facilitate the real-time execution of the vehicle model. In particular, the dSPACE SCALEXIO is employed as the real-time simulator for the controlled system, namely the dynamic ASM vehicle model. MicroAutoBox II is employed as the Rapid Control Prototype (RCP), serving to emulate the functionality of the actual ECU and execute the control model in real time. The code generated for the ECU model is implemented in MicroAutoBox II, while the code generated for the ASM vehicle dynamics model is implemented in HIL SCALEXIO, as illustrated in Figure 5. The HIL system is linked to the host PC via the Ethernet communication protocol, therefore facilitating the configuration, monitoring, and analysis of the system, as well as the setting of targets for execution.  
In order to facilitate real-time virtual test driving by the user, the HIL system is connected to real steering wheels and pedals, as illustrated in Figure 6. This approach allows for the execution of driving scenarios and TCs based on not only the automated behavior of the system but also the real behavior of the driver [44].  
In addition to the aforementioned models and real-time systems, software tools from dSPACE, i.e., ModelDesk, MotionDesk, ConfigurationDesk, and ControlDesk [45], are employed to facilitate the implementation process. In particular, the parameterization and configuration of system variables are performed using the ModelDesk software. In addition, the real-time test function of ModelDesk is employed to create and implement the test scenario and corresponding TCs. To this end, a critical situation is defined within the scenario in order to verify the system's behavior under abnormal conditions. In this study, three test scenarios have been developed in both automatic and manual driving modes. In the test development environment, the logical and concrete TC description, including the TC specification, can be identified. In other words, the input data for the TC and the expected results are defined. Subsequently, the validation criteria are defined in order to validate the actual output of the SUT and provide the corresponding information for the test report. Once the configurations and parameterizations are complete, the code is automatically generated from the model and implemented in the corresponding hardware system using ConfigurationDesk. The functionality of MotionDesk is illustrated by a 3D animation, which provides a visual representation of the driving scenario and the surrounding environment. Ultimately, ControlDesk facilitates the instrumentation of test variables, calibration, measurement, analysis, and control of test executions. Moreover, the selected driving scenario can be executed in either automatic or manual mode, according to the tester's specifications.