Towards a traceability framework for model transformations in Kermeta

Similar documents
A Formal Approach to Modeling and Model Transformations in Software Engineering

A Formal Approach to Modeling and Model Transformations in Software Engineering

Change Management within SysML Requirements Models

UML Model Refactoring

Design Patterns for Metamodel Design

St. Kitts and Nevis Heritage and Culture

RESEARCG ON THE MDA-BASED GIS INTEROPERABILITY Qi,LI *, Lingling,GUO *, Yuqi,BAI **

Table of Contents. Preface...viii. Acknowledgment... xiv. Section 1 Basics

Part 1: Fundamentals

Formal Analysis of UML/OCL Models

SDS developer guide. Develop distributed and parallel applications in Java. Nathanaël Cottin. version

Automated Checking of Integrity Constraints for a Model- and Pattern-Based Requirements Engineering Method (Technical Report)

SINCE the introduction of System Engineering in

Event Operators: Formalization, Algorithms, and Implementation Using Interval- Based Semantics

AS/NZS ISO :2015

OBEUS. (Object-Based Environment for Urban Simulation) Shareware Version. Itzhak Benenson 1,2, Slava Birfur 1, Vlad Kharbash 1

Static Program Analysis

Lecture 2. A Review: Geographic Information Systems & ArcGIS Basics

Ensuring Structural Constraints in Graph-Based Models with Type Inheritance

A BOUNDARY NOTATION FOR VISUAL MATHEMATICS Jeffrey James and William Bricken September Published in IEEE Visual Languages'92 ABSTRACT

A SysML extension for Bond Graphs support

Hoare Logic: Reasoning About Imperative Programs

RESULTS OF DEVELOPMENT AND APPLICATION GEOGRAPHIC INFORMATION STANDARDS IN VIETNAM. Dr. Tran Bach Giang Vietnam

Object Modeling Approach! Object Modeling Approach!

Research on Object-Oriented Geographical Data Model in GIS

On improving matchings in trees, via bounded-length augmentations 1

Using C-OWL for the Alignment and Merging of Medical Ontologies

California Common Core State Standards for Mathematics Standards Map Mathematics I

EDA045F: Program Analysis LECTURE 10: TYPES 1. Christoph Reichenbach

ATLAS of Biochemistry

ITI Introduction to Computing II

Raven Facing the Problem of assembling Multiple Models to Speed up the Uncertainty Quantification and Probabilistic Risk Assessment Analyses

Te s t D r i v e n D e v e l o p m e n t. C h a m i l J e e w a n t h a

Geografisk information Referensmodell. Geographic information Reference model

Seamless Model Driven Development and Tool Support for Embedded Software-Intensive Systems

Rainfall data analysis and storm prediction system

FACULTY OF SCIENCE ACADEMY OF COMPUTER SCIENCE AND SOFTWARE ENGINEERING OBJECT ORIENTED PROGRAMMING DATE 07/2014 SESSION 8:00-10:00

Principles of Program Analysis: Control Flow Analysis

A methodology on natural occurring lines segmentation and generalization

Information System Desig

Performance Modeling of Distributed Collaboration Services with Independent Inputs/Outputs

Expert Systems! Knowledge Based Systems!

Grammar formalisms Tree Adjoining Grammar: Formal Properties, Parsing. Part I. Formal Properties of TAG. Outline: Formal Properties of TAG

Towards a formal language for systemic requirements

Representing Spatiality in a Conceptual Multidimensional Model

UML. Design Principles.

ISO Daily 10 km Gridded Climate Dataset for Canada ( ) Data Product Specifications. Revision: A

On the specification and verification of model transformations

Esri UC2013. Technical Workshop.

Simultaneous equations for circuit analysis

COMPUTER SCIENCE TRIPOS

Deduction by Daniel Bonevac. Chapter 3 Truth Trees

ISO INTERNATIONAL STANDARD. Geographic information Metadata Part 2: Extensions for imagery and gridded data

software, just as word processors or databases are. GIS was originally developed and cartographic capabilities have been augmented by analysis tools.

Basic System and Subsystem Structures in the Dataflow Algebra. A. J. Cowling

A set theoretic view of the ISA hierarchy

Systems analysis. Behaviour, architecture L E C T U R E. Ing. Zuzana Bělinová, Ph.D. Lecture 2. Systems engineering. Veronika Vlčková, Zuzana Bělinová

Knowledge representation DATA INFORMATION KNOWLEDGE WISDOM. Figure Relation ship between data, information knowledge and wisdom.

Multicore Semantics and Programming

