Testing Simulink Models

Similar documents
Testing Framework with Simulink Test

What s New In Simulink: Fraser Macmillen

What s New in Simulink in R2015b and R2016a

Simulation-based Test Management and Automation Sang-Ho Yoon Senior Application Engineer

Guidelines for deployment of MathWorks R2010a toolset within a DO-178B-compliant process

Automated Requirements-Based Testing

Verification and Validation of Models for Embedded Software Development Prashant Hegde MathWorks India Pvt. Ltd.

What s New with the MATLAB and Simulink Product Families. Marta Wilczkowiak & Coorous Mohtadi Application Engineering Group

Testing, Validating, and Verifying with Model-Based Design Phil Rottier

Simulink 를이용한 효율적인레거시코드 검증방안

Model-Based Design for High Integrity Software Development Mike Anthony Senior Application Engineer The MathWorks, Inc.

Verification, Validation and Test in Model Based Design Manohar Reddy

XIV. The Requirements Specification Document (RSD)

Standardkonforme Absicherung mit Model-Based Design

Using Model-Based Design in conformance with safety standards

What s New in Simulink Release R2016a and R2016b

2015 The MathWorks, Inc. 1

Developing AUTOSAR Compliant Embedded Software Senior Application Engineer Sang-Ho Yoon

In this Lecture you will Learn: Testing in Software Development Process. What is Software Testing. Static Testing vs.

Standards for Writing Requirements and Specifications. Drs. Schesser & Simone BME 496 Capstone II

Team-Based Collaboration in Simulink

Verification and Validation Introducing Simulink Design Verifier

Simulink 모델과 C/C++ 코드에대한매스웍스의정형검증툴소개 The MathWorks, Inc. 1

Requirements. Chapter Learning objectives of this chapter. 2.2 Definition and syntax

Model-Based Design for Safety Critical Automotive Applications

Simulink Verification and Validation

What s New in MATLAB and Simulink The MathWorks, Inc. 1

Background Project Purpose & Goals. SW Reliability Statistical Testing Model Based Specification and Testing

Verification, Validation, and Test with Model-Based Design

Making the Most of your MATLAB Models to Improve Verification

What s New in MATLAB and Simulink

Guido Sandmann MathWorks GmbH. Michael Seibt Mentor Graphics GmbH ABSTRACT INTRODUCTION - WORKFLOW OVERVIEW

DRYING CONTROL LOGIC DEVELOPMENT USING MODEL BASED DESIGN

What's new in MATLAB and Simulink for Model-Based Design

What s New in MATLAB and Simulink Prashant Rao Technical Manager MathWorks India

Software Development with Real- Time Workshop Embedded Coder Nigel Holliday Thales Missile Electronics. Missile Electronics

QA Best Practices: A training that cultivates skills for delivering quality systems

Introducing Simulink R2012b for Signal Processing & Communications Graham Reith Senior Team Leader, UK Application Engineering

Simulink to Embedded Hardware Paul Peeling MathWorks

What s New in MATLAB and Simulink Young Joon Lee Principal Application Engineer

10. Software Testing Fundamental Concepts

Applications of Program analysis in Model-Based Design

From Design to Production

By Jason Ghidella, PhD, and Pieter J. Mosterman, PhD. Left Elevator. actuator. hydraulic system 1 left outer. left inner

Automating Best Practices to Improve Design Quality

What s New in MATLAB and Simulink

Examination Questions Time allowed: 1 hour 15 minutes

ConfigurationDesk/RTI. Compatibility with Toolboxes and Blocksets Provided by MathWorks

Utilisation des Méthodes Formelles Sur le code et sur les modèles

ConfigurationDesk/RTI. Compatibility with Toolboxes and Blocksets Provided by MathWorks

Implementing MATLAB Algorithms in FPGAs and ASICs By Alexander Schreiber Senior Application Engineer MathWorks

FOUR INDEPENDENT TOOLS TO MANAGE COMPLEXITY INHERENT TO DEVELOPING STATE OF THE ART SYSTEMS. DEVELOPER SPECIFIER TESTER

Master Class: Diseño de Sistemas Mecatrónicos

Model-Based Design for Safety-Critical and Mission-Critical Applications Bill Potter Technical Marketing April 17, 2008

Software Specification 2IX20

Checklist for Requirements Specification Reviews

Integrated Workflow to Implement Embedded Software and FPGA Designs on the Xilinx Zynq Platform Puneet Kumar Senior Team Lead - SPC

