SlideShare a Scribd company logo
.lusoftware verification & validation
VVS
Automated Testing of Hybrid
Simulink/Stateflow Controllers
Industrial Case Studies
Reza Matinnejad
Shiva Nejati
Lionel Briand
SnT Centre/University of Luxembourg
Software Development in
Automotive
• Software development is largely model-based
• Automotive software models have dynamic behaviors
• Mathematical models
capturing plants/hardware
• Controllers
2
Two Types of Controllers
• Open loop controllers
• Closed loop controllers
3
Controller
Actuator Sensor
Plant
Input
Controller
Actuator
Plant
Input
Disturbances
Disturbances
Open Loop vs Closed Loop
• Closed loop controllers – PID controllers
• More expensive
• More accurate and self-adaptive
• Always present in large and critical cyber-physical systems
• Open loop controllers – State-based models
• Less expensive
• Often controls timing behaviors
• Is combined with closed-loop controllers
4
Simulink/Stateflow Models
• Heterogeneous
• Continuous behavior
• Are used for
• simulation
• algorithm design testing
• code generation
5
Time-Continuous
Simulink Model Hardware
Model
Network Model
Existing Simulink Testing Tools
• Control theory techniques
• Synthesis of linear PID controllers
• Automated test case generation
• Based on (formal) assertions or structural code coverage
• Automated verification
• Model checking or theorem proving
6
Limitations
• Automotive models are rarely linear
• Automatable test oracles may not be available or sufficient
• Test oracles are in many cases manual
• Structural coverage may not help reveal faults
• White box approaches have incompatibility issues
• Scalability issues
7
Black Box Search Based
Testing of Simulink
8
Solution Generation
Fitness computation
• Explorative
• Exploitative
Model Input
Spec
Input
Signals
Input Signals
• Simulate the model
• Compute Fitness functions
on outputs
Simulink
Model Fitness
values
Model
Simulation
ut
als
Output
Signal(s)
[SSBSE 2013, ASE 2014, ESEC/FSE 2015,
IST J 2015, ICSE 2016]
Fitness Functions – Closed Loop
• Generic requirements
• Stability, responsiveness and smoothness
• Maximizing (quantitative) fitness functions to generate
failure
9
InitialDesired
(ID)
Desired ValueI (input)
Actual Value (output)
FinalDesired
(FD)
time
T/2 T
Smoothness
Responsiveness
Stability
Fitness Functions – Closed Loop
• Specific requirements
• E.g., ``The contact between caliper and disk should occur
within 32ms’’
caliper position à disk position à
10
⌃[0,32]⇤((x  x0 + ✏) ^ (x x0 ✏))
x x0
Min{Max{Max{|x(t) (x0 + ✏)|, |x(t) (x0 ✏)|}}t0tT }
Translation [Abbas et. al. TECS 2013]
Fitness Functions – Open Loop
• Failure patterns
• Output diversity
11
0.0 1.0 2.00.0 1.0 2.0
-1.0
-0.5
0.0
0.5
1.0
Time Time
0.0
0.25
0.50
0.75
1.0
Output of Our Approach
• Failure Explanation
• A characterization of the input space showing under what
input conditions the system is likely to fail
• Visualized by diagrams or regression trees
• Failure Detection
• Individual test cases revealing failures
• A set of test input signals
12
Case studies
• A mixed of closed loop and open loop controllers, and plant
models
• Developed by BOSCH
• Publicly available
• A large plant model – a mathematical continuous model
• Developed by an automotive company
13
Failure Explanation – Heatmap
Diagram
14
L
R
Failure Explanation – Regression
Tree
15
All Points
Count
Mean
Std Dev
2384
1.016e+10
4.898e+11
c_gear>=1.0279
Count
Mean
Std Dev
1997
25167.822
135651.79
Count
Mean
Std Dev
387
6.257e+10
1.216e+12
t0>=0.0029462
Count
Mean
Std Dev
1631
4550.4502
55698.046
t0<0.0029462
Count
Mean
Std Dev
366
117044.69
276423.68
c_gear<1.0279
Failure Detection – Closed Loop
16
0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.080.0
0.042
0.044
0.046
0.048
0.050
0.052
⌃[0,32]⇤((x  x0 + ✏) ^ (x x0 ✏))Test Input violating:
time
position
Failure Detection – Open Loop
17
0 1.0 2.0 0 1.0 2.0
0
4.0
-4.0
-8.0
0
1.5
-1.5
1.0
-1.0
0.5
-0.5
2.0
-2.0
-6.0
10
5
10
6
Time Time
Test inputs exhibiting ``instability” and ``grow to infinity”
failure patterns
Summary of Lessons Learned
• Generating test cases is not enough
• It is important to help engineers with input space exploration
and failure explanation
18
All Points
Count
Mean
Std Dev
2384
1.016e+10
4.898e+11
c_gear>=1.0279
Count
Mean
Std Dev
1997
25167.822
135651.79
Count
Mean
Std Dev
387
6.257e+10
1.216e+12
t0>=0.0029462
Count
Mean
Std Dev
1631
4550.4502
55698.046
t0<0.0029462
Count
Mean
Std Dev
366
117044.69
276423.68
c_gear<1.0279
Summary of Lessons Learned
• Engineers do not always have specific and precise
requirements at hand
• We generate test cases that reveal violation of both specific
requirements and (estimated) failure patterns
19
0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.080.0
0.042
0.044
0.046
0.048
0.050
0.052
0 1.0 2.0
0
1.5
-1.5
1.0
-1.0
0.5
-0.5
10
5
Time
Summary of Lessons Learned
• Incompatibility issues or manual overhead is a major obstacle
for adoption of current Simulink testing tools
• Our approach is black box and has no overhead
• Time performance of our approach is acceptable
20
Our Tools
• SimCoTest
Simulink Controller Tester
https://sites.google.com/site/simcotesttool/
• CoCoTest
Continuous Controller Tester
https://sites.google.com/site/cocotesttool/
21

