71
Executable Models Model Verification & Validation Fazilat Hojaji June 2019 Model-Driven Software Engineering Research Group Faculty of Computer Engineering Department of Software Engineering University of Isfahan mdse.ui.ac.ir Workshop on Model-Based Design, Test, and Verification of Software

Executable Models Model Verification & Validation

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Executable Models Model Verification & Validation

/711

Executable Models

Model Verification & Validation

Fazilat Hojaji

June 2019

Model-Driven Software Engineering Research Group

Faculty of Computer Engineering

Department of Software Engineering

University of Isfahan

mdse.ui.ac.ir

Workshop on Model-Based Design, Test, and Verification of Software

Page 2: Executable Models Model Verification & Validation

/712

Overview

1. Executable Model: What & Why?

2. Executable Modeling Languages

3. Example: PetriNet

4. Model Validation & Verification (V&V)

5. V&V Tools

6. Demos

Workshop on Model-Based Design, Test, and Verification of Software

Page 3: Executable Models Model Verification & Validation

/713

Software Development Lifecycle

Workshop on Model-Based Design, Test, and Verification of Software

Page 4: Executable Models Model Verification & Validation

/714

Software Development Lifecycle

Workshop on Model-Based Design, Test, and Verification of Software

Page 5: Executable Models Model Verification & Validation

/715

What is Executable Model?

Workshop on Model-Based Design, Test, and Verification of Software

Page 6: Executable Models Model Verification & Validation

/716

Traditional Modeling is Extra WorkHow it usually works without executable models

But…

• It is hard to validate the correctness of the models before development.

• The developers may not follow the models, without providing feedback.

• It is hard to keep the models and development artifacts in sync during

development (and maintenance).

Workshop on Model-Based Design, Test, and Verification of Software

Page 7: Executable Models Model Verification & Validation

/717

Executable Modeling Just Works

Using a standards conforming UML

modeling tool

Using a standards conforming UML

execution tool

The models are the source codeWorkshop on Model-Based Design, Test, and Verification of Software

Page 8: Executable Models Model Verification & Validation

/718

System engineers create the models

System engineers analyze, simulate and validate the system design, and allocate requirements to components.

Using a standard conforming SysML

modeling tool

Models can include both hardware and

software components.

Execution artifacts could include: System

Behavior, Statistics

Agile Development…. with executable models

Executable Modeling Just WorksUsing a standard conforming SysML

modeling tool

Workshop on Model-Based Design, Test, and Verification of Software

Page 9: Executable Models Model Verification & Validation

/719

Executable Model Ecosystem

Workshop on Model-Based Design, Test, and Verification of Software

Page 10: Executable Models Model Verification & Validation

/7110

What to Model?

Aspects to be modeled:

Static (Structural) Modeling

Dynamic (Behavioral) Modeling

Actions (Behavior in detail)

Concept Called Modeled As Expressed As

The world is full of

things

data Classes, Attributes,

Associations, Constraints

UML class diagram

Things have lifecycles control States, Events, Transitions

Procedures

UML state chart

diagram

Things do as each

stage

algorithm actions Action language

Concepts in UML executable models

Workshop on Model-Based Design, Test, and Verification of Software

Page 11: Executable Models Model Verification & Validation

/7111

UML Executable Model

Workshop on Model-Based Design, Test, and Verification of Software

Page 12: Executable Models Model Verification & Validation

/7112

UML Executable Model

Workshop on Model-Based Design, Test, and Verification of Software

Page 13: Executable Models Model Verification & Validation

/7113

UML Executable Model

Workshop on Model-Based Design, Test, and Verification of Software

Page 14: Executable Models Model Verification & Validation

/7114

UML Executable Model

Workshop on Model-Based Design, Test, and Verification of Software

Page 15: Executable Models Model Verification & Validation

/7115

UML Executable Model

Workshop on Model-Based Design, Test, and Verification of Software

Page 16: Executable Models Model Verification & Validation

/7116

UML Executable Model

Workshop on Model-Based Design, Test, and Verification of Software

