Testing Framework With Simulink Test
Testing Framework With Simulink Test
Target algorithm
for verification
4
Building Test Harness Model using Model Reference
▪ Separated model not for code generation but only for testing
Test harness model
Production model
Signal Builder
Model Reference (Model block) Scope
5
Simulink Test
6
Why Simulink Test?
7
Simulink Test Overview
1. Test Harnesses 2. Test Stimulus Integration 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
8
Agenda
▪ Reporting
▪ Coverage analysis
9
Creating Test Harness
10
What if you already have a harness model....
11
Agenda
▪ Reporting
▪ Coverage analysis
12
Example 1: Create a test case
using the original signal builder
13
Create test cases with Signal Builder
14
What have we done so far....
15
Common questions...
16
Comparison
18
My data
19
Importing time-stamped data from Excel or text files
▪ Created a test case importing real-world data from Excel using root import
mapping
22
Agenda
▪ Reporting
▪ Coverage analysis
23
Requirement based testing
Requirements
24
Requirements Editor in Simulink Requirements
Manage and Organize Requirements
Organize with
Requirement
Sets Import from
External Sources View and
Author
25
Requirements Perspective in Simulink Requirements
26
Track Implementation and Verification
27
Example 1:
Baseline test
28
Test types in Test Manager
29
▪ Challenges
– Not easy to predict expected result
– Hard to make time-series input data
▪ Solution
– Use data captured from simulation as baseline
1. Try to run a simulation for each case.
2. Capture output data from simulation result.
3. Review captured data to confirm whether it is valid as baseline.
4. Apply reviewed data to Test Manager as baseline
30
Baseline test using captured simulation result
31
Example 2:
Using verify() to test against a requirement
32
Test Sequence Block
Simulink Test
x
Define Inputs
33
34
C Caller Block Support
Test Harness
» 14:30~150:00 Simulink를 통한 효율적인 레거시 코드 검증 방안 소개
35
Agenda
▪ Reporting
▪ Coverage analysis
36
Test Manager
Simulink Coverage
Simulink Design Verifier
37
Summary
– Ease of reporting
38
39