The Objects And Arrows Of Computational Design

Similar documents
Structure of Presentation. The Role of Programming in Informatics Curricula. Concepts of Informatics 2. Concepts of Informatics 1

Automated Program Behavior Analysis

MDE Adoption in Industry: Challenges and Success Criteria

Chapter 13: Program Development and Programming Languages

Overview. Stakes. Context. Model-Based Development of Safety-Critical Systems

A Little Set Theory (Never Hurt Anybody)

Feature Oriented Model Driven Development: A Case Study for Portlets

Difference Between Model-Driven and Traditional Iterative Software Development

Embedded Software Development with MPS

Meta-Model specification V2 D

Chap 1. Introduction to Software Architecture

Algorithm & Flowchart & Pseudo code. Staff Incharge: S.Sasirekha

Development of a Feature Modeling Tool using Microsoft DSL Tools.

Chapter 13: Program Development and Programming Languages

Modeling Turnpike: a Model-Driven Framework for Domain-Specific Software Development *

Progress Report Aspect Oriented Programming meets Design Patterns. Academic Programme MSc in Advanced Computer Science. Guillermo Antonio Toro Bayona

Math/Stats 425 Introduction to Probability. 1. Uncertainty and the axioms of probability

CDC UNIFIED PROCESS PRACTICES GUIDE

Tool Support for Software Variability Management and Product Derivation in Software Product Lines

Datavetenskapligt Program (kandidat) Computer Science Programme (master)

FIBER PRODUCTS AND ZARISKI SHEAVES

Business-Driven Software Engineering Lecture 3 Foundations of Processes

Software Component Technologies and Space Applications

Code Generation for High-Assurance Java Card Applets

Abstract

Automatic Generation Between UML and Code. Fande Kong and Liang Zhang Computer Science department

Formal Verification by Model Checking

Formal Languages and Automata Theory - Regular Expressions and Finite Automata -

The value of modeling

Aspect-Oriented Programming

Lecture 1. Basic Concepts of Set Theory, Functions and Relations

Contents. Introduction and System Engineering 1. Introduction 2. Software Process and Methodology 16. System Engineering 53

Analytic Modeling in Python

New Generation of Software Development

Software Development Workflow in Robotics

Round-Trip Software Engineering Using UML: From Architecture to Design and Back

Lecture 03 ( ) Quality of the Software Development Process

SEARCH The National Consortium for Justice Information and Statistics. Model-driven Development of NIEM Information Exchange Package Documentation

VAIL-Plant Asset Integrity Management System. Software Development Process

CPS122 Lecture: State and Activity Diagrams in UML

Foundations of Model-Driven Software Engineering

Automatic Impact Analysis of Software Architecture Migration on Model Driven Software Development

Challenges in bootstrapping a model-driven way of software development

Karunya University Dept. of Information Technology

The Software Development Process

Model-based Testing: Next Generation Functional Software Testing

Fourth generation techniques (4GT)

A Review of Database Schemas

Tool chain (BRIDE) delivered as BRICS software distribution

Chapter 8 The Enhanced Entity- Relationship (EER) Model

Masters in Information Technology

CIM to PIM Transformation: A criteria Based Evaluation

Comparison of Model-Driven Architecture and Software Factories in the Context of Model-Driven Development

YouTrack MPS case study

Aerospace Software Engineering

FIBRATION SEQUENCES AND PULLBACK SQUARES. Contents. 2. Connectivity and fiber sequences. 3

WORKSHOP ON TOPOLOGY AND ABSTRACT ALGEBRA FOR BIOMEDICINE

Bridge from Entity Relationship modeling to creating SQL databases, tables, & relations

Challenges and Opportunities for formal specifications in Service Oriented Architectures

Semantic Description of Distributed Business Processes

Regular Expressions and Automata using Haskell

What is a metamodel: the OMG s metamodeling infrastructure

CSC 742 Database Management Systems

