Why We Model: Using MBD Effectively in Critical Domains



Similar documents
Integration of Formal Analysis into a Model-Based Software Development Process

Software Verification/Validation Methods and Tools... or Practical Formal Methods

Best Practices for Verification, Validation, and Test in Model- Based Design

Development of AUTOSAR Software Components within Model-Based Design

Michael W. Whalen

Towards a Framework for Generating Tests to Satisfy Complex Code Coverage in Java Pathfinder

Towards a Logical Foundation for Assurance Arguments for Plug & Play Systems

Certification of a Scade 6 compiler

Model Based Software Development for DDG 1000 Advanced Gun System

Automating Code Reviews with Simulink Code Inspector

Model-Based Development of Safety-Critical Software: Safe and Effi cient

F-22 Raptor. Agenda. 1. Motivation

Model Checking: An Introduction

Software Development Principles Applied to Graphical Model Development

Introducing Formal Methods. Software Engineering and Formal Methods

Model-Driven Software Development for Robotics: an overview

Agile Model-Based Systems Engineering (ambse)

Making model-based development a reality: The development of NEC Electronics' automotive system development environment in conjunction with MATLAB

Technical Data Sheet SCADE Suite R16. Software Prototyping and Design. Technical Data Sheet SCADE Suite R16 1

Critical Systems and Software Solutions

Introduction to Static Analysis for Assurance

Converting Models from Floating Point to Fixed Point for Production Code Generation

SCADE Suite in Space Applications

SCADE System Technical Data Sheet. System Requirements Analysis. Technical Data Sheet SCADE System

Criteria for Software Tools Evaluation in the Development of Safety-Critical Real-Time Systems 1

Integrated Model-based Software Development and Testing with CSD and MTest

Assuring the Safety, Security, and Reliability of Medical-Device Cyber- Physical Systems (MDCPS)

Ingo Stürmer, Dietrich Travkin. Automated Transformation of MATLAB Simulink and Stateflow Models

ADI Simulation Systems Help Speed Aircraft Development from Preliminary Design through Certification

Model-based Quality Assurance of Automotive Software

Software Engineering for LabVIEW Applications. Elijah Kerry LabVIEW Product Manager

Die wichtigsten Use Cases für MISRA, HIS, SQO, IEC, ISO und Co. - Warum Polyspace DIE Embedded Code-Verifikationslösung ist.

Development Process Automation Experiences in Japan

Requirements Engineering Management Findings Report

The Software Development Process

Specification and Analysis of Contracts Lecture 1 Introduction

CMSC 435: Software Engineering Course overview. Topics covered today

On the Modeling and Verification of Security-Aware and Process-Aware Information Systems

Quality Assurance of Models for Autocoding

A Methodology for Safety Critical Software Systems Planning

Lecture 9 Modeling, Simulation, and Systems Engineering

Applying 4+1 View Architecture with UML 2. White Paper

The Course.

Human-Automation Interaction Design and Evaluation Tools. Michael Feary, PhD

INF5140: Specification and Verification of Parallel Systems

Integrating Legacy Code / Models with Model Based Development Using Rhapsody

Software testing. Objectives

How To Test Automatically

Model Based System Engineering (MBSE) For Accelerating Software Development Cycle

Integrating MATLAB into your C/C++ Product Development Workflow Andy Thé Product Marketing Image Processing Applications

Why Adopt Model-Based Design for Embedded Control Software Development?

How To Set Up A Wide Area Surveillance System

AN EVALUATION OF MODEL-BASED SOFTWARE SYNTHESIS FROM SIMULINK MODELS FOR EMBEDDED VIDEO APPLICATIONS

Trends in Embedded Software Development in Europe. Dr. Dirk Muthig

Industrial case study: Zero defect secure software for the National Security Agency

Development of Tool Extensions with MOFLON

Aircraft & Defense Vehicle Simulation Lab

AJITHA RAJAN. School of Informatics Phone: (+ 44)( )

Integrating MBD and CBD Workflows for Automotive Control Software

EECS : Formal Methods for Engineering Education. Sanjit A. Seshia EECS, UC Berkeley

Real Time Developer Studio. Emmanuel Gaudin

