Testen von Embedded
Testen von Embedded
Systems
Systems
Hardware in the Loop (HIL) Testing
VU 2.0, 182.117, WS 2008/09
R i d KIRNER
Testing Embedded Software
g
• Testing the whole system including the physical
environment is not possible during the early development stage of embedded systems.
• Thus, testing phases at intermediate stages of system
development can help:
– Model-in-the-Loop (MIL)
– Software-in-the-Loop (SIL)Software in the Loop (SIL)
– Processor-in-the-Loop (HIL)
H d i th L (HIL)
– Hardware-in-the-Loop (HIL)
– Final System Test
2 Testen von Embedded Systems
Testing within the V-Model (1)
g
( )
The V-model for testing activities to development activities:
Validation Test
Customer’s Requirements
System Test
Specification System Design Requirements Document Integration Test SW Design Unit Test Module Design Implementation
Testing within the V-Model (2)
g
( )
• The standard V-model already acknowledges the specific testing h i d f t ifi ti
phases required for system verification.
• However, the standard V-model doesn‘t address the real-life requirements of early stage product verifications
requirements of early-stage product verifications.
– Early-stage product verification is about testing against the system requirements without having the system actually built!y q g y y
– In reality, system components like SW and HW are developed in parallel
– To safe cost, early-stage testing at system level is needed to
detect incompatible SW behavior before integration with final HW. T h i d d t t h t i it ifi ti th ithi
• Techniques are needed to get short-circuit verification paths within the V-model.
4 Testen von Embedded Systems
Testing within the V-Model (3)
g
( )
Early-stage testing activities within the V-model:
HIL Validation Test Customer’s Requirements HIL System Test
Specification System Design Requirements Document MIL PIL SIL Integration Test SW Design SIL Unit Test Module Design Implementation
Model-in-the-Loop (MIL) Testing
p (
)
g
• Model-in-the-Loop (MIL)p ( )
• MIL testing is system simulation by using a model of the system
model of the system.
• Pro: early verification of the requirements and the algorithms of the intended solution
the algorithms of the intended solution
• Con: at this early stage it is difficult to reason
i i
about required processing resources.
Software-in-the-Loop (SIL) Testing
p (
)
g
• Software-in-the-Loop (SIL)p ( )
• SIL testing is done by executing the software typically on a standard PC hardware
typically on a standard PC hardware.
• Pro: most errors in the functional domain may be already detected at this level
already detected at this level.
• Con: the COTS components (compiler and
f PC) h diff t b h i
processor of PC) may have different behavior than the intended target platform.
Processor-in-the-Loop (PIL) Testing
p (
)
g
• Processor-in-the-Loop (PIL)p ( )
• PIL testing is done by executing the software typically on a prototypical hardware board
typically on a prototypical hardware board
equipped with the (planned) target processor.
• Pro: it is already possible to assess the concretePro: it is already possible to assess the concrete resource requirements of the software (timing
domain memory consumption etc ) domain, memory consumption, etc.)
• Con: real testing scenarios may be missed
Hardware-in-the-Loop (HIL) Testing
p (
)
g
• HIL testing is done by executing the software on the embedded platform, where the
environment between the actuator and the sensor is modeled by the HIL simulator.
• HIL testing can be done already before theHIL testing can be done already before the
complete prototype hardware of the system is build.
build.
• The HIL simulator includes actuators, sensors, and the interaction chain between them
and the interaction chain between them.
HIL Testing (2)
g ( )
HIL testing vs. Final System Test
SW SW Software: Execution Pl tf Prototype Execution ECU: Ph i l E i t Platform HIL Si l t Execution Platform
Environment: HIL Simulator Physical Environment
Environment:
HIL Simulator (1)
( )
HIL Simulators are typically packed into 19” racks, being customized by HIL simulation y modules:
HIL Simulator (2)
( )
Examples of expansion modules of a HIL simulator:p p
simulation modules (traction, lambda probe, etc.)
HIL
programmable power supplies
( p ) Sim u signal conditioning CAN gateway u lato r CAN gateway
interface to diagnostic hardware
r g
• • •
Economical aspects of HIL Testing
p
g
• HIL testing equipment is quite expensive compared to MIL or SIL: special hardware components are needed
– special hardware components are needed
– HIL simulator typically has to configured for each product to be tested
• However, HIL testing still provides cost reduction:
– allows to find subtle errors caused by the environment, even before the complete prototype hardware of the system is buildp p yp y – it is significantly cheaper to find errors in the early stage of
development (e.g., during HIL testing instead of testing the real prototype system)
real prototype system)
• Example: with HIL testing one can test the motor control box
already before the motor of the car is available (by simulating the physical characteristics of the motor)
physical characteristics of the motor).
Challenges of HIL Testing
g
g
• Testing a real system like an automotive g y vehicle isn’t trivial:
several thousands of signals may have to be – several thousands of signals may have to be
connected to set-up a HIL test
– reconfiguration of a HIL simulator has to be fast to improve its utilizationp
– accurate models are needed to test the
software under realistic operation scenarios software under realistic operation scenarios
Outlook
Mi 03 12 2008 Fault Injection + Example 3
Mi, 03.12.2008 Fault Injection + Example 3