verification, validation and test in model based design · verification, validation and test in...

46
1 © 2015 The MathWorks, Inc. Verification, Validation and Test in Model Based Design Manohar Reddy

Upload: others

Post on 28-May-2020

27 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Verification, Validation and Test in Model Based Design · Verification, Validation and Test in Model Based Design Manohar Reddy. 2 Continuous Model & Code System & Component Dynamic

1© 2015 The MathWorks, Inc.

Verification, Validation and Test

in Model Based Design

Manohar Reddy

Page 2: Verification, Validation and Test in Model Based Design · Verification, Validation and Test in Model Based Design Manohar Reddy. 2 Continuous Model & Code System & Component Dynamic

2

Continuous

Model & Code

System & Component

Dynamic testing & Static analysis

Test & Verification

Model & Code

Dynamic testing & Static analysis

System & Component

Productivity

continuous

Needs verification!

Quality

+

Page 3: Verification, Validation and Test in Model Based Design · Verification, Validation and Test in Model Based Design Manohar Reddy. 2 Continuous Model & Code System & Component Dynamic

3

Multi-Mode Hybrid Electric Vehicle

Higuchi, N., Sunaga, Y., Tanaka, M., Shimada, H.: Development of a New Two-Motor Plug-In Hybrid

System, SAE 2013-01-1476 (2013)

EV Mode Serial HEV Mode Engine Mode

with Model Based Design

Page 4: Verification, Validation and Test in Model Based Design · Verification, Validation and Test in Model Based Design Manohar Reddy. 2 Continuous Model & Code System & Component Dynamic

4

Define

Requirements

System-Level

Specification

Subsystem

Design

Battery

Engine

Energy Management

Subsystem

Implementation

Production

C-Code

Simulink

Plant Model

Subsystem

Integration & Test

Multi-Mode Hybrid Electric Vehicle

Complete

Integration &Test

System-Level

Integration & Test

Failure

Page 5: Verification, Validation and Test in Model Based Design · Verification, Validation and Test in Model Based Design Manohar Reddy. 2 Continuous Model & Code System & Component Dynamic

5

Continuous Test and Verification Framework

Repeat

Slice

Fix

Check

Test

Reproduce the failure at the simulation level

Isolate the problematic behavior

Fix and Perform Unit Testing

Check for further design errors

Test Systematically and Test Completely

Productivity

+Quality

continuous

needs verification!

Page 6: Verification, Validation and Test in Model Based Design · Verification, Validation and Test in Model Based Design Manohar Reddy. 2 Continuous Model & Code System & Component Dynamic

6

Reproduce the Failure in Simulation

Confirm the problem

In the Lab/Desktop

Simulation

Repeat

Slice

Fix

Check

Test

Page 7: Verification, Validation and Test in Model Based Design · Verification, Validation and Test in Model Based Design Manohar Reddy. 2 Continuous Model & Code System & Component Dynamic

7

Failure Report

Reproduce Failure

Drive cycle

Page 8: Verification, Validation and Test in Model Based Design · Verification, Validation and Test in Model Based Design Manohar Reddy. 2 Continuous Model & Code System & Component Dynamic

8

Simulation Environment

Controller Plant

Page 9: Verification, Validation and Test in Model Based Design · Verification, Validation and Test in Model Based Design Manohar Reddy. 2 Continuous Model & Code System & Component Dynamic

9

Modeling the Test

Controller Plant

Drive cycle

Page 10: Verification, Validation and Test in Model Based Design · Verification, Validation and Test in Model Based Design Manohar Reddy. 2 Continuous Model & Code System & Component Dynamic

10

Modeling the Test

Safety Property

Engine RPM must remain

within operating bounds limits

Controller Plant

Page 11: Verification, Validation and Test in Model Based Design · Verification, Validation and Test in Model Based Design Manohar Reddy. 2 Continuous Model & Code System & Component Dynamic

11

Battery State of Charge

Controller Plant

Sweep from 100% to 50%

Initial state of charge?

Page 12: Verification, Validation and Test in Model Based Design · Verification, Validation and Test in Model Based Design Manohar Reddy. 2 Continuous Model & Code System & Component Dynamic

12

Page 13: Verification, Validation and Test in Model Based Design · Verification, Validation and Test in Model Based Design Manohar Reddy. 2 Continuous Model & Code System & Component Dynamic

13

Model Slicing: Isolate the problematic behavior

Simulation

Scenario

Isolate the problem

Repeat

Slice

Fix

Check

Test

Page 14: Verification, Validation and Test in Model Based Design · Verification, Validation and Test in Model Based Design Manohar Reddy. 2 Continuous Model & Code System & Component Dynamic

14

Challenge of Understanding Behavior

Complexity of Plant

Page 15: Verification, Validation and Test in Model Based Design · Verification, Validation and Test in Model Based Design Manohar Reddy. 2 Continuous Model & Code System & Component Dynamic

15

Challenge of Understanding Behavior

Complexity of Plant

Complexity of Controller