System Design: Architectures and Archetypes. Stephen J. Mellor Project Technology, Inc.

2.6 Complexity Theory for Map-Reduce. Star Joins 2.6. COMPLEXITY THEORY FOR MAP-REDUCE 51

Naive Bayes classification

Using the Prover I: Lee Pike. June 3, NASA Langley Formal Methods Group Using the Prover I:

Securing the Web of Things

An object-oriented design process. Weather system description. Layered architecture. Process stages. System context and models of use

2007 IEEE. Personal use of this material is permitted. However, permission to reprint/republish this material for advertising or promotional purposes

Geo-spatial Analysis for Prediction of River Floods

The State Explosion Problem

A Computable Language of Architecture

Finite Automata - Deterministic Finite Automata. Deterministic Finite Automaton (DFA) (or Finite State Machine)

Transactions on Information and Communications Technologies vol 18, 1998 WIT Press, ISSN

A BASE SYSTEM FOR MICRO TRAFFIC SIMULATION USING THE GEOGRAPHICAL INFORMATION DATABASE

Introduction to Kleene Algebras

OECD QSAR Toolbox v.4.0. Tutorial on how to predict Skin sensitization potential taking into account alert performance

RAPPORT DE RECHERCHE. On Querying Simple Conceptual Graphs With Negation

ECE521 Lecture 7/8. Logistic Regression

Formal Conformance Testing 2006

Performance Evaluation of the Matlab PCT for Parallel Implementations of Nonnegative Tensor Factorization

Version 1.1 GIS Syllabus

A Multi-Periodic Synchronous Data-Flow Language

EasySDM: A Spatial Data Mining Platform

PRODUCING MILLIONS OF MAPS FOR THE UNITED STATES 2010 DECENNIAL CENSUS*

G54FOP: Lecture 17 & 18 Denotational Semantics and Domain Theory III & IV

Dynamic Noninterference Analysis Using Context Sensitive Static Analyses. Gurvan Le Guernic July 14, 2007

Methodology. François Terrier, Sébastien Gérard

Situation. The XPS project. PSO publication pattern. Problem. Aims. Areas

Integrated Math 1. Course Standards & Resource Guide

Music as a Formal Language

A lower bound on the order of the largest induced linear forest in triangle-free planar graphs

ArchaeoKM: Managing Archaeological data through Archaeological Knowledge

Towards a formal description of models and workflows

Numeration and Computer Arithmetic Some Examples

ITI Introduction to Computing II

GIS for spatial decision making

A Graph Transformation-Based Semantics for Deep Metamodelling

Symbolic Data Structure for sets of k-uples of integers

11 The Max-Product Algorithm

Model transformation with Scala

ZFL, Center of Remote Sensing of Land Surfaces, University of Bonn, Germany. Geographical Institute, University of Bonn, Germany

Principles of Program Analysis: A Sampler of Approaches

Transcription:

Towards a traceability framework for model transformations in Kermeta Jean-Rémy Falleri, Marianne Huchard, and Clémentine Nebut LIRMM, CNRS and Université de Montpellier 2, 161, rue Ada, 34392 Montpellier cedex 5, France falleri, huchard, nebut@lirmm.fr Abstract. Implementing a model transformation is a very complex task and in an MDA process, chains of model transformations are usually built. When writing such a transformation chain, developers often need to have information on the previously applied transformations. Thus, disposing of a traceability framework enabling to gather information on the transformation behavior is an important feature for a transformation language. In this paper, we propose to implement a traceability framework in the Kermeta language based on a language independent trace metamodel. 1 Introduction In the model-oriented paradigm proned by the MDA [1], model transformations [2] are of crucial importance. Since model transformations can be very complex, and since source and target models can be composed of a great number of elements, it is very difficult for the developer and the user to figure out exactly how a transformation behaves. An MDA process generally involves several successive transformations, and if we consider such a chain of transformations, it is almost impossible, even for the developer, to recognize the elements in the first model that have led to the generation of a given element in the last model of the chain. Moreover, as explained in [3], some model transformations can be performed only when they dispose of the trace of anterior transformations. Another good example of the utility of traceability information is a refactoring chain, where you transform a model conform to a metamodel into an improved model conform to the same metamodel, through a chain of transformations (for example, UML class hierarchy restructuring using Formal Concept Analysis [4]). In this kind of transformation chain, a lot of information of the source model is lost during the chain but is expected to be reinjected in the target model. Thus, developers need a system to gather information on the transformation behaviour when executing it. Such a system is usually called a traceability framework. In this paper, we propose a simple traceability framework that is sufficient to solve the previous issues. This framework is based on a model definition (model as a set) inspired by [5], which allows a basic trace metamodel to be defined. This framework is implemented in the model oriented language Kermeta [6]. Model