Lecture 3 - Model-based Control Engineering

A Static Analyzer for Large Safety-Critical Software. Considered Programs and Semantics. Automatic Program Verification by Abstract Interpretation

JOINT STRIKE FIGHTER PHM VISION

InvGen: An Efficient Invariant Generator

Software Verification for Space Applications Part 2. Autonomous Systems. G. Brat USRA/RIACS

The Model Checker SPIN

A Comprehensive Safety Engineering Approach for Software Intensive Systems based on STPA

The Role of Automation Systems in Management of Change

Formal Specification and Verification of Avionics Software

Best practices for developing DO-178 compliant software using Model-Based Design

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

DIPLODOCUS: An Environment for. the Hardware/Software Partitioning of. Institut Mines-Telecom. Complex Embedded Systems

Using Model and Code Reviews in Model-based Development of ECU Software Mirko Conrad, Heiko Dörr, Ines Fey, Ingo Stürmer

Software Verification: Infinite-State Model Checking and Static Program

TECH. Requirements. Why are requirements important? The Requirements Process REQUIREMENTS ELICITATION AND ANALYSIS. Requirements vs.

IBM Rational Rhapsody

The V-model. Validation and Verification. Inspections [24.3] Testing overview [8, 15.2] - system testing. How much V&V is enough?

UML-based Test Generation and Execution

Software Engineering. Software Processes. Based on Software Engineering, 7 th Edition by Ian Sommerville

Model-Based Quality Assurance of The SMB2 Protocol Documentation

SCADE SUITE SOFTWARE VERIFICATION PLAN FOR DO-178B LEVEL A & B

Testing of safety-critical software some principles

Safety Verification of the Small Aircraft Transportation System Concept of Operations

CASSANDRA: Version: / 1. November 2001

Static Program Transformations for Efficient Software Model Checking

Software Engineering for Software-Intensive Systems: III The Development Life Cycle

Transcription:

Why We Model: Using MBD Effectively in Critical Domains Mike Whalen Program Director, UMSEC University of Minnesota 5/19/2013 Why We Model - Mike Whalen 1

Acknowledgements Rockwell Collins (Darren Cofer, Andrew Gacek, Steven Miller, Lucas Wagner) UPenn: (Insup Lee, Oleg Sokolsky) UMN (Mats P. E. Heimdahl) NASA Langley (Ricky Butler) Lockheed Martin (Walter Storm, Greg Tallant, Peter Stanfill) Note: all incorrect or controversial opinions are mine only J 5/19/2013 Why We Model - Mike Whalen 2

Outline of Presentation Introduction Why use Model-Based Development? Requirements Design Implementation: Code Generation Verification and Validation Pitfalls 5/19/2013 Why We Model - Mike Whalen 3

How we Develop Software Concept Formation Requirements Specification Design System Test Test System Integration Test Integration Implementation Unit Test Object Code Analysis 4

What is Model-Based Development? Properties Visualization Analysis Testing Prototyping Code/test generation Code Specification Model Test oracle Why We Model - Mike Whalen 5

Model-Based Development Tools Esterel Studio and SCADE Studio from EsterelTechnologies Rhapsody from I-Logix Simulink and Stateflow from Mathworks Inc. Rose Real-Time from Rational I will focus on Statecharts and Dataflow notations. 5/19/2013 Why We Model - Mike Whalen 6

How we Will Develop Software (in theory) Concept Formation Requirements PropertiesAnalysis Specification/Model System System Test Specification Test Integration Integration Test Implementation 5/19/2013 Why We Model - Mike Whalen 7

