Using Hardware-in-the-Loop in Automotive Software Testing

Testing embedded systems for cars is a daunting task. Today’s modern cars can contain up to 100 or more electronic control units (ECUs). ECUs today control essentially every major function of a car, from acceleration to braking. Furthermore, not all of the ECUs are not manufactured by the same company; thus, it may be difficult to start testing until all the components come together in a prototype car—and by that time, there might not be enough time to completely ensure that the car is ready for the road! 

This is where hardware-in-the-loop (HIL) simulation comes in. HIL operates by testing ECUs in a closed-loop system with components that are simulated in a virtual environment so that they can be thoroughly tested without needing to have the complete product available. Testing in this manner has many benefits, including speed and cost; it can also provide a means to shift-left, or start testing sooner, therefore ensuring that you have the time to perform the critical tests before it is too late in the development process.

How Hardware-in-the-Loop Works

HIL technology is integral in the development process in achieving the goal of separating the hardware from the OS and the application layers during the manufacturing process. HIL works by simulating one or more components as they interact with real-life devices, such as an ECU, a mechanical device, or test benches; this interaction between the simulated components and the real devices is crucial. An example of a test from the simulated component would be reading measurements from an actuator controlled by an ECU, calculating and performing numeric integration (which simulates the dynamic model of the real system), and then it outputting the result in the sensor simulation from an ECU. All of these components would need to interact with each other under real-time conditions. Failure to do so would result in an unstable simulation that could have a number of detrimental outcomes, from unsatisfactory results, to even possibly damaging the ECU that you are testing. 

Benefits of Using HIL Technology

HIL technology is able to reduce costs and provide the best quality product. It reduces costs by moving functional tests away from test drives and test benches to the HIL laboratory—which is much cheaper to maintain. Additionally, it will minimize the testing time needed for costly prototypes or test benches. Another benefit of using an HIL lab would be that all of the testing could be repeated as many times as necessary; this also means that it would be much easier to automate—which might not be the case with real-world prototypes. The labs would also facilitate the testing of real-life situations that could be far too dangerous to perform with a prototype, such as sudden braking tests from high speeds. The HIL lab is able to create test environment conditions that are so realistic and exact that an ECU would not be able to differentiate between a simulated environment and real-world conditions since it is possible to create the exact same electrical response that is expected by the ECU. Having a system where we can precisely control the electrical response allows us to artificially introduce any type of sensor failure that might be hard to reproduce under normal conditions—further expanding on the number of test conditions we are able to test for.

Example: Using Hardware-in-the-Loop

In previous roles, I have had experience working with these types of test benches. In one specific example, I was working as a part of a team that was testing power supplies that were used in aircraft engines. The work would involve simulating voltage spikes to ensure that the power output from the control would not exceed tolerances or overload, especially at extremely cold or hot temperature conditions. Obviously, it is better those we as testers run these tests as simulations rather than in final products-we don’t want to cause an actual plane crash.

For more information regarding how this works systematically, as well as tutorials on how you would go about simulating this example, head over to MathWorks; they have a plethora of tutorials and informative videos that can help you get the testing knowledge you need to be successful in automotive testing.


Automotive Software Testing is a newer denomination in the testing industry. However, with autonomous vehicle development rapidly growing and the increasing amounts of software being put into cars, current and prospective software testers are going to need to become well versed in the methods and strategies surrounding testing the software car. HIL technology provides a solution to the overarching issue of the automotive design timeline, by breaking up the testing load sooner rather than later. All in all, HIL technology can make testing the software car easier, safer, more in-depth, and more efficient-resulting in safer and smarter cars. LogiGear is a Silicon Valley company with over 25 years of Software Testing experience; from automotive mobile app testing to sensor testing, to testing embedded systems, and more, we can help streamline your automotive testing strategy. If you’re looking to steer your testing towards success, check out our Automotive Testing Solution or contact us today!

Tony Luu
Tony Luu has more than eight years of experience in QA and Software Life Cycle Development. Tony is currently a Senior Project Lead at LogiGear Corporation, and has lead project development for several clients, most notably including Linkedin, Cisco and LeapFrog. Tony received a Bachelor of Applied Science in lectrical and Electronics Engineering from Purdue University.