Verification, Validation and Test in Model Based Design Manohar Reddy 2015 The MathWorks, Inc. 1
Continuous Test & Verification Productivity + Model & Code Quality System & Component Dynamic testing & Static analysis Needs verification! continuous 2
Multi-Mode Hybrid Electric Vehicle with Model Based Design EV Mode Serial HEV Mode Engine Mode Higuchi, N., Sunaga, Y., Tanaka, M., Shimada, H.: Development of a New Two-Motor Plug-In Hybrid System, SAE 2013-01-1476 (2013) 3
Multi-Mode Hybrid Electric Vehicle Define Requirements Complete Integration &Test System-Level Specification System-Level Integration & Test Battery Engine Energy Management Subsystem Design Simulink Plant Model Subsystem Integration & Test Failure Production C-Code Subsystem Implementation 4
Continuous Test and Verification Framework Repeat Slice Reproduce the failure at the simulation level Isolate the problematic behavior Productivity + Quality Fix Fix and Perform Unit Testing Check Check for further design errors needs verification! Test Test Systematically and Test Completely continuous 5
Reproduce the Failure in Simulation Repeat Confirm the problem In the Lab/Desktop Simulation Slice Fix Check Test 6
Failure Report Drive cycle Reproduce Failure 7
Simulation Environment Controller Plant 8
Modeling the Test Drive cycle Controller Plant 9
Modeling the Test Safety Property Engine RPM must remain within operating bounds limits Controller Plant 10
Battery State of Charge Initial state of charge? Sweep from 100% to 50% Controller Plant 11
12
Model Slicing: Isolate the problematic behavior Repeat Simulation Scenario Isolate the problem Slice Fix Check Test 13
Challenge of Understanding Behavior Complexity of Plant 14
Challenge of Understanding Behavior Complexity of Plant Complexity of Controller 15
Challenge of Understanding Behavior Complexity of Plant Complexity of Controller Complexity of Dynamics Turning backwards 16
Model Slicing 17
Complete Model Slicer Workflow Identify Interest Original Design Model Incorporate Changes Iterate Highlighted Model Updated Slice Model Create Slice Model Slice Model MBD Work: Simulate/Debug Formal analysis Update 18
Isolating Troubling Behavior with Model Slicer Simulation Scenario Controller Plant Model Slicer Area of Interest Stateflow Highlighting Highlight of Relevant Parts Identify Interest Original Design Model Incorporate Changes Highlighted Model Iterate Updated Slice Model Create Slice Model Slice Model MBD Work 19
Fixing the failure and Unit Testing Repeat Simulation Scenario Repeat & isolate the problem Fix faulty components Isolate Fix Check Test 20
State Synchronization Error Engine Missing Turning Transition Backwards Turning backwards Isolate and Fix 21
Unit Testing Workflow Main Model Test Harness 1. Separate 2. Reproduce Bug and Fix 4. Synchronize 3. Confirm 22
23
In-model Verification Isolate Component in Test Harness Verification Result streamed to Data Inspector In-model Verification with verify keyword 24
Check for further design errors Repeat Simulation Scenario Repeat & isolate the problem Fix faulty components Check everything Isolate Fix Check Test 25
Develop a Robust Design with Static Checking Static Analysis Capabilities Simulink Design Verifier Property Proving Design Error Detection Test Generation Model Advisor Model Metrics 26
Find Hidden Issues with Design Error Detection Transition not possible given range of u, h1, h2 U: [0,10] h1 = 15 h2 = 5 27
Demo 28
~Cond1 ~Cond2 Cond1 Cond2 29
~Cond1 Cond1 X ~Cond2 Cond2 30
Fixing-as-you go Demo 31
Prevent errors by Fixing-as-you go Edit-time checking Simulink Stateflow Modeling Standards Prohibited blocks violations Block and port name violations Customize rules to corporate standards Invalid port name Missing Default Transition Duplicate Data Store 32
Test : Systematically and Completely Repeat Simulation Scenario Repeat & isolate the problem Fix faulty components Check everything Test Systematically and Test Completely Isolate Fix Check Test 33
Test Manager Platform Systematic authoring, management, execution, and reporting of test cases Unites together a broad set of capabilities Simulink Test 34
MATLAB Script Criteria 35
Time Tolerance Value Tolerance 36
Top-It-Off Workflow 1 Run Existing Tests Aggregate Coverage 2 Simulink Design Verifier Generate Test Cases 3 Run New Tests Aggregate Coverage 37
38
Integration with Test Automation Servers Any continuous integration system that supports Test Anything Protocol (TAP) 39
Code-to-Model Verification Code Generator C Test Manager Polyspace Software-In-Loop (SIL) Dynamic Static Reuse model-based tests Equivalence testing Code Coverage 40
Equivalence Checking and Code Coverage (Software-In-Loop) 41
Justification for Code Coverage Justify 42
Continuous Test and Verification Framework helps to Reactively Reproduce the Field Issues in Simulation Proactively Prove that Implementation satisfies Requirements Repeat Reproduce the failure in simulation Check Check for design errors early Slice Isolate the problematic behavior Fix Fix and Perform Unit Testing Fix Fix and Perform Unit Testing Slice Isolate the problematic behavior to simplify debugging Check Check for further design errors Test Test Systematically and Test Completely Test Test Systematically and Test Completely Prove Prove Safety Properties/Requirements 43
Model Based Design helps to Check Fix Slice Productivity + Quality Repeat Slice Fix Test Prove Continuous Test & Verification Check Test 44
MathWorks Training Offerings http://www.mathworks.com/services/training/ 45
Speaker Details Manohar Reddy Email: Manohar.Reddy@mathworks.in Contact MathWorks India Call: 080-6632-6000 Email: info@mathworks.in 46