Model-Based Development Examples Company Product Tools Specified & Autocoded Benefits Claimed Airbus A340 SCADE With Code Generator Eurocopter GE & Lockheed Martin Schneider Electric US Spaceware PSA CSEE Transport Honeywell Commercial Aviation Systems EC-155/135 Autopilot FADEDC Engine Controls Nuclear Power Plant Safety Control SCADE With Code Generator 70% Fly-by-wire Controls 70% Automatic Flight Controls 50% Display Computer 40% Warning & Maint Computer 20X Reduction in Errors Reduced Time to Market 90 % of Autopilot 50% Reduction in Cycle Time ADI Beacon Not Stated Reduction in Errors 50% Reduction in Cycle Time Decreased Cost SCADE With Code Generator 200,000 SLOC Auto Generated from 1,200 Design Views 8X Reduction in Errors while Complexity Increased 4x DCX Rocket MATRIXx Not Stated 50-75% Reduction in Cost Reduced Schedule & Risk Electrical SCADE 50% SLOC Auto Generated 60% Reduction in Cycle Time Management With Code 5X Reduction in Errors System Generator Subway Signaling System Primus Epic Flight Control System SCADE With Code Generator MATLAB Simulink 80,000 C SLOC Auto Generated Improved Productivity from 20 to 300 SLOC/day 60% Automatic Flight Controls 5X Increase in Productivity No Coding Errors Received FAA Certification Slide courtesy of Steve Miller in Proving the Shalls 2006 Rockwell Collins, Inc. All rights reserved. 8

Does Model-Based Development Scale? Airbus A380 Length 239 ft 6 in Wingspan 261 ft 10 in Maximum Takeoff Weight 1,235,000 lbs Passengers Up to 840 Range 9,383 miles Systems Developed Using MBD Flight Control Auto Pilot Fight Warning Cockpit Display Fuel Management Landing Gear Braking Steering Anti-Icing Electrical Load Management Slide courtesy of Steve Miller in Proving the Shalls 2006 Rockwell Collins, Inc. All rights reserved. 9

But it is not all roses Many MBD projects fail to meet their original goals of cost, productivity These tend not to get as much publicity! Clear eyed understanding of why you model and what you expect is necessary 5/19/2013 Why We Model - Mike Whalen 10

A Personal Anecdote Part of two large projects using Model-Based Development Same company, similar quality developers One great success Significant cost reductions Improvement in quality Excellent customer satisfaction One great failure Large cost overruns Models considered less useful than code Group abandoned MBD 5/19/2013 Why We Model - Mike Whalen 11

Outline of Presentation Introduction Why use Model-Based Development? Requirements Design Implementation: Code Generation Verification and Validation Pitfalls 5/19/2013 Why We Model - Mike Whalen 12

What are your models for? Possible to use MBD for many different purposes: Requirements Design Simulation Visualization Testing Test Generation Test Oracle Formal Verification Code Generation Complete implementation Code skeleton Prototyping Communication with Customer You must understand, up front, what you expect to do with models in order to successfully adopt MBD. Major opportunity for improvement in V&V 5/19/2013 Why We Model - Mike Whalen 13

MBD Models as Requirements Are MBD models requirements? Notations in this talk are executable; good at describing how system works 5/19/2013 Why We Model - Mike Whalen 14

Lots of design detail Difficult to see full system behavior. Straightforward to generate code 5/19/2013 Why We Model - Mike Whalen 15

Outline of Presentation Introduction Why use Model-Based Development? Requirements Design Implementation: Code Generation Verification and Validation Pitfalls 5/19/2013 Why We Model - Mike Whalen 16

The Most Important Issue for Successful Adoption of MBD Do the Domain-Specific Notations provide a natural representation for your problem? Block diagrams are very natural for control problems Statecharts are very natural for description of system modes & mode transitions Both block diagrams and statecharts are very unnatural for representing complex data structures Neither notation naturally supports iteration or recursion It can be faked, but not well 5/19/2013 Why We Model - Mike Whalen 17

Just No Stateflow model of Tetris game (included in the Stateflow Demo models from the Mathworks!). Diagram is essentially a control-flow graph of a program that implements tetris. *Much* harder to read and modify than an equivalent program. Model The Mathworks, 2007 5/19/2013 Why We Model - Mike Whalen 18

Tools Matter Often notations are much more cumbersome to use than text No diff / merge capabilities Adding information requires many clicks Expressible!= Easy Anecdote: Simulink vs. SCADE at Rockwell Collins in 2006 SCADE had formal pedigree, strong analysis But tools kept crashing on our Windows boxes Simulink had better tools and better salespeople 5/19/2013 Why We Model - Mike Whalen 19