Page 16: Verification, Validation and Test in Model Based Design · Verification, Validation and Test in Model Based Design Manohar Reddy. 2 Continuous Model & Code System & Component Dynamic

16

Challenge of Understanding Behavior

Complexity of Plant

Complexity of Controller

Complexity of Dynamics

Turning

backwards

Page 17: Verification, Validation and Test in Model Based Design · Verification, Validation and Test in Model Based Design Manohar Reddy. 2 Continuous Model & Code System & Component Dynamic

17

Model Slicing

Page 18: Verification, Validation and Test in Model Based Design · Verification, Validation and Test in Model Based Design Manohar Reddy. 2 Continuous Model & Code System & Component Dynamic

18

Complete Model Slicer Workflow

Original

Design

Model

Highlighted

Model

Slice

Model

Updated Slice

Model

Identify

Interest

Iterate

Create

Slice Model

MBD Work:

• Simulate/Debug

• Formal analysis

• Update

Incorporate

Changes

Page 19: Verification, Validation and Test in Model Based Design · Verification, Validation and Test in Model Based Design Manohar Reddy. 2 Continuous Model & Code System & Component Dynamic

19

Controller

Plant

Isolating Troubling Behavior with Model Slicer

Simulation

Scenario

Model Slicer Area of Interest

Highlight of

Relevant Parts

Stateflow

Highlighting

Original

Design Model

Highlighted

Model

Slice

Model

Updated Slice

Model

Identify

Interest

Iterate

Create

Slice Model MBD Work

Incorporate

Changes

Page 20: Verification, Validation and Test in Model Based Design · Verification, Validation and Test in Model Based Design Manohar Reddy. 2 Continuous Model & Code System & Component Dynamic

20

Fixing the failure and Unit Testing

Simulation

Scenario

Repeat & isolate the problem

Fix faulty

components

Repeat

Isolate

Fix

Check

Test

Page 21: Verification, Validation and Test in Model Based Design · Verification, Validation and Test in Model Based Design Manohar Reddy. 2 Continuous Model & Code System & Component Dynamic

21

State Synchronization Error

Missing Transition

Isolate and Fix

Engine Turning Backwards

Turning

backwards

Page 22: Verification, Validation and Test in Model Based Design · Verification, Validation and Test in Model Based Design Manohar Reddy. 2 Continuous Model & Code System & Component Dynamic

22

Unit Testing Workflow

Main Model

1. Separate

2. Reproduce

Bug and Fix

4. Synchronize 3. Confirm

Test Harness

Page 23: Verification, Validation and Test in Model Based Design · Verification, Validation and Test in Model Based Design Manohar Reddy. 2 Continuous Model & Code System & Component Dynamic

23

Page 24: Verification, Validation and Test in Model Based Design · Verification, Validation and Test in Model Based Design Manohar Reddy. 2 Continuous Model & Code System & Component Dynamic

24

In-model Verification

Isolate Component in Test

HarnessVerification Result streamed to

Data Inspector

In-model Verification with verify keyword

Page 25: Verification, Validation and Test in Model Based Design · Verification, Validation and Test in Model Based Design Manohar Reddy. 2 Continuous Model & Code System & Component Dynamic

25

Check for further design errors

Simulation

Scenario

Repeat & isolate the

problem

Fix faulty components

Check

everything

Repeat

Isolate

Fix

Check

Test

Page 26: Verification, Validation and Test in Model Based Design · Verification, Validation and Test in Model Based Design Manohar Reddy. 2 Continuous Model & Code System & Component Dynamic

26

Develop a Robust Design with

Static Checking

Model Advisor Model Metrics

Simulink Design Verifier

Property

Proving

Test

Generation

Static Analysis Capabilities

Design Error

Detection

Page 27: Verification, Validation and Test in Model Based Design · Verification, Validation and Test in Model Based Design Manohar Reddy. 2 Continuous Model & Code System & Component Dynamic

27

Find Hidden Issues with

Design Error Detection

U: [0,10]

h1 = 15

h2 = 5

Transition not possible

given range of u, h1, h2

Page 28: Verification, Validation and Test in Model Based Design · Verification, Validation and Test in Model Based Design Manohar Reddy. 2 Continuous Model & Code System & Component Dynamic

28

Demo

Page 29: Verification, Validation and Test in Model Based Design · Verification, Validation and Test in Model Based Design Manohar Reddy. 2 Continuous Model & Code System & Component Dynamic

29

Cond1 Cond2

~Cond1 ~Cond2

Page 30: Verification, Validation and Test in Model Based Design · Verification, Validation and Test in Model Based Design Manohar Reddy. 2 Continuous Model & Code System & Component Dynamic

30

Cond1 Cond2

~Cond1 ~Cond2X

Page 31: Verification, Validation and Test in Model Based Design · Verification, Validation and Test in Model Based Design Manohar Reddy. 2 Continuous Model & Code System & Component Dynamic

31

Fixing-as-you go

Demo

