A Model-Based Design Perspective on Challenges …Developer Academic Researcher Interests span this...

38
1 © 2019 The MathWorks, Inc. A Model-Based Design Perspective on Challenges and Opportunities in Automated Software Certification Akshay Rajhans, PhD Principal Research Scientist [email protected] https://arajhans.github.io 20th Software Certification Consortium Steering Committee Meeting, Annapolis, MD, May 2019 THEME: TO WHAT EXTENT CAN AUTOMATION HELP IN CERTIFICATION?

Transcript of A Model-Based Design Perspective on Challenges …Developer Academic Researcher Interests span this...

Page 1: A Model-Based Design Perspective on Challenges …Developer Academic Researcher Interests span this tradeoff 4 Outline Introduction – Model-Based Design context for Software and

1© 2019 The MathWorks, Inc.

A Model-Based Design Perspective on Challenges and

Opportunities in Automated Software Certification

Akshay Rajhans, PhD

Principal Research Scientist

[email protected]

https://arajhans.github.io

20th Software Certification Consortium Steering Committee Meeting, Annapolis, MD, May 2019THEME: TO WHAT EXTENT CAN AUTOMATION HELP IN CERTIFICATION?

Page 2: A Model-Based Design Perspective on Challenges …Developer Academic Researcher Interests span this tradeoff 4 Outline Introduction – Model-Based Design context for Software and

2

About me

▪ ‘CPS’ Practitioner before it was called CPS

– Embedded controls for diesel engine applications

– Programmable logic controller for industrial automation

▪ CPS Research at the intersection of

– Model-based design and analysis

– Formal methods

– Software and system architecture

▪ CPS Research Scientist at MathWorks

Page 3: A Model-Based Design Perspective on Challenges …Developer Academic Researcher Interests span this tradeoff 4 Outline Introduction – Model-Based Design context for Software and

3

Perspective shaped by my personal career trajectory

Industry

Practitioner

Tool

Developer

Academic

Researcher

Interests span this tradeoff

Page 4: A Model-Based Design Perspective on Challenges …Developer Academic Researcher Interests span this tradeoff 4 Outline Introduction – Model-Based Design context for Software and

4

Outline

▪ Introduction

– Model-Based Design context for Software and System Development

▪ Two new recently-released products/features related to my research

– Architecture Design and Analysis

– Formalizing Specifications

▪ Conclusion

– Link back to the Model-Based Design context

Page 5: A Model-Based Design Perspective on Challenges …Developer Academic Researcher Interests span this tradeoff 4 Outline Introduction – Model-Based Design context for Software and

5

Model-based design ‘V’

Time

Level of detail

Requirements

Subsystems

Architecture

Implementation

Integration

Functionality

Conceptual Real

Page 6: A Model-Based Design Perspective on Challenges …Developer Academic Researcher Interests span this tradeoff 4 Outline Introduction – Model-Based Design context for Software and

6

NIST CPS Framework

https://www.nist.gov/publications/framework-cyber-physical-systems-volume-1-overview

Page 7: A Model-Based Design Perspective on Challenges …Developer Academic Researcher Interests span this tradeoff 4 Outline Introduction – Model-Based Design context for Software and

7

Model-based design ‘V’

Time

Level of detail

Requirements

Subsystems

Architecture

Implementation

Integration

Functionality

Conceptual Real

Page 8: A Model-Based Design Perspective on Challenges …Developer Academic Researcher Interests span this tradeoff 4 Outline Introduction – Model-Based Design context for Software and

8https://www.nist.gov/publications/framework-cyber-physical-systems-volume-1-overview

Page 9: A Model-Based Design Perspective on Challenges …Developer Academic Researcher Interests span this tradeoff 4 Outline Introduction – Model-Based Design context for Software and

9https://www.nist.gov/publications/framework-cyber-physical-systems-volume-1-overview

Page 10: A Model-Based Design Perspective on Challenges …Developer Academic Researcher Interests span this tradeoff 4 Outline Introduction – Model-Based Design context for Software and

10

Two new automated functionalities related to my own work

Architecture Modeling and Analysis Formalizing Specifications

http://acme.able.cs.cmu.edu/pubs/show.php?keyword=Cyberphysical%20Systems https://sites.google.com/berkeley.edu/mt-cps2019/

Page 11: A Model-Based Design Perspective on Challenges …Developer Academic Researcher Interests span this tradeoff 4 Outline Introduction – Model-Based Design context for Software and

11

Architecture Modeling and Analysis

Architecture Modeling and Analysis

http://acme.able.cs.cmu.edu/pubs/show.php?keyword=Cyberphysical%20Systems

Page 12: A Model-Based Design Perspective on Challenges …Developer Academic Researcher Interests span this tradeoff 4 Outline Introduction – Model-Based Design context for Software and

12

Model-based design ‘V’

Time

Level of detail

Requirements

Subsystems

Architecture

Implementation

Integration

Functionality

Conceptualization Realization

Need a link to

support ‘top-down’