Outline of Presentation Introduction Why use Model-Based Development? Requirements Design Implementation: Code Generation Verification and Validation Pitfalls 5/19/2013 Why We Model - Mike Whalen 20

Analysis Pyramid Theorem Proving Model Checking Temporal Properties Of Finite systems. Perfect Verification Exhaustive Testing (Infinite Effort) MCDC Testing Data Flow Analysis Pessimistic Inaccuracy Simplistic Program Analysis Precise Analysis of Simple Syntactic Properties Simplified Properties Typical Testing Optimistic Inaccuracy Pyramid 5/19/2013 Adopted from Why Dr. We Michal Model Young - Mike Whalen 21

What We Need Theorem Proving Model Checking Temporal Properties Of Finite Systems Perfect Verification Exhaustive Testing (Infinite Effort) MCDC Testing Access to Many Tools and Techniques Data Flow Analysis Pessimistic Inaccuracy Simplistic Program Analysis Precise Analysis of Simple Syntactic Properties Simplified Properties Typical Testing Optimistic Inaccuracy 5/19/2013 Why We Model - Mike Whalen 22

MBD Is a V&V-Enabling Technology Strong simulation and analysis capabilities built into most tools Demo: Stateflow Elevator (Help: Stateflow/Demos/Large-Scale Modeling/Modeling an Elevator System) Even stronger simulation capabilities in external tools Demo: Reactis step simulation with Microwave Allows straightforward Build a little, test a little philosophy Consistent with incremental development philosophy 5/19/2013 Why We Model - Mike Whalen 23

Model-Driven Test Generation (v1) Source Code while(a<0) { a=a-1; b=b*a; } printf( %d, b); Compiler Object Code MBD Model Test Case Generator Generated Tests? Possible to generate test suites that satisfy very rigorous structural coverage metrics Coverage Metric Model results must match source code for tests to pass 5/19/2013 Why We Model - Mike Whalen 24

Model-Driven Test Generation (v2) MBD Model Object Code Code Generator + Compiler Model should match source code exactly Test Case Generator Generated Tests? Coverage Metric 5/19/2013 Why We Model - Mike Whalen 25

Model-Driven Test Generation (v2) MBD Model Object Code Code Generator + Compiler Model should match source code exactly Test Case Generator Generated Tests Oracle Coverage Metric Where does Oracle come from? What is a good oracle? 5/19/2013 Why We Model - Mike Whalen 26

Use Requirements as Oracle Slide courtesy of Steve Miller in Proving the Shalls 2006 Rockwell Collins, Inc. All rights reserved. 5/19/2013 Why We Model - Mike Whalen 27

Static Analysis and Model Checking MBD Model Analysis Tool Property True Oracle Property False: Test Case 5/19/2013 Why We Model - Mike Whalen 28

FCS 5000 Flight Control Mode Logic Mode Controller A Modeled in Simulink Translated to NuSMV 6.8 x 10 21 Reachable States Mode Controller B Example Requirement Mode A1 => Mode B1 Counterexample Found in Less than Two Minutes Found 27 Errors Slide Rockwell Collins, 2008 5/19/2013 Why We Model - Mike Whalen 29

ADGS 2100 Adaptive Display and Guidance System Modeled in Simulink Translated to NuSMV 4,295 Subsystems 16,117 Simulink Blocks Over 10 37 Reachable States Example Requirement: Drive the Maximum Number of Display Units Given the Available Graphics Processors Counterexample Found in 5 Seconds Checked 573 Properties - Found and Corrected 98 Errors in Early Design Models Slide Rockwell Collins, 2008 5/19/2013 Why We Model - Mike Whalen 30

