Compositional Model Based Software Development

Similar documents
Towards Compositional Domain Specific Languages

Object-Oriented Design

MontiCore A Framework for DSL-Development

Christian Doppler Laboratory

Model driven Engineering & Model driven Architecture

Types. Type checking. Why Do We Need Type Systems? Types and Operations. What is a type? Consensus

Introduction to Dependable Systems: Meta-modeling and modeldriven

Software Architecture

A conceptual framework for building good DSLs. Markus Voelter independent/itemis

Language Extension and Composition with Language Workbenches

Roles in Software Development using Domain Specific Modelling Languages

10 Thoughts 2 Demos * Discussions

with openarchitectureware

Metamodeling. Janos Sztipanovits ISIS, Vanderbilt University

Science of Computer Programming. Aspect-oriented model-driven skeleton code generation: A graph-based transformation approach

Chapter 6 Architectural Design. Lecture 1. Chapter 6 Architectural design

Semantics-Based Integration of Embedded Systems Models

Plan. Language engineering and Domain Specific Languages. Language designer defines syntax. How to define language

challenges in domain-specific modeling raphaël mannadiar august 27, 2009

Small is Beautiful Building a flexible software factory using small DSLs and Small Models

Architectural Design

RECODER - The Architecture of a Refactoring System

Language engineering and Domain Specific Languages

Advanced Topics in Software Engineering (02265) Ekkart Kindler

Start Up Benoît Langlois / Thales Global Services Eclipse (EMFT) EGF 2011 by Thales; made available under the EPL v1.

Model Driven Engineering (MDE)

Encapsulation, Operator Overloading, and Error Class Mechanisms in OCL

A little History Domain Specific Languages Examples Tools Benefits A more theoretical View Programming and Modeling The LWES Project Bonus: Best

Domain Specific Languages. Product Line Engineering

Metamodeling with Metamodels. Using. UML/MOF including OCL

Introduction to EGF. Benoît Langlois / Thales Global Services.

On the link between Architectural Description Models and Modelica Analyses Models

A Type Graph Model for Java Programs

5/9/2014. Recall the design process. Lecture 1. Establishing the overall structureof a software system. Topics covered

MDD with OMG Standards MOF, OCL, QVT & Graph Transformations

Rapid Prototyping with APICES

Role of Executable UML in MDA. Presented by Shahid Alam

INF5120 and INF9120 Modelbased System development

Modelling in Enterprise Architecture. MSc Business Information Systems

Model-Driven Engineering (MDE) Lecture 1: Metamodels and Xtext Regina Hebig, Thorsten Berger

AADL Graphical Editor Design

MontiCore: a framework for compositional development of domain specific languages

Software Engineering 2 A practical course in software engineering. Ekkart Kindler

CSE 70 Final Exam Fall 2009

Transformational Design with

Engr. M. Fahad Khan Lecturer Software Engineering Department University Of Engineering & Technology Taxila

Model Driven Development with xtuml and BridgePoint

Architecture-driven development of Climate Control Software LMS Imagine.Lab Embedded Software Designer Siemens DF PL

Semantic Analysis. Lecture 9. February 7, 2018

Design Patterns. An introduction

Semantic Modularization Techniques in Practice: A TAPL case study

What are the characteristics of Object Oriented programming language?

Anatomy of a Compiler. Overview of Semantic Analysis. The Compiler So Far. Why a Separate Semantic Analysis?

(800) Toll Free (804) Fax Introduction to Java and Enterprise Java using Eclipse IDE Duration: 5 days

Introduction to MDE and Model Transformation

Type Inference Systems. Type Judgments. Deriving a Type Judgment. Deriving a Judgment. Hypothetical Type Judgments CS412/CS413

Programming Modeling Two Worlds? Programmierung Modellierung Zwei Welten? und. and. Markus Voelter Independent/itemis

Design Patterns V Structural Design Patterns, 2

SUMMARY: MODEL DRIVEN SECURITY

Architecture. Readings and References. Software Architecture. View. References. CSE 403, Spring 2003 Software Engineering

Object-Oriented Concepts and Design Principles

Coding and Unit Testing! The Coding Phase! Coding vs. Code! Coding! Overall Coding Language Trends!

Composable Code Generation Applied to MDA

Developing Web-Based Applications Using Model Driven Architecture and Domain Specific Languages

Model-Driven Language Engineering

Architectural Design