and ‘bottom-up’

workflows

Page 13: A Model-Based Design Perspective on Challenges …Developer Academic Researcher Interests span this tradeoff 4 Outline Introduction – Model-Based Design context for Software and

13

Architecture modeling of the STARMAC quadrotor

Work done in the context of HCDDES MURI: https://ptolemy.berkeley.edu/projects/chess/hcddes/

http://www.cs.cmu.edu/~acme/AcmeStudio/

ERTS2 ‘10

Page 14: A Model-Based Design Perspective on Challenges …Developer Academic Researcher Interests span this tradeoff 4 Outline Introduction – Model-Based Design context for Software and

14

Simulink Architecture View

Inconsistency

Incompleteness

ICCPS ‘11

Page 15: A Model-Based Design Perspective on Challenges …Developer Academic Researcher Interests span this tradeoff 4 Outline Introduction – Model-Based Design context for Software and

15

Simulink Architecture → Simulink Model: Manual Step

Structure

extraction

Fix

propagation

Behavior

construction

Page 16: A Model-Based Design Perspective on Challenges …Developer Academic Researcher Interests span this tradeoff 4 Outline Introduction – Model-Based Design context for Software and

16

System Composer

Property

Inspector

Interface

Editor

Model

BrowserEditing

Canvas

https://www.mathworks.com/products/system-composer.html

Page 17: A Model-Based Design Perspective on Challenges …Developer Academic Researcher Interests span this tradeoff 4 Outline Introduction – Model-Based Design context for Software and

17

Describe abstract component interfaces and allocate to ports

Store in the model

when sketching

Save/link to data

dictionary

Import from

workspace or file

https://www.mathworks.com/products/system-composer.html

Page 18: A Model-Based Design Perspective on Challenges …Developer Academic Researcher Interests span this tradeoff 4 Outline Introduction – Model-Based Design context for Software and

18

Allocate requirements to architectures (using Simulink Requirements)

Requirements

Links

https://www.mathworks.com/videos/requirements-allocation-to-architectural-elements-1550678923400.html

Page 19: A Model-Based Design Perspective on Challenges …Developer Academic Researcher Interests span this tradeoff 4 Outline Introduction – Model-Based Design context for Software and

19

Simulink to Architecture Automation

https://www.mathworks.com/help/systemcomposer/ug/extract-architecture-from-simulink-model.html

Page 20: A Model-Based Design Perspective on Challenges …Developer Academic Researcher Interests span this tradeoff 4 Outline Introduction – Model-Based Design context for Software and

20

Architecture to Simulink Automation

Interfaces shared across

models via data dictionaries

https://www.mathworks.com/help/systemcomposer/ug/implement-components-in-simulink.html

Page 21: A Model-Based Design Perspective on Challenges …Developer Academic Researcher Interests span this tradeoff 4 Outline Introduction – Model-Based Design context for Software and

21

Two new automated functionalities related to my own work

Architecture Modeling and Analysis Formalizing Specifications

http://acme.able.cs.cmu.edu/pubs/show.php?keyword=Cyberphysical%20Systems https://sites.google.com/berkeley.edu/mt-cps2019/

Page 22: A Model-Based Design Perspective on Challenges …Developer Academic Researcher Interests span this tradeoff 4 Outline Introduction – Model-Based Design context for Software and

22

Formalizing Specifications

Formalizing Specifications

https://sites.google.com/berkeley.edu/mt-cps2019/

J.-F. Kempf, Khoo Y. P., and A. Rajhans, “Specification and Assessment of Temporal Requirements using Simulink Test”, Fourth International

Workshop on Monitoring and Testing of Cyber-Physical Systems (MT-CPS 2019), part of CPS-IoT Week 2019. [Abstract (PDF)]

Page 23: A Model-Based Design Perspective on Challenges …Developer Academic Researcher Interests span this tradeoff 4 Outline Introduction – Model-Based Design context for Software and

23

Testing today

Design/ImplementationInput Scenarios

Baseline Test SequenceMATLAB Unit Test

and more!

Assertions

Dynamic Testing

Requirements

Signal 1

Signal 2

Signal 3

Signal 4

Page 24: A Model-Based Design Perspective on Challenges …Developer Academic Researcher Interests span this tradeoff 4 Outline Introduction – Model-Based Design context for Software and

24

Toyota Air-Fuel Ratio Control Example

https://cps-vo.org/node/12108

Page 25: A Model-Based Design Perspective on Challenges …Developer Academic Researcher Interests span this tradeoff 4 Outline Introduction – Model-Based Design context for Software and

25

PLANT

CONTROLER

MONITOR

https://cps-vo.org/node/12108

Page 26: A Model-Based Design Perspective on Challenges …Developer Academic Researcher Interests span this tradeoff 4 Outline Introduction – Model-Based Design context for Software and

26https://cps-vo.org/node/12108

Page 27: A Model-Based Design Perspective on Challenges …Developer Academic Researcher Interests span this tradeoff 4 Outline Introduction – Model-Based Design context for Software and