CerTA FCS Phase I Sponsored by AFRL 1 sync<> sync 2 [trigger] [A] [DSTi] Extract Bits [03] double [MS] Wright Patterson VA Directorate Compare FM & Testing Testing team & FM team Lockheed Martin UAV input_a 3 input_b 4 input_c 5 status_a 6 status_b 7 status_c 8 dst_index DOC Text [B] [C] [status_a] [status_b] [status_c] [DSTi] DST Data Store Read [trigger] [A] [B] [C] tri p_level trip_level trip_level1 persist_lim persist_lim persistence limit [MS] Index Vector input_a input_b input_c trip_level persist_lim MS triplex_input_monitor Extract Bits [status_a] [status_b] [status_c] [prev_sel] [A] f ailreport failreport [B] [C] pc 2 persistence_cnt<pc> persistence_cnt [trigger] tc 3 totalizer_cnt<tc> [A] totalizer_cnt [B] [C] [DSTi] mon_f ailure_report status_a status_b status_c failure_report prev_sel input_a input_b input_c Failure_Isolation pc trigger input_a input_sel 4 input_b input_sel input_c DST_index triplex_input_selector 1 failure_report [prev_sel] [DSTi] failure_report dst_index Failure_Processing Adaptive Flight Control System Redundancy Management Logic Modeled in Simulink Translated to NuSMV model checker Phase I Results Testing Effort (% total) 60% Errors Found Model-Checking 12 40% 0 Slide Rockwell Collins, 2008 5/19/2013 Why We Model - Mike Whalen 31

MBD Formal Analysis Efforts 5/19/2013 Why We Model - Mike Whalen 32

Outline of Presentation Introduction Why use Model-Based Development? Requirements Design Implementation: Code Generation Verification and Validation Pitfalls 5/19/2013 Why We Model - Mike Whalen 33

Problem 1: Using Models Where They Don t Fit If MBD notation doesn t provide a better representation of your problem than code, you re wasting your time. 5/19/2013 Why We Model - Mike Whalen 34

MBD notations can be awful programming languages Model The Mathworks, 2007 5/19/2013 Why We Model - Mike Whalen 35

Remedies Perform honest assessment of where MBD notations can be used They do not do everything Recursive data structures are especially difficult to model. Use models where they are a good representation. Create a partitioning strategy between models and code for applications that contain both complex mode logic and complex data. 5/19/2013 Why We Model - Mike Whalen 36

Problem 2 Believing Testing Can be Eliminated Testing will always be a crucial (and costly) component 5/19/2013 Why We Model - Mike Whalen 37

Testing Does not go Away Concept Formation Requirements Properties Specification/Model System Extensive Testing Integration (MC/DC) Implementation 5/19/2013 Why We Model - Mike Whalen 38

It Simply Moves Concept Formation Requirements Properties Specification/Model System Extensive Testing Integration (MC/DC) Implementation 5/19/2013 Why We Model - Mike Whalen 39

Do it the Right Way Concept Formation Requirements Specification/Model Properties Analysis System System Test Specification Test Integration Integration Test Implementation Unit Test 5/19/2013 Why We Model - Mike Whalen 40

Problem 3 Believing the Model is Everything The model is never enough 5/19/2013 Why We Model - Mike Whalen 41

Modeling Frenzy Concept Formation Modeling is so much fun Requirements Specification/Model Properties Test System How do we know the model is right? Integration Implementation 5/19/2013 Why We Model - Mike Whalen 42

Remedies Recognize the Role of Software Requirements The model is not everything Development Methods for Model-Based Development Badly Needed Model-Based Software Development Process Develop Tools and Techniques for Model, Properties, and Requirements Management Develop Inspection Checklists and Style Guidelines for Models 5/19/2013 Why We Model - Mike Whalen 43

Problem 4 Trusting Verification To really mess things up, you need formal verification 5/19/2013 Why We Model - Mike Whalen 44

Property or Model: Who is Right? The Mode Annunciations shall be turned on when the Flight Director is turned on AG(Onside_FD_On -> Mode_Annunciations_On) If this side is active, the Mode Annunciations shall be turned on when the Flight Director is turned on AG( (Is_This_Side_Active & Onside_FD_On) -> Mode_Annunciations_On) If this side is active and the Mode Annunciations are off, the Mode Annunciations shall be turned on when the Flight Director is turned on AG(! Mode_Annunciations_On -> AX ((Is_This_Side_Active & Onside_FD_On) -> Mode_Annunciations_On))) 5/19/2013 Why We Model - Mike Whalen 45