transformations can be defined using Kermeta [7], but they are difficult to trace due to the imperative syntax of the language. The paper is structured as follows. Section 2 presents our approach. The Kermeta implementation and its usage are presented in Sections 3 and 4. Section 5 discusses the benefits and limitations of this approach, and related work as well. 2 An intuitive model definition To trace a model transformation, two concepts have to be precisely defined: what is a model and what is a model transformation. To remain in the model paradigm described by the MDA, these two concepts should be described by a model. Several metamodels are available to represent what is a model (MOF [8] for instance), but there is still a lack of consensus to exactly describe what is a model transformation. The main rationale for this lack is the difficulty to write a transformation metamodel independent from the transformation language. Anyway, if we want to trace model transformations, disposing of such a model is fully necessary. We need to know what are the basic entities of a model transformation, if we want to be capable of storing and analysing them. To obtain a trace metamodel independent from the transformation language, a simple and efficient method to model a model is to see it as a set, which is composed of elements (as shown in Figure 1). Fig. 1. Model transformation Definition 1. A model M is a set of elements. Definition 1 leads to the following definition of model transformations: Definition 2. Let M1 and M2 be two models. A model transformation is a relation t, t M1 M2. 2

Note in Figure 1 that an element of a source model can be linked to n elements of the target model, or n elements of the source model can be linked to one element of the target model. Moreover, every target element has a parent. Based on the previous definition of a model transformation, we propose the following definition for a model transformation trace. Definition 3. A transformation trace is a bipartite graph. The nodes are partitioned into two categories: source nodes and target nodes. Fig. 2. Transformation trace metamodel and model Therefore, if we want to be able to keep a trace of a model transformation, we have to set up the metamodel of a bipartite graph structure. As shown in Figure 2, a trace Step is composed of several Link. A Link references two Object: the source one and the target one. Object is the most general kind of element that can be found in the Kermeta language. Thus, it ensures that every type of element will be storable in the trace. This metamodel was designed to store the trace of a single transformation, and that is the reason why the related element has been named Step. But since transformations are usually small units which can be chained, we propose to modify this first metamodel to integrate as best as we can this usage of model transformations. Let s consider now a transformation chain trace. This kind of trace is slightly different from the one above. It is an ordered set of bipartite graphs with a common intersection (some target nodes of a graph are source nodes of the following graph). To handle that type of trace, we have extended our previous metamodel by adding a Trace object, which contains an ordered set of Step. The result of this extension is shown in the Figure 3. Now that we have determined what is a trace, we can define some operations on it. Let s consider the trace shown in the Figure 4. Definition 4. The direct parents of an element are the elements which are directly linked to it. For instance, parents(c3) = B3, B4. 3

Fig. 3. Transformation chain trace metamodel and model Definition 5. The parents of an element are the direct parents of the element and the direct parents of the direct parents (recursively). For instance, allparents(c3) = B3, B4, A4, A3. Fig. 4. A sample transformation chain trace 3 Kermeta implementation The mechanisms to easily handle a trace conform to the previously defined trace metamodel have been implemented in Kermeta [6]. Kermeta is a model oriented language which allows to define metamodels and to give them semantics. Moreover, it is fully compatible with the Eclipse implementation of EMOF: EMF [9]. We have implemented the following features in the traceability framework: 1. Generic traceability items; 2. Trace serialization (in XMI 2.0, thanks to EMF); 3. Simple transformation from a trace to graphviz s [10] dot language, in order to allow trace vizualisation. We have also respected the following constraints: 4