Page 17: Executable Models Model Verification & Validation

/7117

UML Executable Model

Workshop on Model-Based Design, Test, and Verification of Software

Page 18: Executable Models Model Verification & Validation

/7118

Modeling Languages

UML executable models may be specified using

several modeling languages

Workshop on Model-Based Design, Test, and Verification of Software

Page 19: Executable Models Model Verification & Validation

/7119

Executable Modeling Languages

Petri Nets

Finite State Automata

Examples

UML Activity Diagrams

UML State Machines

Executable modeling are used to define and execute models.

Workshop on Model-Based Design, Test, and Verification of Software

Page 20: Executable Models Model Verification & Validation

/7120

Components of a modeling language

Syntax: Concepts provided for defining models

Formalism: Metamodeling languagesOMG MOF standard

EMF Ecore

Semantics: Meaning of the provided concepts

Modeling Language

Syntax Semantics

defines

meaning

Executable Modeling Languages: Components

Workshop on Model-Based Design, Test, and Verification of Software

Page 21: Executable Models Model Verification & Validation

/7121

Executable Modeling Languages:Design & Implementation

Workshop on Model-Based Design, Test, and Verification of Software

Page 22: Executable Models Model Verification & Validation

/7122

Executable Modeling Languages: Concrete Syntax

Example: Petri net

t1p1 p2

p3

p4t2

Place

Transition

Input place of

t1

Output place of

t1

Workshop on Model-Based Design, Test, and Verification of Software

Page 23: Executable Models Model Verification & Validation

/7123

Net

Place

name : String

Transition

name : String

input *

output *

transitions* places*

InitialTokens: Int

Executable Modeling Languages: Abstract Syntax

Workshop on Model-Based Design, Test, and Verification of Software

Page 24: Executable Models Model Verification & Validation

/7124

Executable Modeling Languages: Semantics

Workshop on Model-Based Design, Test, and Verification of Software

Page 25: Executable Models Model Verification & Validation

/7125

Operational SemanticsDefines an interpreter for a modeling language

Components of operational semantics

Runtime concepts: Define the state of an executable model during execution Formalism: Metamodeling languages

Steps of computation: Define the transitions from one state of an executable model to the next state

Operational Semantics

Runtime

Concepts

Steps of

Computation

Workshop on Model-Based Design, Test, and Verification of Software

Page 26: Executable Models Model Verification & Validation

/7126

Operational Semantics: Runtime Concepts

Example: Petri nets

Syntax Metamodel

Net

Place

name : String

Transition

name : String

input *

output *

transitions* places*

InitialTokens: Int

number of tokens of Place objects

changes during execution

Workshop on Model-Based Design, Test, and Verification of Software

Page 27: Executable Models Model Verification & Validation

/7127

t1p1 p2

p3

p4t2

Initial

marking

Enabled

transition

Example: Petri nets Execution

Workshop on Model-Based Design, Test, and Verification of Software

Page 28: Executable Models Model Verification & Validation

/7128

t1p1 p2

p3

p4t2

Example: Petri nets Execution

Workshop on Model-Based Design, Test, and Verification of Software

New

marking

Enabled

transition

Page 29: Executable Models Model Verification & Validation

/7129

t1p1 p2

p3

p4t2

Example: Petri nets Execution

Workshop on Model-Based Design, Test, and Verification of Software

Final

marking

Page 30: Executable Models Model Verification & Validation

/7130

Executable Models

Workshop on Model-Based Design, Test, and Verification of Software

Page 31: Executable Models Model Verification & Validation

/7131

This is not a new idea…

Workshop on Model-Based Design, Test, and Verification of Software

Page 32: Executable Models Model Verification & Validation

/7132

But it wasn’t standardized before…

Workshop on Model-Based Design, Test, and Verification of Software

Page 33: Executable Models Model Verification & Validation

/7133

Foundational UML (fuml)is an OMG standard

is an executable sub-language of UML and can be used for defining operational semantics

Uses operational approach