Jonathan Worthington Scarborough Linux User Group

Co-Creation of Models and Metamodels for Enterprise. Architecture Projects.

Design Patterns for Complex Event Processing

Mechanics 1: Vectors

McGraw-Hill The McGraw-Hill Companies, Inc.,

MDA Transformations Applied to Web Application Development 1

Parsing Technology and its role in Legacy Modernization. A Metaware White Paper

Bridging the Generic Modeling Environment (GME) and the Eclipse Modeling Framework (EMF)

Lecture 03 ( ) The Software Development Process. Software Development Models. Where are we? Your Daily Menu.

Testing Software Product Lines Using Incremental Test Generation

A Pattern-based Approach to Business Process Modeling and Implementation in Web Services

Jairson Vitorino. PhD Thesis, CIn-UFPE February Supervisor: Prof. Jacques Robin. Ontologies Reasoning Components Agents Simulations

Manage Software Development in LabVIEW with Professional Tools

Model Driven Business Architecture. Pete Rivett CTO, Adaptive

Organization of DSLE part. Overview of DSLE. Model driven software engineering. Engineering. Tooling. Topics:

UML-based Test Generation and Execution

Testing, Debugging, and Verification

Traceability Method for Software Engineering Documentation

Ontologies for Software Engineering and Software Technology

An eclipse-based Feature Models toolchain

Applying Model Management to Classical Meta Data Problems

Analysis of the Specifics for a Business Rules Engine Based Projects

Chapter 1. Dr. Chris Irwin Davis Phone: (972) Office: ECSS CS-4337 Organization of Programming Languages

6.3 Conditional Probability and Independence

Open Source egovernment Reference Architecture Osera.modeldriven.org. Copyright 2006 Data Access Technologies, Inc. Slide 1

Fibrations and universal view updatability

The Relational Data Model: Structure

Run-time Variability Issues in Software Product Lines

The Future of Modeling in Material Handling Systems. Leon F. McGinnis Keck Virtual Factory Lab Georgia Tech. June 16, 2010

Tuesday, October 18. Configuration Management (Version Control)

TECHNIQUES FOR OPTIMIZING THE RELATIONSHIP BETWEEN DATA STORAGE SPACE AND DATA RETRIEVAL TIME FOR LARGE DATABASES

7. Classification. Business value. Structuring (repetition) Automation. Classification (after Leymann/Roller) Automation.

Acknowledgement. Software Engineering. CS 3141: Team Software Project Introduction

Service Oriented Architecture

2 nd UML 2 Semantics Symposium: Formal Semantics for UML

Abstraction in Computer Science & Software Engineering: A Pedagogical Perspective

Talend Metadata Manager. Reduce Risk and Friction in your Information Supply Chain

Transcription:

The Objects And Arrows Of Computational Design Don Batory Maider Azanza João Saraiva University of Texas at Austin, USA Univ. Basque Country, Spain Univ. Minho, Portugal

Introduction Future of software design and development is automation mechanize repetitive tasks free programmers for more creative activities Entering the age of Computational Design program design and synthesis is a computation Design: steps to take to create an artifact metaprogram Synthesis: evaluate steps to produce the artifact metaprogram execution 2

Forefront of Automated Development Model Driven Engineering (MDE) high-level models define applications transformed into lower-level models general-purpose approach Software Product Lines (SPL) domain-specific approach we know the problems, solutions of a domain we want to automate the construction of these programs Both complement each other strength of MDE is weakness of SPLs, and vice versa not disjoint, but I will present their strengths as such 3

In prior lifetime, I was a database researcher program generation was relational query optimization (RQO) query evaluation programs were relational algebra expressions designs of such programs could be optimized Took me years to recognize the significance of RQO compositional paradigm, computational design Fundamentally shaped my view of automated software development you ll see impact My Background 4