1. Trace generating code should be as short as possible, and only a small part of it should be placed in the transformation code; 2. Developers must be able to access to the elements of their choice through the trace; 3. Developers must be able to select the elements they want to trace. We can notice that Feature 2 and Constraint 2 are in contradiction. Indeed, if we want to serialize the trace, all the Object should be contained in it (otherwise we will only serialize reference, which is not really interesting). But if we want to modify a real model element, Object should only be references to real elements. That is why we have setted up two kinds of traces: Trace and StaticTrace. Trace contains only references and is used in the transformations, whereas StaticTrace contains the Object and can be serialized. To make the link between these two kinds of trace, a transformation from a Trace to a StaticTrace has been written. Listing 1.1 shows an extract of the trace metamodel source code implemented in the framework. Listing 1.2 shows the metamodel used to serialize the trace. Before being stored in the StaticTrace, the elements are transformed into a reduced form, named Element which contains only the information needed to allow a readable visualization. Listing 1.1. Transformation trace metamodel class Trace attribute s t e p s : oset Step [ 0.. ] // o s e t : Ordered Set Adds a l i n k in t h e g i v e n s t e p between t h e two g i v e n o b j e c t s operation a d d l i n k ( s t e p : String, name : String, s o u r c e : Object, t a r g e t : Object ) : Void i s do end I n i t s a new s t e p with t h e g i v e n name operation i n i t s t e p (name : S t r i n g ) : Void i s do end Returns t h e d i r e c t p a r e n t s o f t h e g i v e n o b j e c t operation parents ( t a r g e t : Object ) : Set<Object> i s do end Returns a l l p a r e n t s o f t h e g i v e n o b j e c t operation a l l p a r e n t s ( t a r g e t : Object ) : Set<Object> i s do end 5

Returns a l l p a r e n t s in t h e g i v e n s t e p o f t h e g i v e n o b j e c t operation p a r e n t s a t s t e p ( t a r g e t : Object, s t e p : S t r i n g ) : Set<Object> i s do end class Step attribute name : S t r i n g [ 1.. 1 ] attribute l i n k s : Link [ 0.. ] Adds a l i n k with t h e g i v e n name between t h e two g i v e n o b j e c t s operation a d d l i n k (name : String, s o u r c e : Object, t a r g e t : Object ) i s do end class Link attribute name : S t r i n g [ 1.. 1 ] reference s o u r c e : Object [ 1.. 1 ] reference t a r g e t : Object [ 1.. 1 ] Listing 1.2. Static transformation trace metamodel class S t a t i c T r a c e attribute elements : Element [ 0.. ] attribute s t e p s : oset S t a t i c S t e p [ 0.. ] // o s e t : Ordered Set class S t a t i c S t e p attribute name : S t r i n g [ 1.. 1 ] attribute l i n k s : S t a t i c L i n k [ 0.. ] class S t a t i c L i n k attribute name : S t r i n g [ 1.. 1 ] reference s o u r c e : Element [ 1.. 1 ] reference t a r g e t : Element [ 1.. 1 ] 6

class Element attribute id : S t r i n g attribute l a b e l : S t r i n g In order to manipulate the traces produced, an utility class has been written. The code of this class can be found in Listing 1.3. The only thing remaining to be done before being able to generate some dot code or to serialize a trace is to specialize the TraceUtils class, in order to implement the abstract label(object: Object): String operation. It ensures that the label of each Element generated will be understandable. class Listing 1.3. Utility class designed to manipulate trace T r a c e U t i l s P r i n t s t h e dot code r e p r e n s e n t i n g t h e g i v e n Trace operation t r a c e 2 d o t ( t r a c e : Trace ) i s do end Converts a Trace i n t o a S t a t i c T r a c e operation t r a c e 2 s t a t i c t r a c e ( t r a c e : Trace ) : S t a t i c T r a c e i s do end P r i n t s t h e dot code r e p r e n s e n t i n g t h e g i v e n S t a t i c T r a c e operation s t a t i c t r a c e 2 d o t ( t r a c e : S t a t i c T r a c e ) : Void i s do end Saves t h e g i v e n S t a t i c T r a c e to t h e g i v e n f i l e n a m e operation s a v e s t a t i c t r a c e ( t r a c e : StaticTrace, f i l e n a m e : S t r i n g ) : Void i s do end Loads t h e S t a t i c T r a c e from t h e g i v e n f i l e n a m e operation l o a d s t a t i c t r a c e ( f i l e n a m e : S t r i n g ) : S t a t i c T r a c e i s do end 7

A b s t r a c t l a b e l l i n g o p e r a t i o n used in t h e t r a c e 2 d o t and t h e t r a c e 2 s t a t i c t r a c e o p e r a t i o n s operation l a b e l ( o b j e c t : Object ) : S t r i n g i s abstract 4 The traceability framework in action To illustrate how this package works, we use a very simple transformation example: a class hierarchy (as defined by the minuml metamodel) will be turned into a database (as defined by the mindb metamodel). The two metamodels involved in the transformation are given in Figure 5. Fig. 5. minuml and mindb metamodels As it can be noticed in the minuml metamodel, a ClassHierarchy is composed of some Class. These Class have some Property. A Property has a name. The mindb metamodel has a similar structure as the minuml one. With these two metamodels, it is now possible to write a standard transformation between a ClassHierarchy and a DataBase (the code is given in Listing 1.4). This transformation is very simple: a Table is created for each Class of the source model, and a Column is added in the Table for each Property of the Class. Listing 1.4. Minuml2Mindb transformation code Transform a minuml model t o a mindb model operation transform ( s o u r c e : C lasshierarchy ) : DataBase i s do r e s u l t := DataBase. new // I n i t i a l i z e t h e t a r g e t model t r a c e. i n i t S t e p ( minuml2mindb ) // Trace Generating Code s o u r c e. h i e r a r c h y. each c l s // I t e r a t e on every c l a s s o f t h e source model var t a b l e : Table i n i t Table. new // Create a Table t a b l e. name := S t r i n g. c l o n e ( c l s. name) // Copy t h e name o f t h e Class to t h e t a b l e 8

