0% found this document useful (0 votes)
36 views27 pages

Modelización, Simulación y Pruebas en Simulink: Luis López

Manual de simulación.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views27 pages

Modelización, Simulación y Pruebas en Simulink: Luis López

Manual de simulación.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 27

Modelización , simulación y

pruebas en Simulink

Luis López

© 2015 The MathWorks, Inc.


1
Why Test?

 Does the subsystem/system meet the design requirements?

 The model worked last week… does it still?

 The model / algorithm has been modified… is it still working ok?

 Do these legacy models / libraries work in this new application?

 Does it work real-time, integrated with hardware?

 Does running the generated embedded code match running the model?

2
Testing to date…
 Create harness models
– to exercise model references or subsystems

 Write MATLAB code


– to run the tests

 Write more MATLAB code


– to verify the test results

 Write some more MATLAB code / using Report Generator


– to report on the test results

 Creating custom GUIs to manage running of tests

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

• Synchronized, simulatable test • Inputs and assessments based on logical, • Author, execute, manage test cases
environment temporal conditions • Review, export, report

Main Model

Component
under test

Test Harness
4
Creating Test Harnesses

5
6
But what if…

 The component is in a library

 The reset should be relative to the time constant of the filter

 We want to verify a requirement that:


filter output shall equal resetValue when reset is true

7
8
Release Notes – Test Harnesses

 Test Harnesses for Libraries R2016a

 External Test Harnesses R2016a

 External Test Harnesses with Requirements Linking R2016b

 Move/Clone test harnesses R2017a

9
Test Sequence / Test Assessment
block

10
Release Notes – Test Sequence

 description field R2016a

 tab complete & syntax highlighting R2016a

 port reordering R2016a

 support messages R2016a

 “verify” statements R2016a

 proof objective support for verify statements R2017a


11
Test Manager

12
Simulation Testing

 Requirement Based (Simulation) Testing


– Does my design comply with my requirements?

 Equivalence Testing
– Do these models match? Does generated code match this model?

 Regression (Baseline) Testing


– Have I broken anything with the change I’ve just made?

13
Create a baseline test

14
15
Create a test
for multiple parameter values

and verify response against a custom criteria

16
17
Test Iterations

 Define by table or script

 Combine with Parallel Computing Toolbox &/or fast restart as appropriate

 Run via UI or programmatically

 Easy to re-run selected iterations

18
Reporting

19
20
Release Notes – Test Manager

 Parallel Computing Toolbox integration R2016a

 Simulink Real-Time integration R2016a

 Custom test criteria R2016b

 MATLAB Unit Test integration R2016b

 Simulink Design Verifier integration R2017a

 Time Tolerance R2017a

21
Extend requirements-based tests
to achieve full coverage

(Simulink Test + Simulink Design Verifier)

22
23
A file is modified;

What test(s) do I need to run?

(Simulink Test + Simulink Projects)

24
25
Simulink Test... makes testing easier...

 Flexible
– Ease authoring different types of test
– Desktop or real-time

 Scalable
– Hierarchical
– Integration with Parallel Computing Toolbox

 Simple & Efficient


– Less time writing infrastructure code
– Integration with other V & V tools
– Automated reporting

26
27

You might also like