My Work SPLs with emphasis on language and tool support I needed a simple language to express program design and synthesis as a computation modern algebra fits the bill Programs are structures tools transform, manipulate, analyze OO structures are methods, classes, packages compilers transform source structures refactoring tools transform source structures meta-models of MDE define allowable structures of instances; transformations map instances for analysis or synthesis 5

So What?? Well mathematics is the science of structure and the manipulation of structure Once I recognized that transformations are fundamental to software development I was on the road to mathematical thinking basic ideas are relevant once I understood the connection 6

My Work I use mathematics as an informal design methodology and language to explain computational designs not a formalism! This is a modeling talk aimed at practitioners no special mathematical background Core ideas inspired from category theory theory of mathematical structures result of a domain analysis of geometry, topology, algebra basic concepts in CT are core ideas in MDE, SPL 7

This Talk Expose underlying principles of MDE and SPL not category theory functors, pushouts, products of categories, Series of mini-tutorials (10 minutes apiece) categories on an industrial scale 8

Part 1: Categories in MDE let s start with some unfortunate terminology

Objects An object is a domain of points (no standard term) Metamodel defines a domain of models object cone of object instances metamodel cone of metamodel instances p p 2 1 p p 4 3 m m 2 1 m m 4 3 points models 10

Examples MDE focuses on UML metamodels and their instances Ideas of objects & instances also apply to non-mde artifacts technical spaces of Bezivin, et al. Java XML ByteCodes j j 2 1 j j 4 3 j 5 x x 2 1 x x 4 x 5 3 b b 2 1 b b 4 3 11

Recursion A point can be an object Standard MOF architecture object meta-metamodel meta models o o 2 1 o o 4 3 mm mm 2 1 mm mm 4 3 p p 2 1 p 3 p p 5 4 p 6 m m 2 1 m 3 m m 5 4 m 6 points models 12

Arrow Is map or function or transformation or morphism between objects (all names are used) implementation is unspecified A S B External Diagram C Internal Diagram s 1 s 3 s 2 b b 2 1 b b 4 3 13

My Terminology (for this talk) Arrow denotes a map Transformation an MDE implementation of an arrow ATL, RubyTL, GReAT, QVT Tool is a non-mde implementation of an arrow standard tools of software engineers 14

External Diagrams MSC M2MX SC M2TX Java javac ByteCode Category a collection of objects and arrows above is a category of 4 objects, 3 non-identity arrows categories satisfy 3 simple properties 15

Properties of Categories Arrows are composable x z y Composition is associative: A (B C) = (A B) C Identities Id A F Id B F Id B = F Id A F = F 16

Support for These Abstractions MSC M2MX SC M2TX Java javac ByteCode M2B = javac MT2X M2MX Treat arrows and objects uniformly hide their implementation technologies GROVE, UniTI, etc. lack of support obscures fundamental relationships tool chains, makefiles, metaprogram remove artificial complexity, expose essential complexity 17

Notation and Modeling Issues

External Diagrams in MDE MSC M2MX SC M2TX Java javac ByteCode No standard names for such diagrams in MDE drawn differently (sans identity arrows) Toolchain diagrams (MIC) MegaModels (ATL) 19

External Diagrams in MDE MSC M2MX SC M2TX Java javac ByteCode No standard name for such diagrams in MDE Toolchain diagrams (MIC) MegaModels (ATL) 20

External Diagrams in MDE MSC M2MX SC M2TX Java javac ByteCode No standard name for such diagrams in MDE Toolchain diagrams (MIC) MegaModels (ATL) 21

Arrows with Multiple Inputs, Outputs Arrows 1 input object to 1 output object what about T: O1, O2, O3 O4, O5? occurs in model weaving Ans: create tuple of objects, which is itself an object O123 = [ O1, O2, O3 ] O45 = [ O4, O5 ] O123 T O45 O1 O2 O3 O4 O5 projection arrows 22

Internal Diagrams MSC M2MX External Diagram is a category m 5 SC M2TX s 5 Java javac ByteCode Internal Diagrams are (points + arrows) also categories j 5 b 5 degenerate or trivial category: point is a domain with a single program 23