Page 32: Verification, Validation and Test in Model Based Design · Verification, Validation and Test in Model Based Design Manohar Reddy. 2 Continuous Model & Code System & Component Dynamic

32

Prevent errors by

Fixing-as-you go

Edit-time checking

– Simulink

– Stateflow

– Modeling Standards

Prohibited blocks violations

Block and port name violations

Invalid port name Duplicate Data StoreMissing Default Transition

Customize rules to

corporate standards

Page 33: Verification, Validation and Test in Model Based Design · Verification, Validation and Test in Model Based Design Manohar Reddy. 2 Continuous Model & Code System & Component Dynamic

33

Test : Systematically and Completely

Simulation

Scenario

Repeat & isolate the problem

Fix faulty components

Check everything

Test Systematically

and

Test Completely

Repeat

Isolate

Fix

Check

Test

Page 34: Verification, Validation and Test in Model Based Design · Verification, Validation and Test in Model Based Design Manohar Reddy. 2 Continuous Model & Code System & Component Dynamic

34

Test Manager PlatformSystematic authoring, management, execution,

and reporting of test cases

Unites together a broad set of

capabilities

Simulink Test

Page 35: Verification, Validation and Test in Model Based Design · Verification, Validation and Test in Model Based Design Manohar Reddy. 2 Continuous Model & Code System & Component Dynamic

35

MATLAB Script Criteria

Page 36: Verification, Validation and Test in Model Based Design · Verification, Validation and Test in Model Based Design Manohar Reddy. 2 Continuous Model & Code System & Component Dynamic

36

Value

Tolerance

Time

Tolerance

Page 37: Verification, Validation and Test in Model Based Design · Verification, Validation and Test in Model Based Design Manohar Reddy. 2 Continuous Model & Code System & Component Dynamic

37

Top-It-Off Workflow

Run Existing Tests

Aggregate Coverage

1

Simulink Design Verifier

Generate Test Cases

2

Run New Tests

Aggregate Coverage

3

Page 38: Verification, Validation and Test in Model Based Design · Verification, Validation and Test in Model Based Design Manohar Reddy. 2 Continuous Model & Code System & Component Dynamic

38

Page 39: Verification, Validation and Test in Model Based Design · Verification, Validation and Test in Model Based Design Manohar Reddy. 2 Continuous Model & Code System & Component Dynamic

39

Any continuous integration system that supports

Test Anything Protocol (TAP)

Integration with Test Automation Servers

Page 40: Verification, Validation and Test in Model Based Design · Verification, Validation and Test in Model Based Design Manohar Reddy. 2 Continuous Model & Code System & Component Dynamic

40

Reuse model-based tests

Equivalence testing

Code Coverage

Code-to-Model Verification

C

Dynamic

Test Manager

Software-In-Loop

(SIL)

Code Generator

Static

Polyspace

Page 41: Verification, Validation and Test in Model Based Design · Verification, Validation and Test in Model Based Design Manohar Reddy. 2 Continuous Model & Code System & Component Dynamic

41

Equivalence Checking and Code Coverage (Software-In-Loop)

Page 42: Verification, Validation and Test in Model Based Design · Verification, Validation and Test in Model Based Design Manohar Reddy. 2 Continuous Model & Code System & Component Dynamic

42

Justification for Code Coverage

Justify

Page 43: Verification, Validation and Test in Model Based Design · Verification, Validation and Test in Model Based Design Manohar Reddy. 2 Continuous Model & Code System & Component Dynamic

43

Continuous Test and Verification Framework helps to…

Repeat

Slice

Fix

Check

Test

Reproduce the failure in simulation

Isolate the problematic behavior

Fix and Perform Unit Testing

Check for further design errors

Test Systematically and Test

Completely

“Reactively” Reproduce the Field Issues

in Simulation

“Proactively” Prove that Implementation

satisfies Requirements

Check

Fix

Slice

Test

Prove

Check for design errors early

Fix and Perform Unit Testing

Isolate the problematic behavior to

simplify debugging

Test Systematically and Test

Completely

Prove Safety Properties/Requirements

Page 44: Verification, Validation and Test in Model Based Design · Verification, Validation and Test in Model Based Design Manohar Reddy. 2 Continuous Model & Code System & Component Dynamic

44

Model Based Design helps to…

Productivity

+Quality

Check

Fix

Slice

Test

Prove

Continuous Test &

Verification

Repeat

Slice

Fix

Check

Test

Page 45: Verification, Validation and Test in Model Based Design · Verification, Validation and Test in Model Based Design Manohar Reddy. 2 Continuous Model & Code System & Component Dynamic

45

MathWorks Training Offerings

http://www.mathworks.com/services/training/

Page 46: Verification, Validation and Test in Model Based Design · Verification, Validation and Test in Model Based Design Manohar Reddy. 2 Continuous Model & Code System & Component Dynamic

46

Speaker Details

Manohar Reddy

Email: [email protected]

Contact MathWorks India

Call: 080-6632-6000

Email: [email protected]