The Avionics System Test Bench, Functional Engineering Simulator: New Developments in Support of Mission and System Verification

Entwicklung mechatronischer Systeme in der Luft- und Raumfahrt

Oracle Managed Cloud Services for Software as a Service - Service Descriptions. February 2018

Guidance for Requirements for qualified trust service providers: trustworthy systems and products

Effective Team Collaboration with Simulink

Friends, Romans, countrymen use your EARS & Improve your requirements

Introducing Simulink Release 2012b for Control System Development Mark Walker MathWorks

Subject: Scheduling Region Questions and Problems of new SystemVerilog commands

Four Best Practices for Prototyping MATLAB and Simulink Algorithms on FPGAs by Stephan van Beek, Sudhir Sharma, and Sudeepa Prakash, MathWorks

How do we use Superlab conceptually.

Effective Verification Strategies for Distributed Body Control Applications based on Plant Modeling and Test Case Reuse

A Model-Based Reference Workflow for the Development of Safety-Related Software

Techno Expert Solutions An institute for specialized studies! Introduction to Advance QTP course Content

Executable UML the silver bullet or maybe not Dr. Joel Henry October 22, 2008

Chap 2. Introduction to Software Testing

AADL Graphical Editor Design

Tasktop Sync - Cheat Sheet

BCS Level 3 Certificate in Programming Syllabus QAN 603/1192/7

Agile Testing: Your Key to Better Software

Performance Testing: Respect the Difference

How to Improve FMI Compliance

SE351a: Software Project & Process Management. 11 Oct., 2005 SE351a, ECE UWO, (c) Hamada Ghenniwa

An incremental and multi-supplement compliant process for Autopilot development to make drones safer

Implementation and Verification Daniel MARTINS Application Engineer MathWorks

Reuse MATLAB Functions and Simulink Models in UVM Environments with Automatic SystemVerilog DPI Component Generation

Design and Verify Embedded Signal Processing Systems Using MATLAB and Simulink

Lessons Learned in Static Analysis Tool Evaluation. Providing World-Class Services for World-Class Competitiveness

vsignalyzer Product Information

Formal Verification for safety critical requirements From Unit-Test to HIL

What s New in MATLAB and Simulink

ConfigurationDesk/RTI. Compatibility with Toolboxes and Blocksets Provided by MathWorks

Memorandum / Note IDM UID W3BZWC. VERSION CREATED ON / VERSION / STATUS 13 Feb 2018 / 1.0 / Approved EXTERNAL REFERENCE / VERSION

MATLAB/Simulink 기반의프로그래머블 SoC 설계및검증

Simulink for AUTOSAR: Best Practices

ConfigurationDesk/RTI. Compatibility with Toolboxes and Blocksets Provided by MathWorks

Codegenerierung für Embedded Systeme leicht gemacht So geht s!

Verification and Validation of High-Integrity Systems

ConfigurationDesk/RTI. Compatibility with Toolboxes and Blocksets Provided by MathWorks

Final Presentation AUTOCOGEQ GMV, 2017 Property of GMV All rights reserved UNCLASSIFIED INFORMATION

Software Specification and Architecture 2IW80

ECE 587 Hardware/Software Co-Design Lecture 11 Verification I

Verification and Test with Model-Based Design

Transcription:

Testing Simulink Models Fraser Macmillen 2015 The MathWorks, Inc. 1

Test Infrastructure Model set-up desired parameters, variants, operating point, etc. e.g. test start up script Model stimulus desired inputs driving the model e.g. signal builder block,.xlsx, test sequence Views of behaviour signal traces, read-outs, animations, etc. e.g. scopes, simulation data inspector Verification of behaviour desired behaviour is checked e.g. verification blocks, post-simulation scripts 2

3

Common challenges: Problem: cannot do anything unless a particular script is run first Solution: use project startup, data dictionaries, models always ready to go Problem: model is tied to particular means of stimulus (from file, signal builder, etc) Solution: use test harnesses + variants Problem: changes to the design and test mixed together Solution: save test infrastructure externally to your design; separate source control Problem: one person s system is another person s component Solution: model referencing, suitable interfaces Problem: performance degraded by infrastructure not needed for my test Solution: multiple harnesses / variants 4

Simulink Test 5

Why Simulink Test? Saves you time: Creating / managing test infrastructure generating & (re)-running multiple tests reporting results a common test environment everyone doing things in a consistent manner Gives you capability: new ways of authoring test scenarios easy integration with other tools (Requirements, Coverage, Test Generation, MATLAB Unit Test, Continuous Integration) 6