Advanced Tool Architectures. Edited and Presented by Edward A. Lee, Co-PI UC Berkeley. Tool Projects. Chess Review May 10, 2004 Berkeley, CA

CDDiff: Semantic Differencing for Class Diagrams

Chapter 7. Modular Refactoring. 7.1 Introduction to Modular Refactoring

DEX is a generator for (parts of) business applications Input: Class Diagram, (OCL constraints) Generated result Running application.

Automatized Generating of GUIs for Domain-Specific Languages

Architecture. CSE 403, Winter 2003 Software Engineering.

A Domain Specific Transformation Language

CS152: Programming Languages. Lecture 11 STLC Extensions and Related Topics. Dan Grossman Spring 2011

Metaprogrammable Toolkit for Model-Integrated Computing

Accessibility. EEC 521: Software Engineering. Classes and Objects. Inheritance. Classes and Objects (OO Analysis)

Review Sources of Architecture. Why Domain-Specific?

Software Engineering Chap.7 - Design and Implementation

Object Oriented Programming in Java. Jaanus Pöial, PhD Tallinn, Estonia

Actor-Oriented Design: Concurrent Models as Programs

Domain-Specific Languages Language Workbenches

Software Engineering with Objects and Components Open Issues and Course Summary

Design Patterns IV Structural Design Patterns, 1

10조 이호진 이지 호

Software Design Patterns. Background 1. Background 2. Jonathan I. Maletic, Ph.D.

Functional Programming and the Web

Schedule(3/3) March 18th 13:00 Unified Process and Usecase-Driven Approach. (problem definition, use case model)

BLU AGE 2009 Edition Agile Model Transformation

Variability differences among products in PL. Variability in PLE. Language Workbenches. Language Workbenches. Product Line Engineering

Text-based Modeling. Hans Grönniger, Holger Krahn, Bernhard Rumpe, Martin Schindler and Steven Völkel

BPMN2BPEL transformation with Fujaba - a Case Study

SDC Design patterns GoF

Grade Weights. Language Design and Overview of COOL. CS143 Lecture 2. Programming Language Economics 101. Lecture Outline

DiverSE s Seminar about Software Language Engineering

Proseminar. (with Eclipse) Jun.-Prof. Dr.-Ing. Steffen Becker. Model-Driven Software Engineering. Software Engineering Group

Managing Application Configuration Data with CIM

Establishing the overall structure of a software system

Semantic Analysis. Outline. The role of semantic analysis in a compiler. Scope. Types. Where we are. The Compiler Front-End

3rd Lecture Languages for information modeling

Examples. Object Orientated Analysis and Design. Benjamin Kenwright

Transcription:

Compositional Model Based Software Development Prof. Dr. Bernhard Rumpe http://www.se-rwth.de/

Seite 2 Our Working Groups and Topics Automotive / Robotics Autonomous driving Functional architecture Variability & product lines Requirements engineering Simulation Robotics Energy Modeling of facilities and buildings Formal planning of functions Data management Automated analyses Quality assurance Monitoring Cloud Services Service platforms Migration into the cloud Evolution of services Internet of Services Internet of Things Model-based Software Development Tool development Tool-Framework MontiCore UML, SysML, Architecture DL Domain-specific languages (DSL) Generation, synthesis Testing, Analysis, verification Software architecture, evolution Agile methods

Seite 3 Generative Generative software engineering (GSE) is a Method that uses generators to efficiently generate software systems or parts of software systems from models written in UML or a DSL in order to increase quality and decrease development time. If DSLs are used, domain experts can model, understand, validate, and optimize the software system directly. UML models or DSLs are used to model certain aspects of a software system in an intuitive and concise manner. Of-the-shelf or hand-made generators process the models to generate production and test code.

Seite 4 DSL-driven Development Domain Specific Modeling Languages (DSML) as a central notation in the development process static analysis documentation DSML models rapid prototyping refactoring/ transformation automated tests code generation DSMLs serve as central notation for development of software a DSML can be programming, test, or modeling language

Seite 5 Core Elements of an Agile Modeling Method Incremental modeling Modeling tests Automatic analysis: Types, dataflow, control flow,... Code generation for system and tests from compact models Small increments Intensive simulation with customer participation for feedback Refactoring for incremental extension and optimization Common ownership of models... This approach uses elements of agile methods based on the UML notation

