What is hardware-in-the-loop testing?

In the automotive industry, hardware-in-the-loop (HIL) refers to a method of testing and validating complex software systems on specially equipped test benches that receive data inputs from physical devices such as radars and cameras.

As the automotive industry evolves toward the software-defined vehicle, where more features and functions are primarily enabled through software, automotive software developers are evolving their methods as well. The slow, incremental waterfall method has given way to continuous development (CD), continuous integration (CI) and continuous testing (CT), which speed up development, cut costs and improve the quality of the finished product.

A typical CI/CD/CT sequence consists of defining the requirements of the new software, generating code, performing software-in-the-loop (SIL) simulation testing, integrating the results into the continually evolving code base, and then conducting HIL testing and validation.

Performing manual testing is not practical, given the complexity of the software being developed. It is expensive and time-consuming to physically load software into an actual vehicle and test-drive it for the potentially hundreds of thousands of miles needed to make sure the software works in all types of driving conditions.

How HIL works

HIL testing entails simulating vehicle and environmental inputs for the electronic control unit (ECU) under test, causing it to believe that it is reacting to real-world driving conditions on the open road. The HIL bench contains all of the relevant vehicle components. A simulator presents inputs to actual cameras and radar systems, which in turn send signals to the system under test to see whether it responds correctly to the inputs.

For example, test scripts can create a scenario in which a vehicle traveling at 60 mph around a curve in the rain encounters an unknown object in the road or an oncoming car swerving across the center line. Cameras and radars attached to the HIL test bench send images to the ECU, and the system under test has to process that data in real time and decide the course of action to take.

Benefits of HIL

HIL testing is an indispensable part of the modern automotive software development process for a variety of reasons:

  • HIL testing can run through hundreds or thousands of scenarios without the time and costs associated with conducting physical road tests.
  • HIL testing can accommodate scenarios that would be too dangerous or impractical to test on the road.
  • HIL tests are repeatable.
  • The HIL testing process is highly automated and can accommodate multithreading so that multiple tests can occur at the same time, which speeds the development process.
  • HIL supports a frequent software release process with known system behavior performance.
  • While HIL testing occurs later in the development process than SIL testing, it still occurs within the parameters of the CI/CD/CT process and enables developers to catch potential flaws before shipping the product to OEMs.
  • HIL test results can be shared with development teams from OEMs and third parties, which also speeds up development and contributes to quality, reliability and safety.

Because HIL test benches are physical devices tied to a specific location, software development has historically been fragmented. Today, however, Aptiv is moving to a cloud-based, globally available architecture to enable central control of test benches remotely from anywhere in the world. Learn more in our white paper on the future of automotive software development.