7

Simulink Test Overview 1. Test Harnesses 2. Test Sequence Stimulus Integration Block 3. Test Manager Synchronized, simulatable test environment Inputs and assessments based on logical, temporal conditions Author, execute, manage test cases Review, export, report Main Model Component under test Test Harness 8

Agenda Creating Test Harnesses Creating Test Cases Testing against Requirements Reporting Coverage analysis Multi-release regression testing Continuous integration 9

Test Harnesses 10

11

What if you already have a harness model... 12

13

Common questions... Do I need a separate harness for each test? 14

Test Harness Release Highlights R2017a: Test harness import Create harnesses for components with physical (Simscape) connections More control over synchronisation R2017b: Harness create/re-build callbacks Model comparison prior to synchronisation 15

Test Cases & Test Stimuli 16

Create a test case using the original signal builder 17

18

What have we done so far... Created and imported test harnesses Created a test case for running multiple simulations (iterations) with different scenarios 19

Common questions... When should I use iterations vs multiple test cases? 20

Use iterations if: Same model/harness & test type Same set-up (callbacks) Usually run together Relate to same requirements(s) Can use fast-restart Use separate test cases if: Need independent configuration control Different model/harness/test type or callbacks Relate to distinct requirements Distinct control of coverage 21

Create a test case using real-world recorded data 22

My data 23

Importing time-stamped data from Excel or text files % pre-process.xlsx file % get import options importoptions = detectimportoptions('sitewinddatarecorded.xlsx'); % set sheet importoptions.sheet = '2011_05_23'; % tell it that Time is in a date-time format importoptions = setvartype(importoptions,'time','datetime'); importoptions = setvaropts(importoptions,'time', 'DatetimeFormat', 'HH:mm:ss.SSS'); % read data in T = readtable('sitewinddatarecorded.xlsx',importoptions); % convert to timetable TT = table2timetable(t); % re-sample to 1sec intervals TTT = retime(tt,'secondly','nearest'); Time WindSpeed WindDirection 0 14.59 214.9 1 15.25 218.2 2 16.46 212.2 3 16.08 207.3 24

25

What have we done so far... Created and imported test harnesses Created a test case for multiple simulations (iterations) Created a test case importing real-world data from Excel using root import mapping 26

Testing Against Requirements (Verification) 27

Good quality textural requirements... # Property Description 1 Correct Requirement has no errors and is not an error 2 Compliant with one or more documented upper level requirements (operational, customer needs, etc) 3 Complete Each requirement covers all aspects of the requirement s intent. 4 Consistent Is not in conflict with any other requirement. Is consistent with the environment 5 Validated Ensures the requirement will lead to the right design, i.e. reflects fully, correctly and objectively system objectives, scope, operational use, etc 6 Achievable Can be implemented in a cost-effective manner that considers cost and schedule constraints 7 Unambiguous The requirement has only one possible interpretation. Questions are: Could the requirement be read different ways by different people? What are the different interpretations of the requirement? 8 Verifiable Expected performance or functionality expressed in a manner that allows verification to be objective, preferably as a result of an observable, ideally measurable, effect 9 Singular Use a unique shall in each textual requirement to express a single design Demand (unique intent). 10 Positive Negative requirements are very difficult, if not impossible, to verify. Negative requirement may be used only for safety requirements 11 Adequate Each requirement is expressed as a problem statement i.e. it defines what is needed, not a solution, except if a particular implementation is a constraint to be resolved by design and test 28

This model had requirements such as... These are ambiguous, incomplete, and not clearly verifiable 29

Hopefully a bit better is... 30

Example 1: Using verify() to test against a requirement 31

32

Further considerations... Testing at an appropriate level i.e. system sub system component Verification of more complex requirements 33

Example 2: Using custom criteria to test against a requirement 34

35

36

Test across multiple operating points? (trim conditions) 37

38

Incorporating coverage analysis 39

40

Regression & cross-release testing 41

42

Continuous Integration 43

44

Conclusions 45

Benefits of Simulink Test Ease of creation, organisation & control of test harnesses Ease of driving your models with data from various sources Ease of verify() for in-harness/model verification of requirements Ease of test case set-up for multiple inputs, parameters, operating points, etc. Ease of reporting Ease of integration: requirements, coverage, MATLAB Unit Test, continuous integration, 46

47