Seite 6 Constructive use of Models for Coding and Testing: Usage of UML-Diagrams deployment diagram class diagrams statecharts C++, Java object diagrams : : sequence diagrams OCL : consistency analyser parameterized code generator test code generator smells & errors system tests see: B. Rumpe: Agile Modellierung mit UML, Springer Verlag 2011

Seite 7 Model-based Simulation for SE Test-Infrastructure needs simulation of its context: context can be: geographical, sociological, etc. Simulation helps to understand complexity deployment diagram class diagrams statecharts DSLs C++, Java OCL object diagrams : : : sequence diagrams DSLs system tests

Seite 8 View on Model Driven Architecture (MDA) Requirements use cases and scenarios: sequence diagrams describe users viewpoint application classes define data structures T T T T T T T T state machines describe states and behavior technical class diagram adaptation, extension, technical design + behavior for technical classes code generation + integration with manually written code system complete and running system

Seite 9 Problems of Model Driven Architecture Requirements No reuse Tool chain too deep No efficient tools Tracing problems Evolution is awkward T T T T T T T T Lot of information missing, e.g., - design rationale - non-functional reqs. Agile development is not possible SE-Models are not integrated with other Engineering Models (spatial, biological,...) system

Seite 10 Model composition helps Modularity and composition are essential for: distributed development reuse from libraries Efficient tools (generation, analysis) The principle: independently developed artifacts A, B with explicit interface S composition: C = A B connects A with B at interface S and encapsulates internals The principle is well known e.g. classes in object orientation But: How does composition of models look like?

Seite 11 Model composition Dimensions of composition : Syntactic: How does A B look like? Semantical: What does A B mean? Methodical: How to develop A as well as B? Organisational: Can we develop A and B in parallel? Technical: Can I compile incrementally & individually: means: is there a binding technique for Code(A) Code(B)?

Seite 12 Model composition Model composition needs a notion of interfaces for models organization of models in artifacts (files) incremental, individual analyses and generation but not really a syntactically executed composition. Hypothesis: Compositional modularity for models is essential for the success of model based software development.

Seite 13 Example: class diagram + OCL int age Person CD context Person p inv: p.age >= 0 OCL OCL relies on CD Interface is: Person! Kind: class + Signature age! Kind: attribute + Type Checking correctness early is desirable! OCL can also be combined with : Java, Object diagrams, Statecharts,

Seite 14 Example: Statechart & Java Statechart public class Person{ Java NotLoggedIn LoggedIn public void login() { } } login / print( Hello ) Statechart uses Java Interface: login! in Statechart: Kind: Message in Java: Kind: Methodname + Signature () Languages have different interpretations of shared elements! translation is necessary!

Seite 15 Example: Statechart & Java Statechart public class Person{ Java NotLoggedIn LoggedIn public handle(loginmessage m) { } enum State { NotLoggedIn } login / print( Hello ) } Interface: login! in Statechart: Kind: message in Java: Kind: class + (adapted name) NotLoggedIn! in Statechart: Kind: state in Java: Kind: constant Transformation necessary and dependent on the context

Seite 16 Example: Statechart & Java Statechart CD NotLoggedIn LoggedIn Person String name bool isbanned [ n in { p.name p in Person && not p.isbanned} && valid(n,pw) ] login(n,pw) / print( Hello ) Statechart contains foreign languages OCL for the preconditions Java-statements for actions Import-interface from CD, Java, (while the actual source should be transparent) Combined use of models typically also means language embedding

Seite 17 Interfaces/Namespaces Hypothesis: Interfaces between models are defined using names Interfaces are imported, exported, passed-through (and local) There are variants of exports, e.g. for subclasses, global (see e.g. Java) Kinds of named elements: state, message, method, class, activity, etc. Each kind has its own form of interface e.g. state has a name e.g. method has parameters e.g. class has methods + attributes,

Seite 18 Interfaces/Namespaces Composition of heterogeneous languages: E.g. Statemachines know state ; CD s or Java doesn t Transformation between interfaces adapts kind & signature; sometimes also name E.g. mapping states to constants Variants of transformations are possible E.g. mapping states to classes (see GOF s state pattern) Special cases may be complex, e.g. Messages may map to action sequences Timing and computations models come into play,

Seite 19 Signatures (interfaces) for models A signature for a model, allows us to check compatibility against signatures and ensure the composition of derived code to be correct. This allows to delay the composition: Late Binding checked against signature (extract) model (generate) linked together code