Computational Design Design of an artifact is an expression synthesis is expression evaluation RQO paradigm m 5 M2MX b 5 = javac M2TX M2MX m 5 s 5 M2TX j 5 javac b 5 24

Recap Categories lie at the heart of MDE found at all levels in an MDE architecture categories on an industrial scale Informally, categories provide a compact set of ideas to express relationships that arise among objects in MDE language and terminology for MDE computational designs can use CT more formally (e.g., Meseguer, Ehrig, Täntzer, Diskin) Now let s look for categories in Product Lines 25

Part 2: Categories in SPLs

SPL Overview SPL is a set of similar programs Programs are defined by features increment in program functionality that customers use to distinguish one program from another Programs are related by features program P is derived from program G by adding feature F feature is a function: P = F(G) 27

4-Program Product Line class calculator { float result; void add( float x ) { result=+x; } void sub( float x ) { result=-x; } } class gui { JButton format = new JButton( format ); JButton add = new JButton( + ); JButton sub = new JButton( - ); void initgui() { ContentPane.add( format ); ContentPane.add( add ); ContentPane.add( sub ); } void initlisteners() { new methods new fields new fields extend existing methods extend existing methods } add.addactionlistener(...); sub.addactionlistener(...); format sub base = p 12 34 } void formatresultstring() {...} new methods 28

Ideas Scale... 1986 database systems 80K LOC 1989 network protocols 1993 data structures 1994 avionics 1997 extensible Java preprocessors 40K LOC 1998 radio ergonomics 2000 program verification tools 2002 fire support simulators 2003 AHEAD tool suite 250K LOC 2004 robotics controllers 2006 web portlets 29

Perspective on Product Lines SPL is a set of similar programs Java Is a miniscule subset of a domain size of domain is infinite size of SPL is finite Infinite set of SPLs in a domain device driver domain telephony domain portlet domain elevator domain 30

Perspective on Product Lines sub p 2 format 0 base p 1 p 3 format sub p 4 SPL defines relationships between its programs how are programs related? by arrows, of course! Empty program (0) may (or may not) be part of SPL Each arrow is a feature 31

Computational Design sub p 2 format p 3 = format sub base 0 base p 1 format sub p 3 p 3 = sub format base p 4 Program design is an expression RQO paradigm programs can have multiple designs evaluating both expressions yields the same program format, sub are commutative 32

A Product Line is a Category sub p 2 format 0 base p 1 p 3 format sub p 4 Degenerate or trivial category point is a domain with a single program in it Has implied identity arrows Has implied composed arrows, as required 33

Implementing SPLs

Implementing SPLs want this: know this: 0 Same function being applied to different inputs 35

Implementing SPLs store this: Just store arrows regardless of how they are implemented n optional features, 2 n possible programs compact representation of an SPL 36

Models of SPLs Implement a set of arrows Define a feature model to define legal compositions of arrows Yields a product line See paper for more details MM feature model1 model2 model3 37

Recursion SPLs can appear at any level of an MDE architecture arrow add same feature to a large domain of programs Model Driven Product Lines to be discussed shortly Superposition is standard technique metamodel level model level 38

Code Arrows in AHEAD AHEAD refines (Scala, ClassBox/J, ) sub feature adds (superimposes) new fields, members, wrappers refines class calculator { void sub( float x ) { result=-x; } } new method refines class gui { JButton sub = new JButton( - ); void initgui() { SUPER.initGui(); ContentPane.add( sub ); } void initlisteners() { SUPER.initListeners(); add.addactionlistener(...); } new field extend existing methods (much like inheritance) } 39

