verification & validation of an autonomous quadcopter system · link to user story esa and...

33
1 © 2017 The MathWorks, Inc. Verification & Validation of an Autonomous Quadcopter System Jeremy Ross Senior Application Engineer November 7 th , 2017

Upload: others

Post on 04-Jun-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Verification & Validation of an Autonomous Quadcopter System · Link to User Story ESA and Airbus Linked elements of the model to system requirements. Automated documentation that

1© 2017 The MathWorks, Inc.

Verification & Validation of an Autonomous Quadcopter System

Jeremy RossSenior Application EngineerNovember 7th, 2017

Page 2: Verification & Validation of an Autonomous Quadcopter System · Link to User Story ESA and Airbus Linked elements of the model to system requirements. Automated documentation that

2

Agenda

“Why do verification & validation at all?”

Our Quadcopter Story

Implementing Requirements and Handling Changes

Verifying Requirements Through Regression Testing

“When am I finally done testing!?”

Using Static Analysis to Complement Dynamic Testing

Page 3: Verification & Validation of an Autonomous Quadcopter System · Link to User Story ESA and Airbus Linked elements of the model to system requirements. Automated documentation that

3

Why Do Verification & Validation? Failure is Not an Option!

Increasing product complexity – Manual testing takes too long and may be incomplete

Finding defects late– Increased costs for rework or significant costs of recalls

Meeting Industry or Customer’s Standards– DO-178 (Aero), ISO 26262 (Auto), IEC 62304

(Medical), MAAB, MISRA, etc.– Time and cost for safety critical projects estimated 20-

30 times more costly*

*Source: Certification Requirements for Safety-Critical Software, http://www.rtcmagazine.com/articles/view/100010

Page 4: Verification & Validation of an Autonomous Quadcopter System · Link to User Story ESA and Airbus Linked elements of the model to system requirements. Automated documentation that

4

Where MathWorks V&V Products Fit into a Design Workflow

Simulink Requirements, Coverage and Check

• Requirement Traceability • Model and Code Coverage • Standards Checking and

Metrics

Simulink Test

• Test Harnesses• Test Sequences• Test Manager

Simulink Design Verifier

• Test Generation• Design Error Detection• Requirements Proving• Model Slicer

Page 5: Verification & Validation of an Autonomous Quadcopter System · Link to User Story ESA and Airbus Linked elements of the model to system requirements. Automated documentation that

5

Trad Dev Costs

MBD Dev Costs

Total Savings $3,720,000Total Investments $592,000

ROI 528%$0

$500,000

$1,000,000

$1,500,000

Requirements Design Coding Analysis Testing

Total Savings $3,720,000Total Investments $592,000

ROI 528%

Aerospace Customer Data Shared with MathWorks

Where Customers Measure the Biggest ROI with V&V Tools

Page 6: Verification & Validation of an Autonomous Quadcopter System · Link to User Story ESA and Airbus Linked elements of the model to system requirements. Automated documentation that

6

Customer User Stories – Not Just Big Aerospace!

Bell HelicopterTraceability enabled the team to perform an impact analysis to identify areas of the Simulink model that would be affected if requirements were updated later in the project

Link to User Story

Chery Automobile Established bidirectional links between requirements and the model elements for Engine Management System software in Simulink that implemented the requirements

Link to User Story

ESA and Airbus Linked elements of the model to system requirements. Automated documentation that incorporated the comments, the linked requirements, and the simulation results for each requirement.

Link to User Story

Baker Hughes Checked compliance of Oil and Gas Drilling Equipment with MathWorks Automotive Advisory Board (MAAB) modeling standards and measure model coverage of their test cases

Link to User Story

ITK Engineering Produced model coverage reports for MATLAB unit testing scripts for IEC 62304 Compliant Dental Drill Motor

Link to User Story

Page 7: Verification & Validation of an Autonomous Quadcopter System · Link to User Story ESA and Airbus Linked elements of the model to system requirements. Automated documentation that

7

Initial Quadcopter Design Problem

Control a quadcopter to track a ball up and down

Page 8: Verification & Validation of an Autonomous Quadcopter System · Link to User Story ESA and Airbus Linked elements of the model to system requirements. Automated documentation that