Seite 20 Language composition vs. model composition In agile DSL development we reuse sub-languages and combine languages. Consequence: We do not only compose artifacts (files), but also sub-artifacts E.g. a Statemachine embodies Java statements & OCL conditions within the same artifact. They share e.g. local variables. Can we apply composition here as well? Can we reuse independently developed code generation within the same artifact? Hypothesis: Model composition and language composition are pretty related.

Seite 21 Language & tooling workbench MontiCore Definition of modular language fragments Interfaces between models/language fragments Name spaces, typing (~ Java, UML) kinds + signatures Assistance for analysis Assistance for transformations Pretty printing, editors (graphical + textual) Composition of languages: independent language development composition of languages and tools Language extension Language inheritance (allows replacement) Quick definition of domain specific languages (DSLs) by reusing existing languages variability in syntax, context conditions, generation, semantics

Seite 22 UML/P language tooling @ MontiCore Models Framework UMLPTool System Code Language Processing Symbol tables Check Workflow Codegen Workflow Runtime Environment Profile Generator Modeler Context Conditions Calculators Programmer (Model-level) Grammars Settings Templates Settings Language developer Tool developer Tool customizer Programmer (System-level)

Seite 23 Application: Data-Explorer (Dex) Goal: generate a complete application basically from a single class diagram using an intelligent generator GWT-based GUI, search functionality, cloud-based persistence, authentication, roles, rights, easy extensibility for functionality, GUI, etc. classdiagram CampusMgmt { abstract class Person { + String name; + String firstname; + String email; + int age; } class Teacher extends Person; CD generator association Person -> Address [*]; } //...

Seite 24 MontiCore: Selected languages MontiCore Bootstrapping UML Class diagrams Object diagrams Statecharts Activity diagrams Sequence diagrams OCL x x MontiArc x Architectural models / ADL, function nets + automata + Java + views Java Java 5.0 grammar C++ Ansi-C++ grammar MontiCore transformations Pattern matching Extended by Java FeatureDSL Feature diagram & config. AutosarDSL Components, deployment, interfaces Flight control: constraint language Building facility specification Curriculum Cloud Service Configurator Management of Services

Seite 25 Status of compositional MBSE Model- and language composition is key to successful use of MBSE Model composition ++ Language composition ++ Variability for languages & usages ++ Modular language definition ++ Modular analysis ++ Modular generation open Modular verification open Tooling + Model evolution / transformation (+) Language library (+) Transfer to industry (+/-)

Seite 26 Thanks for listening. Questions?

Seite 27 Transformations in MBSE Models / (UML/DSL) Transformation Production Sales M Production Sales M Sales Generation system allows for Evolution system tests tests Repeatable generation is necessary (no one-shots, no manual adaptation of generated code)

Seite 28 Transformations... strongly depend on the language primitive transformations (add, remove, rename) don t help Semantically relevant transformations needed Examples: Split a state in Statecharts Extend an interfaces in an architecture Move an attribute between classes Introduce new class in hierarchy University Staff University Staff Professor Assistant Secretary Scientific Staff Secretary Professor Assistant

Transformations using concrete Textual Syntax Seite 29 Given a language L we derive (: transformation language for T(L) transformation engine for T(L) T(L) understandable for modelers It uses concrete syntax! statechart S { state A; state B { state Sub1, Sub2 <<initial>>; state Sub3; } A -> B; // transition } Explaning the transformation rule: pattern to be matched and replacement parts: [[ old :- new ]] (where old is matched and then replaced by new ) $outer, $inner are matching variables (here bound to state names, but could be any nonterminal) Control language for composing transformations Negative patterns allowed Java for calculations embedded // transformation rule: // redirect transitions to initial substates state $outer { state $inner [[ << initial >> :- ]]; } // transition A -> [[ $outer :- $inner ]]; statechart S { state A; state B { state Sub1, Sub2; state Sub3; } A -> Sub1; // transition A -> Sub2; // transition}

Seite 30 Steps of Code Generation Text-to-Model- Transformation Model-to-Model- Transformations Model-to-Text Transformation e.g., optimizations or reduction to simpler form Tool Text in DSL A Parse, context check Model AST... transform Model AST pretty print, or templates Text in DSL Z conforms to conforms to DSL A... DSL Z AST = abstract syntax tree of model

Seite 31

Seite 32 screenshot of the editor-plugin for Eclipse with auto-completion