28
1

Simulation-based Test Management and Automation · Simulation-based Test Management and Automation Sang-Ho Yoon Senior Application Engineer. 3 Today’s Agenda ... 4/28/2016 3:08:05

  • Upload
    others

  • View
    23

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Simulation-based Test Management and Automation · Simulation-based Test Management and Automation Sang-Ho Yoon Senior Application Engineer. 3 Today’s Agenda ... 4/28/2016 3:08:05

1

Page 2: Simulation-based Test Management and Automation · Simulation-based Test Management and Automation Sang-Ho Yoon Senior Application Engineer. 3 Today’s Agenda ... 4/28/2016 3:08:05

2© 2016 The MathWorks, Inc.

Simulation-based Test Management and Automation

Sang-Ho YoonSenior Application Engineer

Page 3: Simulation-based Test Management and Automation · Simulation-based Test Management and Automation Sang-Ho Yoon Senior Application Engineer. 3 Today’s Agenda ... 4/28/2016 3:08:05

3

Today’s Agenda

§ Verification Activities in MBD§ Simulation-Based Test§ Manage and Automate Simulation-Based Tests§ Equivalence Test between Model and Generated Code§ Questions and Answers

Page 4: Simulation-based Test Management and Automation · Simulation-based Test Management and Automation Sang-Ho Yoon Senior Application Engineer. 3 Today’s Agenda ... 4/28/2016 3:08:05

4© 2016 The MathWorks, Inc.

Verification Activities in MBD

Page 5: Simulation-based Test Management and Automation · Simulation-based Test Management and Automation Sang-Ho Yoon Senior Application Engineer. 3 Today’s Agenda ... 4/28/2016 3:08:05

5

Verification in DO-178C (Software Considerations in Airborne Systems and Equipment Certification)

*DO-178C Section 6.0

Page 6: Simulation-based Test Management and Automation · Simulation-based Test Management and Automation Sang-Ho Yoon Senior Application Engineer. 3 Today’s Agenda ... 4/28/2016 3:08:05

6

Verification Activities in MBD

§ Model Verification– Design Review

§ Requirement Traceability§ Report Generation

– Static Analysis§ Model Standards Checking§ Design Error Detection§ Prove Design Correctness

– Dynamic Test§ Simulation-based Functional Test§ Coverage Analysis

§ Code Generation and Verification– Code Review

§ Code Inspection– Static Analysis

§ Code Metrics and Coding Rule Checking§ Formal Verification (Abstract Interpretation)

– Equivalence Test§ SIL(Software-In-the-Loop) and PIL(Processor)

Requirements

Model

Design

Code

Integration

User Acceptance

1

2

Code

Page 7: Simulation-based Test Management and Automation · Simulation-based Test Management and Automation Sang-Ho Yoon Senior Application Engineer. 3 Today’s Agenda ... 4/28/2016 3:08:05

7© 2016 The MathWorks, Inc.

Simulation-based Test

Page 8: Simulation-based Test Management and Automation · Simulation-based Test Management and Automation Sang-Ho Yoon Senior Application Engineer. 3 Today’s Agenda ... 4/28/2016 3:08:05

8

Example Model

Page 9: Simulation-based Test Management and Automation · Simulation-based Test Management and Automation Sang-Ho Yoon Senior Application Engineer. 3 Today’s Agenda ... 4/28/2016 3:08:05

9

Test Harness

Test Cases (Signal Builder)

Output Check(Assertions)

Model (Model Block)

Module Test-Harness

Page 10: Simulation-based Test Management and Automation · Simulation-based Test Management and Automation Sang-Ho Yoon Senior Application Engineer. 3 Today’s Agenda ... 4/28/2016 3:08:05

10

Model Coverage ReportSimulink Verification and Validation

§ Coverage metrics identifies untested portions of your model

Page 11: Simulation-based Test Management and Automation · Simulation-based Test Management and Automation Sang-Ho Yoon Senior Application Engineer. 3 Today’s Agenda ... 4/28/2016 3:08:05

11

How about Legacy Code?

§ Use of Legacy Code Tool for introduction of existing C code on Simulink models

specification

External C Function

MATLAB code

Page 12: Simulation-based Test Management and Automation · Simulation-based Test Management and Automation Sang-Ho Yoon Senior Application Engineer. 3 Today’s Agenda ... 4/28/2016 3:08:05

12

Coverage for C-code S-Functions

C code

Coverage

Model

Design

S-Function

Page 13: Simulation-based Test Management and Automation · Simulation-based Test Management and Automation Sang-Ho Yoon Senior Application Engineer. 3 Today’s Agenda ... 4/28/2016 3:08:05

13© 2016 The MathWorks, Inc.

How to Manage Test Models

Page 14: Simulation-based Test Management and Automation · Simulation-based Test Management and Automation Sang-Ho Yoon Senior Application Engineer. 3 Today’s Agenda ... 4/28/2016 3:08:05

14

Simulink Test: Test Harness

If only a subsystem need to be tested…Do I need to make a new model for it?

If a subsystem is a library reference…Do I need to make a new model for it?

