News About John X. Wang

Model Based Software-in-the-Loop Testing of Closed-Loop Automotive Software

  • Jan 08, 2019 |

    In the automotive industry, major innovations are nowadays driven by software[. Over the past years, functionality realized by software grew from basic headlight control to advanced systems, such as Active Brake Assist (ABA) and Electronic Stability Control (ESC), interacting with multiple sensors, actuators and other systems. Since software may directly influence the driving behavior by controlling actuators, e.g., brakes, software failures may result in damage to passengers and to the environment. To increase the safety of software controlled systems in the automotive domain, the ISO 26262 recommends extensive testing for safety critical software. In particular, testing safety critical software using the final hardware is highly recommended by the ISO 26262. However, removing a software failure in late development phases implicates high costs. In order to detect and remove software faults as early as possible in the development process and thus decrease costs, software can be tested on model level.

    Modeling Test Scenarios

    To create a test scenario, a scene has to be replicated virtually using high-fidelity models and simulation tools. A test scenario is implemented in the simulated environment using the model elements such as vehicle, vehicle environment sensors – radar, lidar, GPS, HD maps, etc., road, road traffic, various traffic participants – pedestrians, bicyclists, signs, and their expected behaviors. Once a test scenario has been modeled, the real benefit is that it can be translated into endless different test cases by managing parameter variations.

    Engineers that need to simulate a lot of different test scenarios do not have to specify each one manually. Many scenario descriptions can be imported using resources and standards such as Open DRIVE, Open SCENARIO, and Open Simulation Interface (OSI), among others. Engineers can also use their own captured sensor data from on-road vehicle testing. The test scenarios thus defined can now be used to validate various autonomous driving algorithms.

    Software in the Loop (SIL)

    Software in the Loop (SIL) is testing any software/firmware/algorithm/control system in such a way that a piece of software simulating a piece of hardware, or simulating a physical component, or a physical system, including possibly its response or other characteristics, is in your communication stream in a system which is either open-ended (feed-forward only), or with feedback. SIL is any testing where you have a simulated piece of actual product hardware (in other words: software in place of hardware) in your test.

    SIL versus Hardware in the Loop (HIL) testing

    HIL or ‘Hardware in the Loop’ testing is by its very nature a resource-hungry solution to testing, requiring multi-skilled teams able to set up and configure both the execution platform and the I/Os as well as the modeling environment.

    While filling an important part of the overall test process, it may take longer to prove out significant issues with HIL testing than can be achieved in a SIL test scenario as testing hardware availability is not required.

    SIL testing and simulation can thus be a useful technique for software proving at earlier stages of the design. SIL is featured by the following:

    • SIL simulation represents the integration of compiled production source code into a mathematical model simulation, providing engineers with a practical, virtual simulation environment for the development and testing of detailed control strategies for large and complex systems.

    • With SIL, engineers can use a PC to directly and iteratively test and modify their source code, by directly connecting software to a digital plant model substituting for costlier systems, prototypes or test benches. SIL makes it possible to test software prior to the initialization of the hardware prototyping phase, significantly accelerating the development cycle.

    • SIL enables the earliest detection of system-level defects or bugs, significantly reducing the costs of later stage troubleshooting, when the number and complexity of component interactions is greater. SIL provides an excellent complement to traditional HIL simulation, while helping to accelerate time-to-market and ensuring the more efficient software development.

    SIL Simulation with a Top Model

    You can test code generated from model by running a top-model SIL simulation. With this approach:

    • You test code generated from the top model, which uses the standalone code interface.

    • You configure the model to load test vectors or stimulus inputs from the MATLAB workspace.

    • You can easily switch the top model between the normal and SIL simulation modes.

    Software-in-the-Loop Modeling and Simulation

    SIL is the inclusion of compiled production software code into a simulation model.

    • Software-in-the-loop M&S can be viewed as Simulation-based Software Evaluation.

    • A software system can be executed under simulated input conditions for the purpose of evaluating how well the software system functions under such input conditions.

    • For example, the software used to display operational information on a handheld computer can be executed under simulated input data (e.g., video, voice, images, text) received from many different sources for the purpose of evaluating how well the software satisfies its requirements.

    • Software-in-the-loop M&S is a cost-effective method for evaluating a complex, mission-critical software system before it is used in the real world.

    Strategic Use of HIL and SIL

    HIL and SIL simulations have long been used to test electronic control units (ECUs) and software. Now they have a new application field: calibration and parameterization of a vehicle stability controller, using simulation. A virtual calibration procedure like this requires far more precise models and new approaches to optimizing vehicle dynamics, and also raises a lot of development process issues.

    In SIL, the actual Production Software Code is incorporated into the mathematical simulation that contains the models of the Physical System. This is done to permit inclusion of software functionality for which no model(s) exists, or to enable faster simulation runs. SIL

    • enables the inclusion of control algorithm functionality for which no model exists

    • increases simulation speed by including compiled code in place of interpretive models

    • verifies that code generated from a model will function identically to the model

    • guarantees that an algorithm in the modeling environment will function identically to that same algorithm executing in a production controller

    SIL for early-stage testing of AUTOSAR software component

    In Embedded Software, the early-stage testing of source code is important since it may reduce the future development cost. However, at the automotive domain, the conventional software testing methods depend on actual system and hardware such as Hardware-in-the-Loop simulator and vehicle, then the early-stage testing method of automotive software is still in immature status. Therefore the testing of automotive software component is delayed until they are developed enough to run at the actual hardware. Implementing Best Inventive Problem Solving (IPS) Practices for Embedded Software Testing, we can develop a method to do dynamic analysis and test the AUTOSAR software component by SIL simulation without target system hardware. It provides rapid prototyping environment to validate the behavior of automotive software and helps to improve the quality of software component from the early error detection.

    See More
    Computer Science & Engineering, Engineering - Electrical, Engineering - General, Engineering - Industrial & Manufacturing, Information Technology, Mathematics, Statistics