Specification of behavioral semantics of foundational UML subset

Class modeling: class, association, data type, etc.

Activity modeling: activities, parameters, nodes, flows, etc.

Action language: communication, object, structural feature, link actions

Virtual machine implemented with Java for executing models

Workshop on Model-Based Design, Test, and Verification of Software

Page 34: Executable Models Model Verification & Validation

/7134

Model Execution: Looking ahead…

Model

Edition & Consistency

Model

Composition

Model/System

Integration

Allocation & Deployment

Model

Model Execution &

Reconfiguration

Design-Space

Exploration

Data analysis, Model Discovery,

Execution trace analysis

Model

Validation & Verification

(Models at Design-time) (Models at Run-time)

Workshop on Model-Based Design, Test, and Verification of Software

Page 35: Executable Models Model Verification & Validation

/7135

Summary

Executable models provide abstractions and enable early analyses of the behavior of a system

Executable modeling languages need to have well defined semantics

Operational semantics define runtime concepts (state information) and steps of computation (state transitions) for interpreting models

Foundational UML (fUML) is an executable sub-language of UML and can be used for defining operational semantics

Workshop on Model-Based Design, Test, and Verification of Software

Page 36: Executable Models Model Verification & Validation

/7136

Dynamic ModelValidation & Verification

Workshop on Model-Based Design, Test, and Verification of Software

Page 37: Executable Models Model Verification & Validation

/7137

Software Development Lifecycle

Workshop on Model-Based Design, Test, and Verification of Software

Page 38: Executable Models Model Verification & Validation

/7138

Software Development Lifecycle

Workshop on Model-Based Design, Test, and Verification of Software

Page 39: Executable Models Model Verification & Validation

/7139

Dynamic Verification & Validation

Debug Test

Model checking

Dynamic analysis

Runtime verification

Tracing

How can the quality of

executable models be improved?

Dynamic Verification and Validation (V&V) techniques are used to ensure the correctness of the modeled behavior

Workshop on Model-Based Design, Test, and Verification of Software

Page 40: Executable Models Model Verification & Validation

/7140

Dynamic V&V: An example

Dynamic analysis uses execution traces to analyze the properties of a running system and to represent the system's actual behavior.

Execution traces are generated during the execution of a model, and provide information to help reason about the model's execution behavior.

Analysis Design Implementation Maintenance.....

Execution trace

defects\feedbacksverification

Page 41: Executable Models Model Verification & Validation

/7141

Model Testing Validate whether a system meets functional requirements

Workshop on Model-Based Design, Test, and Verification of Software

• Model-based testing: Testing a system’s implementation

based on models

• Testing models: Test a system’s design defined by an

executable model

Page 42: Executable Models Model Verification & Validation

/7142

Model Debugging

Locate defects in a system, e.g., model animation

Model-based debugging: debugging a running application with the help of a model

Debugging models : model modification at runtime, back stepping, step-wise execution, ...

Workshop on Model-Based Design, Test, and Verification of Software

Page 43: Executable Models Model Verification & Validation

/7143

Stepwise Debugging (interactive debugging)

find the cause of a defect by manually observing and

controlling execution

Workshop on Model-Based Design, Test, and Verification of Software

Page 44: Executable Models Model Verification & Validation

/7144

Omniscient Debugging

Stepwise debuggers only go forward

Omniscient debuggers go forward and backward

Omniscient debuggers rely on an execution trace storing previous steps

Workshop on Model-Based Design, Test, and Verification of Software

Page 45: Executable Models Model Verification & Validation

/7145

Model Debugging & Model Animation

Workshop on Model-Based Design, Test, and Verification of Software

Page 46: Executable Models Model Verification & Validation

/7146

Model Debugging & Model Animation

Workshop on Model-Based Design, Test, and Verification of Software

Page 47: Executable Models Model Verification & Validation

/7147

Model Debugging & Model Animation

Workshop on Model-Based Design, Test, and Verification of Software

Page 48: Executable Models Model Verification & Validation

/7148

Semantic Model Differencing