8

Quadcopter Design Model

SimulinkKalman Filtering and PID Airframe Control

MATLABImage Processing and Object Detection

StateflowSupervisory Logic

Page 9: Verification & Validation of an Autonomous Quadcopter System · Link to User Story ESA and Airbus Linked elements of the model to system requirements. Automated documentation that

9

Simulation Results

Page 10: Verification & Validation of an Autonomous Quadcopter System · Link to User Story ESA and Airbus Linked elements of the model to system requirements. Automated documentation that

10

Modified Quadcopter Design Problem

Requirement Change: Control a quadcopter to track a ball up and downall around

Page 11: Verification & Validation of an Autonomous Quadcopter System · Link to User Story ESA and Airbus Linked elements of the model to system requirements. Automated documentation that

11

Simulink RequirementsWork with Requirements without Leaving Simulink! Author Requirements and Models Together

View and Link Requirements within the Model

Track Status and Quickly Manage Requirement Changes

Trace Requirements to Models and Test Cases Generated Code

Simulink

Requirements ExecutableSpecification

Model used for production code

generation

Page 12: Verification & Validation of an Autonomous Quadcopter System · Link to User Story ESA and Airbus Linked elements of the model to system requirements. Automated documentation that

12

Author or Import Requirements

Import External Docs• Word• Excel• DOORS

Author Requirements• Supports Rich Text

• Images• Tables• Bullets• ...

OR

Page 13: Verification & Validation of an Autonomous Quadcopter System · Link to User Story ESA and Airbus Linked elements of the model to system requirements. Automated documentation that

13

Requirements Perspective: Combining Design and Requirements

Requirements Browser with Implementation and Verification Status

Requirement Text on Simulink Canvas

Property Inspector to Modify Requirement and View Links

Enter and Exit Requirements Perspective

Navigate to associated links (design and test cases)

Page 14: Verification & Validation of an Autonomous Quadcopter System · Link to User Story ESA and Airbus Linked elements of the model to system requirements. Automated documentation that

14

Track Requirements’ Implementation and Verification Status

Design Model

Tests

Test results

x

Verified by

Implemented by

Page 15: Verification & Validation of an Autonomous Quadcopter System · Link to User Story ESA and Airbus Linked elements of the model to system requirements. Automated documentation that

15

Respond to ChangesIdentifying Modified Requirements Quickly

New Requirement

Updated Requirement

Control a quadcopter to track a ball up and down all around.

Page 16: Verification & Validation of an Autonomous Quadcopter System · Link to User Story ESA and Airbus Linked elements of the model to system requirements. Automated documentation that

16

Respond to ChangesIdentifying Updated Requirements

Page 17: Verification & Validation of an Autonomous Quadcopter System · Link to User Story ESA and Airbus Linked elements of the model to system requirements. Automated documentation that

17

Respond to ChangesLinking with Added Requirements

Page 18: Verification & Validation of an Autonomous Quadcopter System · Link to User Story ESA and Airbus Linked elements of the model to system requirements. Automated documentation that

18

Respond to ChangesQualifying with Regression Tests

Not Verified

Test Failed

Page 19: Verification & Validation of an Autonomous Quadcopter System · Link to User Story ESA and Airbus Linked elements of the model to system requirements. Automated documentation that

19

New Requirements New Test Cases

Page 20: Verification & Validation of an Autonomous Quadcopter System · Link to User Story ESA and Airbus Linked elements of the model to system requirements. Automated documentation that

20

Test CaseTest Case

Testing in Simulink Test

AssessmentsInputs Test Model

System-level test harness

Unit-level test harnessTest Sequence

Signal Builder

MAT file (input) MAT file (baseline)

Test Assessment

MATLAB Unit Test

and more! and more!

Excel file (input) Excel file (baseline)

Page 21: Verification & Validation of an Autonomous Quadcopter System · Link to User Story ESA and Airbus Linked elements of the model to system requirements. Automated documentation that

21

Running Tests with Simulink Test

Page 22: Verification & Validation of an Autonomous Quadcopter System · Link to User Story ESA and Airbus Linked elements of the model to system requirements. Automated documentation that