27

How could we formalize and execute requirements directly?

System Under Test

Requirements

1. The difference between the room temperature and the set

temperature should never exceed 6 degrees.

2. If the temperature difference exceeds 4 degrees for more than

2 seconds, then the pump shall activate for at least 2 seconds Formalize and execute

J.-F. Kempf, Khoo Y. P., and A. Rajhans, “Specification and Assessment of Temporal Requirements using Simulink Test”, Fourth International

Workshop on Monitoring and Testing of Cyber-Physical Systems (MT-CPS 2019), part of CPS-IoT Week 2019. [Abstract (PDF)]

Page 28: A Model-Based Design Perspective on Challenges …Developer Academic Researcher Interests span this tradeoff 4 Outline Introduction – Model-Based Design context for Software and

28

Formal property specification for Simulink models

1. Using MATLAB scripts

– Breach

– Toyota ARCH’14 Benchmark

2. Using Simulink blocks

– Simulink Design Verifier

– Jens Oehlerking (Bosch internal tool)

3. Using a dedicated Test Manager

– Simulink Test (Logical and Temporal Assessments)

Page 29: A Model-Based Design Perspective on Challenges …Developer Academic Researcher Interests span this tradeoff 4 Outline Introduction – Model-Based Design context for Software and

29

>> sltestmgr

□[𝑡0,𝑡𝑓] 𝑥 𝜖 𝑎, 𝑏 where ۦ ∈ {≤,<}

□[𝑡0,𝑡𝑓] 𝜑

Page 30: A Model-Based Design Perspective on Challenges …Developer Academic Researcher Interests span this tradeoff 4 Outline Introduction – Model-Based Design context for Software and

30

>> sltestmgr

https://www.mathworks.com/help/sltest/ug/temporal-assessments.html

Page 31: A Model-Based Design Perspective on Challenges …Developer Academic Researcher Interests span this tradeoff 4 Outline Introduction – Model-Based Design context for Software and

31

How could we formalize and execute requirements directly?

System Under Test

Requirements

1. The difference between the room temperature and the set

temperature should never exceed 6 degrees.

2. If the temperature difference exceeds 4 degrees for more than

2 seconds, then the pump shall activate for at least 2 seconds Formalize and execute

Page 32: A Model-Based Design Perspective on Challenges …Developer Academic Researcher Interests span this tradeoff 4 Outline Introduction – Model-Based Design context for Software and

32

How could we formalize and execute requirements directly?

Formalize and execute

Requirements

System Under Test

1. The difference between the room temperature and the set

temperature should never exceed 6 degrees.

2. If the temperature difference exceeds 4 degrees for more than

2 seconds, then the pump shall activate for at least 2 seconds

Not just formal and

readable …

Page 33: A Model-Based Design Perspective on Challenges …Developer Academic Researcher Interests span this tradeoff 4 Outline Introduction – Model-Based Design context for Software and

33

How could we formalize and execute requirements directly?

… but also executable.

Run button triggers

simulation(s)

Page 34: A Model-Based Design Perspective on Challenges …Developer Academic Researcher Interests span this tradeoff 4 Outline Introduction – Model-Based Design context for Software and

34

Expected and actual

results comparison

Formal Specification

Symbols

System Under Test

Failure

explanation

Hierarchical

assessment tree

J.-F. Kempf, Khoo Y. P., and A. Rajhans, “Specification and Assessment of Temporal Requirements using Simulink Test”, Fourth International

Workshop on Monitoring and Testing of Cyber-Physical Systems (MT-CPS 2019), part of CPS-IoT Week 2019. [Abstract (PDF)]

Page 35: A Model-Based Design Perspective on Challenges …Developer Academic Researcher Interests span this tradeoff 4 Outline Introduction – Model-Based Design context for Software and

35

Conclusion

Page 36: A Model-Based Design Perspective on Challenges …Developer Academic Researcher Interests span this tradeoff 4 Outline Introduction – Model-Based Design context for Software and

36https://www.nist.gov/publications/framework-cyber-physical-systems-volume-1-overview

System

Composer

Simulink Test

Page 37: A Model-Based Design Perspective on Challenges …Developer Academic Researcher Interests span this tradeoff 4 Outline Introduction – Model-Based Design context for Software and

37

Acknowledgments

▪ Architecture Modeling and Analysis

– Ajinkya Bhave, Bruce Krogh, David Garlan, Ivan Ruchkin, Bradley Schmerl, …

(research colleagues)

– Several MathWorks colleagues

▪ Formalizing Specifications

– Jyo Deshmukh, Alexandre Donze, Gerogios Fainekos, Bruce Krogh, Dejan Nickovic,

Jens Oehlerking, Andre Platzer, … (research colleagues)

– Several MathWorks colleagues

▪ References: https://arajhans.github.io

Page 38: A Model-Based Design Perspective on Challenges …Developer Academic Researcher Interests span this tradeoff 4 Outline Introduction – Model-Based Design context for Software and

38

®