Models are subject to change Change management for models is required

Model differencing

Goal: Identify differences among models

Applications: Merging, versioning, conflict detection, incremental testing, etc.

Workshop on Model-Based Design, Test, and Verification of Software

Page 49: Executable Models Model Verification & Validation

/7149

Semantic Model Differencing

C

M1

M2

Model

Execution

l lM1 M2

T

T

M1

M2

Semantic

Matching

Match

Rules

Sem

CM1,M2

sem

CM1,M2

syn

M1

M2

Syntactic

Matching

Match

Rules

Syn

M1,M2

syn

T

T

M1

M2

Syntactic Differencing

Epsilon Comparison

Language (ECL)

Semantic Model Differencing

Workshop on Model-Based Design, Test, and Verification of Software

Page 50: Executable Models Model Verification & Validation

/7150

Semantic Model Differencing

C

M1

M2

Model

Execution

l lM1 M2

T

T

M1

M2

Semantic

Matching

Match

Rules

Sem

CM1,M2

sem

CM1,M2

syn

M1

M2

Syntactic

Matching

Match

Rules

Syn

M1,M2

syn

T

T

M1

M2

Generic

Execution

Trace

Model Execution

Semantic Model Differencing

Workshop on Model-Based Design, Test, and Verification of Software

Page 51: Executable Models Model Verification & Validation

/7151

Semantic Model Differencing

C

M1

M2

Model

Execution

l lM1 M2

T

T

M1

M2

Semantic

Matching

Match

Rules

Sem

CM1,M2

sem

CM1,M2

syn

M1

M2

Syntactic

Matching

Match

Rules

Syn

M1,M2

syn

T

T

M1

M2

Epsilon Comparison

Language (ECL)

Semantic Differencing

Semantic Model Differencing

Workshop on Model-Based Design, Test, and Verification of Software

Page 52: Executable Models Model Verification & Validation

/7152

Dynamic Analysis Analyze properties of a running program (model), e.g.,

Trace exploration for executable models

Trace visualization based on models

Non-functional property analysis: Analyze emergent properties of a system, e.g.,

Performance analysis

Workshop on Model-Based Design, Test, and Verification of Software

Page 53: Executable Models Model Verification & Validation

/7153

Tools for Model Execution,

Verification &Validation

Workshop on Model-Based Design, Test, and Verification of Software

Page 54: Executable Models Model Verification & Validation

/7154

Main Current Initiatives

MatlabSimulink, cf.

https://www.mathworks.com/products/simulink.html

LabView, cf. www.ni.com/labview

• xtUML https://xtuml.org/xtuml-days-2018copenhagen

• Blog post series by Leon Starr on modeling-languages.org: https://modeling-languages.com/author/leon-starr

• BridgePoint, cf. https://xtuml.org

UML-RT • Papyrus-RT: https://www.eclipse.org/papyrus-rts

Workshop on Model-Based Design, Test, and Verification of Software

Page 55: Executable Models Model Verification & Validation

/7155

The Gemoc Studio

Designate and Integrate

your Executable DSL

Edit simulate and Animate

your heterogeneous models

Workshop on Model-Based Design, Test, and Verification of Software

Page 56: Executable Models Model Verification & Validation

/7156

Metamodeling

Languages

Executable

Modeling

Languages

Executable

Models

The Gemoc Studio

Workshop on Model-Based Design, Test, and Verification of Software

Page 57: Executable Models Model Verification & Validation

/7157

The GEMOC Community

Workshop on Model-Based Design, Test, and Verification of Software

Page 58: Executable Models Model Verification & Validation

/7158

Conclusion

While modeling techniques are widely adopted in various guises (incl. behavioral modeling), model execution in still under used

Rethink our model execution tools to support

Immediate feedback (from the runtime state)

Direct manipulation (of the runtime state)

Reasoning over the time (on the runtime state)

Live modeling and time traveling should be at the core of model execution

Workshop on Model-Based Design, Test, and Verification of Software

Page 59: Executable Models Model Verification & Validation