Code Arrows in AHEAD sub arrow is composed from 2 simpler arrows gu cl sub refines class calculator { void sub( float x ) { result=-x; } } refines class gui { JButton sub = new JButton( - ); cl gu refines class calculator { void sub( float x ) { result=-x; } } cl refines class gui { JButton sub = new JButton( - ); } void initgui() { SUPER.initGui(); ContentPane.add( sub ); } void initlisteners() { SUPER.initListeners(); add.addactionlistener(...); } sub } void initgui() { SUPER.initGui(); ContentPane.add( sub ); } void initlisteners() { SUPER.initListeners(); add.addactionlistener(...); } gu 40

Model Arrows in AHEAD Example: Product Lines of State Machines ICSR 2000: fire support simulators ICSE 2007: web portlet product line Feature arrows are implemented by model deltas additional elements and relationships are superimposed onto a base model Makes SPL designs easier to understand and analyze Don t use power of full transformation language to implement arrows orange yellow base Synthesizing customized state charts by composing features 41

Recap Categories lie at the heart of Software Product Lines SPLs appear at all levels of an MDE architecture Informally, categories provides a clean set of ideas to express relationships that arise among objects in SPL enabled me to place in perspective what MDE and SPL communities have been doing Next topic: model-driven product lines (MDPLs) 46

Part 3: Categories in Model Driven Product Lines Exposing fundamental verification and optimization relationships

Commuting Diagram Fundamental concept in category theory all paths between two objects yield same result theorems of CT d1 f1 f2 f1 d2 = d1 f2 d2 48

Diagrams in MDPLs S A B s 1 F s s 2 τ b 1 b 2 F b Want to map a product line of S models into its corresponding product line of B models Transformations of MDE map objects Operator τ to map arrow F s to arrow F b : τ(f s ) = F b 49

How Commuting Diagrams Arise MSC M2MX m 2 m 1 m 3 SC M2TX s 2 s 1 s 3 Java javac ByteCode j 2 j j1 1 j 3 b b 2 1 b 3 50

Commuting Diagrams in PinkCreek Trujillo, et al. ICSE 2007 Portlet synthesis B statechart of portlet Transform state chart into a series of lower level representations until Java and JSP code reached java code of portlet jsp code of portlet 51

Commuting Diagrams in PinkCreek Trujillo, et al. ICSE 2007 B F1 F2 Portlet synthesis Transform state chart into a series of lower level representations until Java and JSP code reached F3 F4 F5 F6 52

Operators easy to draw Warning! may (or may not) be easy to implement may (or may not) be practical to implement CT is not constructive it doesn t say how to implement arrow no more than UML class diagrams tell you how to implement a method Tells you certain relationships exist, and if you can implement arrows, you can exploit commuting diagrams 53

Examples that Exploit Commuting Diagrams 54

Writing Operators In last 2 years, we found uses for commuting diagrams and arrow operators in MDPLs: simplifying implementation (ICMT 2008) improving test generation (SIGSOFT 2007) understanding feature interactions (GPCE 2008) understanding AHEAD (GPCE 2008) improving synthesis performance (ICSE 2007) Briefly review the first two of these 55

General Technique for Implementing MDPLs

Example 1: ICMT 2008 Paper Work with G. Freeman and G. Lavender MDPL of applications written in SVG and JavaScript selectively customize application (removing, adding charts, controls) 57

Example 1: ICMT 2008 Paper Created a set of arrows and a feature model for our MDPL red arrows (defining a product line of charts) were tedious to write created DSL for charts, where arrows were easy to write, compose defined an operator τ to map 1:1 from green arrows to red arrows DSL for chart arrows lift arrows τ operator τ SPL feature model 58

τ Translation Example point-cut (AOP terminology) GREEN Arrow advice τ RED Arrow 59

Diagram Constraints G1 τ R1 G2 τ R2 τ(g1 G2) = τ(g1) τ(g2) = R1 R2 Same result if we compose green arrows and translate OR we translate Verification green arrows, and condition: compose red arrows Implementation is correct if this equality holds! Homomorphism mapping of expression in one algebra (GREEN) to a corresponding expression in another (RED) 60