Do I need to make multiple test harnesses for multiple test objectives?

Additional Subsystems

Page 15: Simulation-based Test Management and Automation · Simulation-based Test Management and Automation Sang-Ho Yoon Senior Application Engineer. 3 Today’s Agenda ... 4/28/2016 3:08:05

15

Test Harnesses

§ Enables unit testing without requiring new model

§ Synchronized testing environment§ Supports testing library blocks

Main Model

Test Harness

Component under testExercise Analyze

Page 16: Simulation-based Test Management and Automation · Simulation-based Test Management and Automation Sang-Ho Yoon Senior Application Engineer. 3 Today’s Agenda ... 4/28/2016 3:08:05

16© 2016 The MathWorks, Inc.

How to Make Test Scenarios

Page 17: Simulation-based Test Management and Automation · Simulation-based Test Management and Automation Sang-Ho Yoon Senior Application Engineer. 3 Today’s Agenda ... 4/28/2016 3:08:05

17

Simulink Test: Test Sequence Block

§ Design temporal or logic-based test scenarios

§ Works with MATLAB Action Language

§ Create complex test inputs and assessments

§ Trouble shooting aids

Test Sequence/Assessment Block

Page 18: Simulation-based Test Management and Automation · Simulation-based Test Management and Automation Sang-Ho Yoon Senior Application Engineer. 3 Today’s Agenda ... 4/28/2016 3:08:05

18

Test Sequence: "verify" statement

§ Streams to Simulation Data Inspector§ Integrates with Simulink Test Manager pass/fail

Page 19: Simulation-based Test Management and Automation · Simulation-based Test Management and Automation Sang-Ho Yoon Senior Application Engineer. 3 Today’s Agenda ... 4/28/2016 3:08:05

19© 2016 The MathWorks, Inc.

How to Automate Various Tests

Page 20: Simulation-based Test Management and Automation · Simulation-based Test Management and Automation Sang-Ho Yoon Senior Application Engineer. 3 Today’s Agenda ... 4/28/2016 3:08:05

20

Simulink Test: Test Manager

§ Create Test Cases § Group into Test Suites and Test

Files§ Execute individual or batch § View summary and detailed

results§ Archive, export, report

Page 21: Simulation-based Test Management and Automation · Simulation-based Test Management and Automation Sang-Ho Yoon Senior Application Engineer. 3 Today’s Agenda ... 4/28/2016 3:08:05

21

Test Manager Coverage Integration

§ Coverage collected and aggregated automatically

§ New support for coverage on Simulink Test harnesses

§ View coverage summary from test results§ Embed full coverage reports into a test

manager report

Collect and aggregate coverage using Simulink Test Manager

Page 22: Simulation-based Test Management and Automation · Simulation-based Test Management and Automation Sang-Ho Yoon Senior Application Engineer. 3 Today’s Agenda ... 4/28/2016 3:08:05

22

1. Test Harnesses 2. Test Sequence Block 3. Test Manager

• Synchronized, simulatable test environment

• Inputs and assessments based on logical, temporal conditions

• Author, execute, manage test cases

• Review, export, report

Summary of Simulink Test

Main Model

Test Harness

Component under test

Page 23: Simulation-based Test Management and Automation · Simulation-based Test Management and Automation Sang-Ho Yoon Senior Application Engineer. 3 Today’s Agenda ... 4/28/2016 3:08:05

23© 2016 The MathWorks, Inc.

Equivalence Test between Model and Generated Code

Page 24: Simulation-based Test Management and Automation · Simulation-based Test Management and Automation Sang-Ho Yoon Senior Application Engineer. 3 Today’s Agenda ... 4/28/2016 3:08:05

24

Software-in-the-Loop (SIL) Testing:Verify Production Controller with Software-in-the-loop

Compiled C CodeS-Function

(Windows DLL)

CodeGeneration

Execution• Host/Host• Nonreal-time

Page 25: Simulation-based Test Management and Automation · Simulation-based Test Management and Automation Sang-Ho Yoon Senior Application Engineer. 3 Today’s Agenda ... 4/28/2016 3:08:05

25

Code Coverage for Generated Code with SIL

Page 26: Simulation-based Test Management and Automation · Simulation-based Test Management and Automation Sang-Ho Yoon Senior Application Engineer. 3 Today’s Agenda ... 4/28/2016 3:08:05

26

Summary

§ Model Verification includes Reviews, Analyses and Tests§ Model-Based Tests can be efficiently managed with Simulink Test§ Simulink Test provides following functionalities

– Test Harnesses– Test Sequence– Test Manager

Page 27: Simulation-based Test Management and Automation · Simulation-based Test Management and Automation Sang-Ho Yoon Senior Application Engineer. 3 Today’s Agenda ... 4/28/2016 3:08:05

27

The MathWorks

Change the world by

Accelerating the paceof discovery, innovation, development, and learning

in engineering and science

Page 28: Simulation-based Test Management and Automation · Simulation-based Test Management and Automation Sang-Ho Yoon Senior Application Engineer. 3 Today’s Agenda ... 4/28/2016 3:08:05

28

Q&A