More Related Content

PDF
Augmenting Field Data for Testing Systems Subject to Incremental Requirements...
PDF
Approximation-Refinement Testing of Compute-Intensive Cyber-Physical Models: ...
PDF
AI in SE: A 25-year Journey
PDF
Mining Assumptions for Software Components using Machine Learning
PDF
A practical guide for using Statistical Tests to assess Randomized Algorithms...
PPTX
Application of the Actor Model to Large Scale NDE Data Analysis
PDF
TMPA-2017: 5W+1H Static Analysis Report Quality Measure
PDF
Automating System Test Case Classification and Prioritization for Use Case-Dr...
Augmenting Field Data for Testing Systems Subject to Incremental Requirements...
Approximation-Refinement Testing of Compute-Intensive Cyber-Physical Models: ...
AI in SE: A 25-year Journey
Mining Assumptions for Software Components using Machine Learning
A practical guide for using Statistical Tests to assess Randomized Algorithms...
Application of the Actor Model to Large Scale NDE Data Analysis
TMPA-2017: 5W+1H Static Analysis Report Quality Measure
Automating System Test Case Classification and Prioritization for Use Case-Dr...

What's hot (19)

PDF
Transfer defect learning
PPT
Simulink
PDF
Automated and Scalable Solutions for Software Testing: The Essential Role of ...
PPT
Pspice Introduction
PDF
Automatic Test Suite Generation for Key-Points Detection DNNs using Many-Obje...
PDF
MathWorks and Freescale Cup - Working with MATLAB & Simulink
PDF
Practical Constraint Solving for Generating System Test Data
PDF
Introduction to simulink (1)
PDF
Introduction to PSPICE
PDF
Simulink
PDF
Scilab for very beginners
PPTX
Simulink Projects Research Help
PPTX
REMI: Defect Prediction for Efficient API Testing (

ESEC/FSE 2015, Industria...
PPT
Intro to p-spice
PPTX
Orcad pspice intro and basics
PDF
Forelasning4
PDF
Py conie 2014
PDF
STL Algorithms In Action
PPTX
Matlab simulink introduction
Transfer defect learning
Simulink
Automated and Scalable Solutions for Software Testing: The Essential Role of ...
Pspice Introduction
Automatic Test Suite Generation for Key-Points Detection DNNs using Many-Obje...
MathWorks and Freescale Cup - Working with MATLAB & Simulink
Practical Constraint Solving for Generating System Test Data
Introduction to simulink (1)
Introduction to PSPICE
Simulink
Scilab for very beginners
Simulink Projects Research Help
REMI: Defect Prediction for Efficient API Testing (

ESEC/FSE 2015, Industria...
Intro to p-spice
Orcad pspice intro and basics
Forelasning4
Py conie 2014
STL Algorithms In Action
Matlab simulink introduction
Ad

Similar to Automated Testing of Hybrid Simulink/Stateflow Controllers (20)

PDF
Testing of Cyber-Physical Systems: Diversity-driven Strategies
PDF
Achieving Scalability in Software Testing with Machine Learning and Metaheuri...
PDF
Automated Testing of Autonomous Driving Assistance Systems
PDF
Effective Test Suites for ! Mixed Discrete-Continuous Stateflow Controllers
PDF
SBST 2019 Keynote
PDF
Improving Fault Localization for Simulink Models using Search-Based Testing a...
PDF
Enabling Automated Software Testing with Artificial Intelligence
PDF
Evaluating Model Testing and Model Checking for Finding Requirements Violatio...
PDF
Testing Autonomous Cars for Feature Interaction Failures using Many-Objective...
PDF
Automated Test Suite Generation for Time-Continuous Simulink Models
PDF
Scalable Software Testing and Verification of Non-Functional Properties throu...
PDF
Keynote presentation at DeepTest Workshop 2025
PDF
Testing Dynamic Behavior in Executable Software Models - Making Cyber-physica...
PDF
"How to Test and Validate an Automated Driving System," a Presentation from M...
PDF
How to find defects early and increase the reliability of software systems
PDF
Ijsrp p8589
PDF
Presentation by Lionel Briand
PPTX
Improving Dependability of Embedded Software System
PPTX
Innovate with confidence – Functional Verification of Embedded Algorithms
PDF
Making Model-Driven Verification Practical and Scalable: Experiences and Less...
Testing of Cyber-Physical Systems: Diversity-driven Strategies
Achieving Scalability in Software Testing with Machine Learning and Metaheuri...
Automated Testing of Autonomous Driving Assistance Systems
Effective Test Suites for ! Mixed Discrete-Continuous Stateflow Controllers
SBST 2019 Keynote
Improving Fault Localization for Simulink Models using Search-Based Testing a...
Enabling Automated Software Testing with Artificial Intelligence
Evaluating Model Testing and Model Checking for Finding Requirements Violatio...
Testing Autonomous Cars for Feature Interaction Failures using Many-Objective...
Automated Test Suite Generation for Time-Continuous Simulink Models
Scalable Software Testing and Verification of Non-Functional Properties throu...
Keynote presentation at DeepTest Workshop 2025
Testing Dynamic Behavior in Executable Software Models - Making Cyber-physica...
"How to Test and Validate an Automated Driving System," a Presentation from M...
How to find defects early and increase the reliability of software systems
Ijsrp p8589
Presentation by Lionel Briand
Improving Dependability of Embedded Software System
Innovate with confidence – Functional Verification of Embedded Algorithms
Making Model-Driven Verification Practical and Scalable: Experiences and Less...
Ad

More from Lionel Briand (20)

PDF
LTM: Scalable and Black-box Similarity-based Test Suite Minimization based on...
PDF
TEASMA: A Practical Methodology for Test Adequacy Assessment of Deep Neural N...
PDF
Automated Test Case Repair Using Language Models
PDF
Automated Testing and Safety Analysis of Deep Neural Networks
PDF
FlakyFix: Using Large Language Models for Predicting Flaky Test Fix Categorie...
PDF
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
PDF
Precise and Complete Requirements? An Elusive Goal
PDF
Large Language Models for Test Case Evolution and Repair
PDF
Metamorphic Testing for Web System Security
PDF
Simulator-based Explanation and Debugging of Hazard-triggering Events in DNN-...
PDF
Fuzzing for CPS Mutation Testing
PDF
Data-driven Mutation Analysis for Cyber-Physical Systems
PDF
Many-Objective Reinforcement Learning for Online Testing of DNN-Enabled Systems
PDF
ATM: Black-box Test Case Minimization based on Test Code Similarity and Evolu...
PDF
Black-box Safety Analysis and Retraining of DNNs based on Feature Extraction ...
PDF
PRINS: Scalable Model Inference for Component-based System Logs
PDF
Revisiting the Notion of Diversity in Software Testing
PDF
Applications of Search-based Software Testing to Trustworthy Artificial Intel...
PDF
Autonomous Systems: How to Address the Dilemma between Autonomy and Safety
PDF
Mathematicians, Social Scientists, or Engineers? The Split Minds of Software ...
LTM: Scalable and Black-box Similarity-based Test Suite Minimization based on...
TEASMA: A Practical Methodology for Test Adequacy Assessment of Deep Neural N...
Automated Test Case Repair Using Language Models
Automated Testing and Safety Analysis of Deep Neural Networks
FlakyFix: Using Large Language Models for Predicting Flaky Test Fix Categorie...
Requirements in Engineering AI- Enabled Systems: Open Problems and Safe AI Sy...
Precise and Complete Requirements? An Elusive Goal
Large Language Models for Test Case Evolution and Repair
Metamorphic Testing for Web System Security
Simulator-based Explanation and Debugging of Hazard-triggering Events in DNN-...
Fuzzing for CPS Mutation Testing
Data-driven Mutation Analysis for Cyber-Physical Systems
Many-Objective Reinforcement Learning for Online Testing of DNN-Enabled Systems
ATM: Black-box Test Case Minimization based on Test Code Similarity and Evolu...
Black-box Safety Analysis and Retraining of DNNs based on Feature Extraction ...
PRINS: Scalable Model Inference for Component-based System Logs
Revisiting the Notion of Diversity in Software Testing
Applications of Search-based Software Testing to Trustworthy Artificial Intel...
Autonomous Systems: How to Address the Dilemma between Autonomy and Safety
Mathematicians, Social Scientists, or Engineers? The Split Minds of Software ...

Recently uploaded (20)

PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PPTX
Log360_SIEM_Solutions Overview PPT_Feb 2020.pptx
PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
PDF
Digital Systems & Binary Numbers (comprehensive )
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PPTX
Reimagine Home Health with the Power of Agentic AI​
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PDF
Product Update: Alluxio AI 3.7 Now with Sub-Millisecond Latency
PDF
Cost to Outsource Software Development in 2025
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PPTX
Operating system designcfffgfgggggggvggggggggg
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PDF
Nekopoi APK 2025 free lastest update
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
System and Network Administration Chapter 2
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Design an Analysis of Algorithms I-SECS-1021-03
Log360_SIEM_Solutions Overview PPT_Feb 2020.pptx
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
wealthsignaloriginal-com-DS-text-... (1).pdf
Digital Systems & Binary Numbers (comprehensive )
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
Reimagine Home Health with the Power of Agentic AI​
Internet Downloader Manager (IDM) Crack 6.42 Build 41
Upgrade and Innovation Strategies for SAP ERP Customers
Product Update: Alluxio AI 3.7 Now with Sub-Millisecond Latency
Cost to Outsource Software Development in 2025
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Operating system designcfffgfgggggggvggggggggg
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
Nekopoi APK 2025 free lastest update
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
System and Network Administration Chapter 2

Automated Testing of Hybrid Simulink/Stateflow Controllers

  • 1. .lusoftware verification & validation VVS Automated Testing of Hybrid Simulink/Stateflow Controllers Industrial Case Studies Reza Matinnejad Shiva Nejati Lionel Briand SnT Centre/University of Luxembourg
  • 2. Software Development in Automotive • Software development is largely model-based • Automotive software models have dynamic behaviors • Mathematical models capturing plants/hardware • Controllers 2
  • 3. Two Types of Controllers • Open loop controllers • Closed loop controllers 3 Controller Actuator Sensor Plant Input Controller Actuator Plant Input Disturbances Disturbances
  • 4. Open Loop vs Closed Loop • Closed loop controllers – PID controllers • More expensive • More accurate and self-adaptive • Always present in large and critical cyber-physical systems • Open loop controllers – State-based models • Less expensive • Often controls timing behaviors • Is combined with closed-loop controllers 4
  • 5. Simulink/Stateflow Models • Heterogeneous • Continuous behavior • Are used for • simulation • algorithm design testing • code generation 5 Time-Continuous Simulink Model Hardware Model Network Model
  • 6. Existing Simulink Testing Tools • Control theory techniques • Synthesis of linear PID controllers • Automated test case generation • Based on (formal) assertions or structural code coverage • Automated verification • Model checking or theorem proving 6
  • 7. Limitations • Automotive models are rarely linear • Automatable test oracles may not be available or sufficient • Test oracles are in many cases manual • Structural coverage may not help reveal faults • White box approaches have incompatibility issues • Scalability issues 7
  • 8. Black Box Search Based Testing of Simulink 8 Solution Generation Fitness computation • Explorative • Exploitative Model Input Spec Input Signals Input Signals • Simulate the model • Compute Fitness functions on outputs Simulink Model Fitness values Model Simulation ut als Output Signal(s) [SSBSE 2013, ASE 2014, ESEC/FSE 2015, IST J 2015, ICSE 2016]
  • 9. Fitness Functions – Closed Loop • Generic requirements • Stability, responsiveness and smoothness • Maximizing (quantitative) fitness functions to generate failure 9 InitialDesired (ID) Desired ValueI (input) Actual Value (output) FinalDesired (FD) time T/2 T Smoothness Responsiveness Stability
  • 10. Fitness Functions – Closed Loop • Specific requirements • E.g., ``The contact between caliper and disk should occur within 32ms’’ caliper position à disk position à 10 ⌃[0,32]⇤((x  x0 + ✏) ^ (x x0 ✏)) x x0 Min{Max{Max{|x(t) (x0 + ✏)|, |x(t) (x0 ✏)|}}t0tT } Translation [Abbas et. al. TECS 2013]
  • 11. Fitness Functions – Open Loop • Failure patterns • Output diversity 11 0.0 1.0 2.00.0 1.0 2.0 -1.0 -0.5 0.0 0.5 1.0 Time Time 0.0 0.25 0.50 0.75 1.0
  • 12. Output of Our Approach • Failure Explanation • A characterization of the input space showing under what input conditions the system is likely to fail • Visualized by diagrams or regression trees • Failure Detection • Individual test cases revealing failures • A set of test input signals 12
  • 13. Case studies • A mixed of closed loop and open loop controllers, and plant models • Developed by BOSCH • Publicly available • A large plant model – a mathematical continuous model • Developed by an automotive company 13
  • 14. Failure Explanation – Heatmap Diagram 14 L R
  • 15. Failure Explanation – Regression Tree 15 All Points Count Mean Std Dev 2384 1.016e+10 4.898e+11 c_gear>=1.0279 Count Mean Std Dev 1997 25167.822 135651.79 Count Mean Std Dev 387 6.257e+10 1.216e+12 t0>=0.0029462 Count Mean Std Dev 1631 4550.4502 55698.046 t0<0.0029462 Count Mean Std Dev 366 117044.69 276423.68 c_gear<1.0279
  • 16. Failure Detection – Closed Loop 16 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.080.0 0.042 0.044 0.046 0.048 0.050 0.052 ⌃[0,32]⇤((x  x0 + ✏) ^ (x x0 ✏))Test Input violating: time position
  • 17. Failure Detection – Open Loop 17 0 1.0 2.0 0 1.0 2.0 0 4.0 -4.0 -8.0 0 1.5 -1.5 1.0 -1.0 0.5 -0.5 2.0 -2.0 -6.0 10 5 10 6 Time Time Test inputs exhibiting ``instability” and ``grow to infinity” failure patterns
  • 18. Summary of Lessons Learned • Generating test cases is not enough • It is important to help engineers with input space exploration and failure explanation 18 All Points Count Mean Std Dev 2384 1.016e+10 4.898e+11 c_gear>=1.0279 Count Mean Std Dev 1997 25167.822 135651.79 Count Mean Std Dev 387 6.257e+10 1.216e+12 t0>=0.0029462 Count Mean Std Dev 1631 4550.4502 55698.046 t0<0.0029462 Count Mean Std Dev 366 117044.69 276423.68 c_gear<1.0279
  • 19. Summary of Lessons Learned • Engineers do not always have specific and precise requirements at hand • We generate test cases that reveal violation of both specific requirements and (estimated) failure patterns 19 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.080.0 0.042 0.044 0.046 0.048 0.050 0.052 0 1.0 2.0 0 1.5 -1.5 1.0 -1.0 0.5 -0.5 10 5 Time
  • 20. Summary of Lessons Learned • Incompatibility issues or manual overhead is a major obstacle for adoption of current Simulink testing tools • Our approach is black box and has no overhead • Time performance of our approach is acceptable 20
  • 21. Our Tools • SimCoTest Simulink Controller Tester https://sites.google.com/site/simcotesttool/ • CoCoTest Continuous Controller Tester https://sites.google.com/site/cocotesttool/ 21