Remedies Develop techniques to determine adequacy of model and property set How do we know they are any good Techniques for management of invariants How do we validate the assumptions we make Methodology and guidance badly needed Tools with training wheels Verification for Dummies All we need is one high-profile verified system to fail spectacularly to set us back a decade or more 5/19/2013 Why We Model - Mike Whalen 46

Conclusions MBD can significantly improve developer productivity, cost, schedule, and quality or it can make your life miserable The important thing is to know why you re doing it! Know the limitations of what can be modeled using the DSNs Know which capabilities you hope to use Design and quality of models depends on this V & V receives the largest benefit of the MBD approach Mature tools for test-case generation Starting to see model checking built into commercial tools: SCADE Verifier, Simulink Design Verifier There are many other things to discuss! Versioning, diff, semantics, tool costs, training, structuring, vendor lock in 5/19/2013 Why We Model - Mike Whalen 47

Questions? 5/19/2013 Why We Model - Mike Whalen 48

References M. Whalen, D. Greve, L. Wagner, S. Miller, Model Checking Information Flow. In Design and Verification of Microprocessor Systems for High-Assurance Applications. D. Hardin, Ed. Springer, 2010. M. Whalen, P. Godefroid, L. Mariani, A. Polini, N. Tillman, and W. Visser. FITE: Future Integrated Testing Environment. Workshop on the Future of Software Engineering Research 2010 (FoSER), Santa Fe, New Mexico, November 7-8, 2010. S. Miller, M. Whalen, and D. Cofer. Software Model Checking Takes Off. Communications of the ACM, Volume 53, No 2, February 2010. D. Hardin, T. D. Hiratzka, D. R. Johnson, L. Wagner, and M. Whalen. Development of Security Software: A High- Assurance Methodology. Proceedings of the 11 th International Conference of Formal Engineering Methods (ICFEM 2009), Rio de Janeiro, Brazil, December, 2009. M. Whalen, D. Cofer, S. Miller, B. Krogh, and W. Storm. Integration of Formal Analysis into a Model-Based Software Development Process. 12 th International Workshop on Industrial Critical Systems (FMICS 2007), Berlin, Germany, July, 2007. S. Miller, A. Tribble, M. Whalen, and M.P.E. Heimdahl. Proving the Shalls: Early Validation of Requirements through Formal Methods, Journal of Software Tools for Technology Transfer. Volume 8 Issue 4, August 2006. M.P.E. Heimdahl, Y. Choi, and M. Whalen. Deviation Analysis: A New Use for Model Checking, Automated Software Engineering, Volume 12, Number 3, July, 2005. M. Whalen, B. Fischer, and J. Schumann. Certifying Synthesized Code. Proceedings of Formal Methods Europe 2002, Copenhagen, Denmark, July 2002 M. Whalen, B. Fischer, and J. Schumann. AutoBayes/CC Combining Program Synthesis with Automatic Code Certification. Proceedings of Conference on Automated Deduction 18, Copenhagen, Denmark, July 2002. 5/19/2013 Why We Model - Mike Whalen 49

Research directions: Medical Cyber-Physical Systems Improving patient treatment by coordinated systems of medical devices Medical device interoperability High-confidence development Model-driven design V&V, regulatory approval Coordination framework for medical devices Build high-confidence middleware Rely on formal methods and static analysis Design a language for executable clinical scenarios Specify information flows Identify timing constraints Ensure non-interference Smart alarms and decision support Physiological closed-loop control Supported by NSF CNS-1035715 http://rtg.cis.upenn.edu/mdcps/ Participants University of Pennsylvania U. Penn Hospital System University of Minnesota CIMIT/MGH Model driven development and assurance cases High-assurance development: Modeling, code synthesis Model-level verification, code-level validation Assurance case construction reflects development process structure Applied to pacemaker, PCA pump Smart alarm systems Reduction of irrelevant alarms for CABG patients Based on aggregation of multiple vital signs and fuzzy logic On-going research: Prediction of vasospasm in neuro-icu patients 5/19/2013 Why We Model - Mike Whalen Networked Blood Glucose Control System Safety-critical, closed-loop MCPS Research issues: Identifying new risks and hazards Mitigation strategies Validation Control design Pursue model-driven approach 50