22

Regression Testing Process

Update Design

Sandbox Testing

Version Control and Continuous Integration

Page 23: Verification & Validation of an Autonomous Quadcopter System · Link to User Story ESA and Airbus Linked elements of the model to system requirements. Automated documentation that

23

Testing in a Sandbox

Sandbox testing

Identify test impact Execute tests

Analyze failures

Failure due to design bug?Fix the design

Update the test

Y N

Page 24: Verification & Validation of an Autonomous Quadcopter System · Link to User Story ESA and Airbus Linked elements of the model to system requirements. Automated documentation that

24

Page 25: Verification & Validation of an Autonomous Quadcopter System · Link to User Story ESA and Airbus Linked elements of the model to system requirements. Automated documentation that

25

Testing in a SandboxSandbox Testing

Identify test impact Execute tests

Analyze failures

Failure due to design bug?Fix the design

Update the test

Y N

Page 26: Verification & Validation of an Autonomous Quadcopter System · Link to User Story ESA and Airbus Linked elements of the model to system requirements. Automated documentation that

26

Page 27: Verification & Validation of an Autonomous Quadcopter System · Link to User Story ESA and Airbus Linked elements of the model to system requirements. Automated documentation that

27

Requirements are Fully Implemented and Verified

“But, how do I know when we’ve done enough testing?”

Page 28: Verification & Validation of an Autonomous Quadcopter System · Link to User Story ESA and Airbus Linked elements of the model to system requirements. Automated documentation that

28

Model Coverage in Dynamic Testing

Component Under Test

Coverage Analysis

• Insufficient tests?• Incomplete requirements?• Unreachable design content?

Simulink Design Verifier

Stateflow Logic

Simulink Coverage Analysis

Address Missing Coverage using Static Analysis

Page 29: Verification & Validation of an Autonomous Quadcopter System · Link to User Story ESA and Airbus Linked elements of the model to system requirements. Automated documentation that

29

Addressing Missing Coverage Workflow

MeasureCoverage

DetectDead Logic Missing

Coverage?

Add Tests for Missing

Coverage

Missing Coverage?

Fix Design

Justify

1

2

Simulink Design Verifier:1. Dead Logic Detection2. Test Generation

Design Tests

21

Page 30: Verification & Validation of an Autonomous Quadcopter System · Link to User Story ESA and Airbus Linked elements of the model to system requirements. Automated documentation that

30

Generate Tests for Missing Coverage

Add Tests for Missing Coverage

MeasureCoverage

DetectDead Logic

Justify

Design Tests

+ Add Tests for Missing Coverage

Page 31: Verification & Validation of an Autonomous Quadcopter System · Link to User Story ESA and Airbus Linked elements of the model to system requirements. Automated documentation that

31

Generate Tests for Missing Coverage

Add Tests for Missing Coverage

MeasureCoverage

DetectDead Logic

Justify

Design Tests

TestGeneration

Page 32: Verification & Validation of an Autonomous Quadcopter System · Link to User Story ESA and Airbus Linked elements of the model to system requirements. Automated documentation that

32

Final Coverage Results

Imported Generated Tests

100% Coverage with Combined Test Suite!Add Tests for Missing Coverage

MeasureCoverage

DetectDead Logic

Justify

Design Tests

Page 33: Verification & Validation of an Autonomous Quadcopter System · Link to User Story ESA and Airbus Linked elements of the model to system requirements. Automated documentation that

33

Quadcopter Verification & Validation Workflow Summary Implement requirements without leaving Simulink

– Edit requirements and models together– Track implementation and verification of requirements– Respond to changes faster

Verify requirement changes through regression testing– Find impacted tests through file dependency analysis– Update test’s pass/fail criteria (when design is correct!)– Automate tests (in parallel!) to ensure all tests still pass

Measure model coverage from test cases– Identify unreachable design content via dead logic analysis– Fix design or justify dead logic when it’s acceptable– Generate additional tests to help fill coverage gaps

MathWorks V&V Solutions Page: https://www.mathworks.com/solutions/verification-validation.html