/7159

Tools Introduction & Demos

Workshop on Model-Based Design, Test, and Verification of Software

Page 60: Executable Models Model Verification & Validation

/7160

UMPLEis a technology for model-oriented programming. It merges the concepts of programming and modeling by

adding modeling abstractions directly into programming languages

https://cruise.eecs.uottawa.ca/umple/

https://cruise.eecs.uottawa.ca/umpleonline/

Page 61: Executable Models Model Verification & Validation

/7161

Umple Online

Page 62: Executable Models Model Verification & Validation

/7162

Practice

Page 63: Executable Models Model Verification & Validation

/7163

Papyrus Industry Consortium

Workshop on Model-Based Design, Test, and Verification of Software

Page 64: Executable Models Model Verification & Validation

/7164

MOKA: Model Execution

is a Papyrus module for execution of UML models, which natively includes an execution engine complying with OMG standards

Workshop on Model-Based Design, Test, and Verification of Software

Page 65: Executable Models Model Verification & Validation

/7165

Fuml Example: A Counter

Running the model using the

MOKA engine see 2min video

Moka is a Papyrus module for

execution of UML modelshttp://wiki.eclipse.org/Papyrus/UserGuide/Mod

elExecution#Moka_Overview

Workshop on Model-Based Design, Test, and Verification of Software

Page 66: Executable Models Model Verification & Validation

/7166Workshop on Model-Based Design, Test, and Verification of Software

Page 67: Executable Models Model Verification & Validation

/7167

The Cameo Simulation Toolkit provides the firstin the industry extendable model executionframework based on OMG fUML and W3CSCXML standards. It extends UPDM plugin tovalidate system behavior by executing,animating, and debugging SysML Parametricmodels in the context of realistic mock-ups ofthe intended user interface.

Cameo Simulation Toolkit

Workshop on Model-Based Design, Test, and Verification of Software

https://www.nomagic.com/product-addons/magicdraw-addons/cameo-simulation-toolkit

Page 68: Executable Models Model Verification & Validation

/7168

Activity execution (OMG™ fUML standard)

State machine execution (W3C SCXML standard)

SysML parametric execution (OMG SysML standard)

Multiple action languages support (JSR223 standard)

Exporting UML state machine to SCXML file format

Full featured model debugger

Execution animation

Quick UI prototyping

Pluggable engines and evaluators

Model-driven test cases and scenarios

Cameo Simulation Toolkit: Features

Workshop on Model-Based Design, Test, and Verification of SoftwareWorkshop on Model-Based Design, Test, and Verification of Software

Page 69: Executable Models Model Verification & Validation

/7169

Feature

Presentation

Page 70: Executable Models Model Verification & Validation

/7170

References[1] J. Whittle, J. Hutchinson, and M. Rouncefield, “The State of Practice in ModelDriven Engineering,” IEEE Software, vol. 31, no. 3, 2014, pp. 79–85.

[2] T. Mayerhofer, Model Execution, presented in Business Informatics Group, 2014.

[3] Stephen J. Mellor and Marc J. Balcer, “Executable UML: A Foundation for Model-Driven Architecture,” Addison Wesley, 2002.

[4] Engineering ModelingLanguages: TurningDomain KnowledgeintoTools, by Benoit Combemale, Robert B. France, Jean-Marc Jézéquel, Bernhard Rumpe, Jim R.H. Steel, and Didier Vojtisek. Chapman and Hall/CRC, pp.398, 2016.

[5] Kermeta (http://www.kermeta.org/)

[6] Combemale, B., Crégut, X., Giacometti, J.-P., Michel, P., & Pantel, M. (2008). Introducing simulation and model animation in the mde topcasedtoolkit. Paper presented at the 4th European Congress Embedded Real Time Software (ERTS).

Workshop on Model-Based Design, Test, and Verification of Software

Page 71: Executable Models Model Verification & Validation

/7171

THANK YOU!

ANY QUESTIONS?

Workshop on Model-Based Design, Test, and Verification of Software