end r e s u l t. t a b l e. add ( t a b l e ) // Add t h e t a b l e in t h e t a r g e t model t r a c e. a d d l i n k ( minuml2mindb, c l a s s 2 t a b l e, c l s, t a b l e ) // Trace Generating Code c l s. ownedattribute. each prop // I t e r a t e on every Property o f t h e Class var c o l : Column i n i t Column. new // Create a new Column c o l. name := S t r i n g. c l o n e ( prop. name) t a b l e. column. add ( c o l ) // Add t h e Column to t h e r e l a t i v e Table t r a c e. a d d l i n k ( minuml2mindb, property2column, prop, c o l ) // Trace Generating Code // End I t e r a t e on every Property o f t h e Class // End I t e r a t e on every c l a s s o f t h e source model Figure 6 shows the generated dot graph from the following transformation chain: minuml mindb minuml applied to a sample minuml model. Fig. 6. The generated transformation trace 5 Perspectives and conclusion With the framework we proposed in this paper, it is possible to trace transformations within Kermeta. But it is still possible to improve the Trace metamodel 9

and thus the framework. The first thing that is currently studied is the possibility to add composite links in a Step, which will be defined as a set of Link. A composite link would be associated to a significative part of a transformation (it could gather for instance all links relative to column creation of a given table). It would allow to add more semantics in the trace. When implementing this framework, it was very clear that the way used to handle the trace is very dependent from the choosen implementation language. As shown in the previous section, using our traceability framework requires to add trace generation code in the transformation code. With an imperative language, such code is unavoidable even if not wished (traceability should be as transparent as possible). To have trace generation code easily written and identified in a transformation, several solutions can be found, among them adding tags dedicated to the traceability management in the Kermeta language. Last, seeing models as sets leads to a simple and efficient definition of a trace, that is sufficient in many situations. Since models are not simply sets but rather directed and labeled graphs, it would be useful to construct a trace metamodel based on this definition. With such a trace, it would be possible to store more information than with the previous one. It would show for instance the composition relation between a table and some columns. References 1. OMG: MDA guide version 1.0.1. http://www.omg.org/docs/omg/03-06-01.pdf (2003) 2. Czarnecki, K., Helsen, S.: Classification of model transformation approaches. In: OOPSLA 03 Workshop on Generative Techniques in the Context of Model-Driven Architecture, Proceedings. (2003) 3. Vanhooff, B., Berbers, Y.: Supporting modular transformation units with precise transformation traceability metadata. In: ECMDA-TW 2005 Proceedings, Nuremberg, November 8th 2005. (2005) 4. Dao, M., Huchard, M., Hacene, M.R., Roume, C., Valtchev, P.: Improving Generalization Level in UML Models Iterative Cross Generalization in Practice. In: International Conference on Conceptual Structures ICCS 04. (2004) 5. Jouault, F.: Loosely coupled traceability for atl. In: ECMDA-TW 2005 Proceedings, Nuremberg, November 8th 2005. (2005) 6. Triskell project (IRISA): The metamodeling language kermeta. http://www.kermeta.org (2006) 7. Muller, P.A., Fleurey, F., Vojtisek, D., Drey, Z., Pollet, D., Fondement, F., Studer, P.,, Jézéquel, J.M.: On executable meta-languages applied to model transformations. In: Model Transformations In Practice Workshop. Proceeding, Montego Bay, Jamaica. (2005) 8. OMG: MOF 2.0 core specification. http://www.omg.org/cgi-bin/doc?ptc/2004-10-15 (2004) 9. Eclipse: The eclipse modeling framework (EMF) overview. http://www.eclipse.org/emf/docs.php?doc=references/overview/emf.html (2005) 10. Graphviz: Graph visualization software. http://www.graphviz.org (2001) 10