Guess What? Initially our tools did not satisfy diagram constraints equalities of homomorphisms didn t hold our tools had bugs we had to fix our tools now we have greater confidence in tools because they implement explicit relationships of domain models win from engineering perspective» we have an insight into domains that we didn t have before» by imposing categorical structure on our domain, we have better understanding, better models, and better tools Lifting is not specific to our application, it is a general technique for building MDPLs 61

Test Generation for MDPLs

Example 2: ISSRE 2008 Paper Work with E. Uzuncaova and S. Khurshid (ECE@UTexas) Testing SPLs is a basic problem we can generate different programs, but how do we know that the programs are correct? Specification-based testing can be effective start with a spec (model) of program automatically derive tests Alloy is example 63

Conventional Test Generation spec solutions tests alloy testera S0 T0 A0 τ S1 alloy τ A1 testera T1 Challenge: is there a τ operator? S2 alloy A2 testera T2 τ S3 alloy A3 testera T3 64

Incremental Test Generation S0 spec alloy solutions A0 τ S1 alloy A1 incremental conventional approach τ S2 alloy A2 τ S3 alloy A3 testera T3 65

Implementing τ Spec S1 = (A B) ( A C) // 20K clauses a solution: [A,B,C] = [1, 0, 1] Spec S2 = (A B) ( A C) (D A) a solution: [A,B,C,D] = [1, 0, 1, 1] Solution for S1 bounds solution for S2 sound, complete Reason for efficiency 66

Preliminary Results In product lines that we examined (typical of Alloy research), majority of cases incremental approach is faster 30-50 faster can now solve larger problems with Alloy Although preliminary, results are encouraging See paper(s) for details 67

Recap Creating a SPL or MDE application creates industrial sized categories Putting them together reveals a foundational idea of categories commuting diagrams involves mapping both objects of a category AND arrows need operators (transformation to transformation maps) Can exploit exposed relationships as verification conditions optimization possibilities 68

Part 4: Design Optimization Frontier of Computational Design

Principles of Computational Design Design = expression Synthesis = expression evaluation Design Optimization = expression optimization find program that satisfies functional requirements and optimizes some non-functional properties (performance, energy consumption) paradigm of relational query optimization set of programs that satisfy functional requirements programs that satisfy non-functional requirements most efficient program 70

At Present I know of few examples of design optimization relational query optimization (1980s) data structure optimizations (1990s) Neema s work on synthesizing adaptive computing (2001) Püschel s work on numerical library synthesis (2006) Benavides work on configurators (2005) Main challenge: finding domains where there are different ways to implement the same functionality commuting diagrams this is where design optimization occurs If you think in terms of arrows, you have a conceptual framework and tools to explain and address design optimization in a principled, non-ad hoc way 71

Conclusions

Role of Mathematics in Design RQO helped bring database systems out of stone age Relational Model was based on set theory this was the key to understanding a modern view of databases set theory used was shallow fortunate for programmers and database users set select, union, join, intersect disappointment for mathematicians Computational Design uses category theory basic ideas useful allows us to place research results in context new insight on verification, optimization issues whether theorems from CT are applicable, I don t know 73

Educational benefit of the connection common terminology, concepts new perspectives Key To Success How often in MDE, SPL, MDPL do commuting diagrams arise? don t know; too early but if you look, you ll find them theory says they exist whether creation of operators practical decided on a per domain basis 74

Final Comments Future of software design and synthesis is in automation seeking principles that have a mathematical basis Made great strides understanding structure (UML) Need to take few more strides in understanding arrows tools, transformations used in design and synthesis Software design & synthesis seems to rest on simple ideas programs (models) are values transformations map programs to programs operators map transformations to transformations 75

Final Comments Clear that ideas are being reinvented in different contexts not accidental evidence we are working toward general paradigm modern mathematics provides a simple language to express computational designs, expose useful relationships in SPL and MDE architectures maybe others may be able to find deeper connections 76