FREE ELECTRONIC LIBRARY - Dissertations, online materials

Pages:   || 2 | 3 | 4 | 5 |   ...   | 6 |

«Abstract. Model-driven software engineering promotes the use of models and transformations as primary artifacts. Several formalisms can be used for ...»

-- [ Page 1 ] --

On the Use of Graph Transformations

for Model Refactoring

Tom Mens1

Service de Génie Logiciel

Université de Mons-Hainaut, Belgium



Abstract. Model-driven software engineering promotes the use of models and

transformations as primary artifacts. Several formalisms can be used for the spec-

ification of model transformations. In this tutorial, we introduce and discuss such

a formalism that is based on graphs and graph transformations. In particular, we focus on the activity of model refactoring, and show how graph transformation can provide formal support for this activity. We also show how such support can be implemented in state-of-the-art graph transformation tools such as AGG and Fujaba.

1 Introduction Model-driven engineering is a software engineering approach that promotes the usage of models and transformations as primary artifacts. Its goal is to tackle the problem of developing, maintaining and evolving complex software systems by raising the level of abstraction from source code to models. As such, model-driven engineering promises reuse at the domain level, increasing the overall software quality. Model transformation is the heart and soul of this approach [1].

Graph transformation seems to be a suitable technology and associated formalism

to specify and apply model transformations for the following reasons:

– Graphs are a natural representation of models that are intrinsically graph-based in nature (e.g., statecharts, activity diagrams, collaboration diagrams, class diagrams, Petri nets), as opposed to source code for which a tree-based approach is likely to be more appropriate. In Bézivin’s tutorial on model-driven engineering [2], this link between models and graphs is explained as follows: “... we will give a more limited definition of a model, in the context of MDE only, as a graph-based structure representing some aspects of a given system and conforming to the definition of another graph called a metamodel.” – Graph transformation theory provides a formal foundation for the automatic appli- cation of model transformations. As such, one can reason about many interesting formal properties such as confluence, sequential and parallel dependence, and so on.

– Tool support for model-driven development based on graph transformation engines is starting to emerge (e.g., GReAT [3], MOLA [4] and VIATRA [5]).

2 T. Mens An important activity within the domain of model transformation is model refac- toring. The term refactoring was originally introduced by Opdyke in his seminal PhD dissertation[6] in the context of object-oriented programming. Martin Fowler [7] denes this activity as ”the process of changing a software system in such a way that it does not alter the external behavior of the code, yet improves its internal structure”.

Recently, research interest has shifted from program refactoring to model refactoring [8,9,10,11,12], which aims to apply refactoring techniques at model level as opposed to source code.

The objectives of this tutorial are threefold:

– To introduce the notion of model refactoring as a special kind of model transformation activity, and to motivate the importance of this activity in the MDE process;

– To introduce graph transformation as a promising technique (covering both theoretical foundations and tool support) for software transformation;

– To show how graph transformation can provide formal support to automate the activity of model refactoring, and to compare graph transformation to related approaches.

The rest of this tutorial is structured as follows. Section 2 provides a high-level overview of model transformation and model refactoring, and introduces the necessary terminology. Section 3 introduces some theory on graph transformation. Section 4 discusses and compares AGG [13] and Fujaba [14,15], two general-purpose graph transformation tools, and shows how these tools can be used to implement support for model refactoring. Finally, section 7 concludes.

2 Model transformation The aim of this section is to give a general high-level overview of model transformation, and to show where model refactoring fits in. In order to do this, it is important to be aware of the fact that model refactoring represents only a very specific kind of model transformation. To illustrate this, we briefly discuss a taxonomy of model transformation in the first subsection.

2.1 Taxonomy [16] presented a detailed taxonomy of model transformation and showed how it could be applied to graph transformation. We will summarise some important ideas of the model transformation taxonomy here. Applying graph transformations to model transformation in general, however, is outside the scope of this paper.

In order to transform models, these models need to be expressed in some modeling language, the syntax of which is expressed by a metamodel. Based on the metamodels that are used for expressing the source and target models of a transformation, a distinction can be made between endogenous and exogenous transformations. Endogenous transformations are transformations between models expressed in the same metamodel.

Exogenous transformations are transformations between models expressed in different metamodels. A typical example of an exogenous transformation is migration of a model Graph transformations for model refactoring 3 a program written in one particular language to another one. A typical example of an endogenous transformation is refactoring, where the internal structure of a model is improved (with respect to a certain software quality characteristic) without changing its observable behaviour [7].

Besides this distinction between endogenous and exogenous model transformations, we can also distinguish horizontal and vertical model transformations. A horizontal transformation is a transformation where the source and target models reside at the same abstraction level. A typical examples is again refactoring (an endogenous transformation). A vertical transformation is a transformation where the source and target models reside at different abstraction levels. A typical example of a vertical transformation is synthesis of a higher-level, more abstract, specification (e.g., a UML design model) into a lower-level, more concrete, one (e.g, a Java program).

Table 1 illustrates that the dimensions horizontal versus vertical and endogenous versus exogenous are truly orthogonal, by giving a concrete example of all possible combinations. As a clarification for the Formal refinement mentioned in the table, a specification in first-order predicate logic or set theory can be gradually refined such that the end result uses exactly the same language as the original specification (e.g., by adding more axioms).

Table 1. Orthogonal dimensions of model transformations

–  –  –

Exercise 1. Identify some other types of model transformation (besides the four mentioned in Table 1) and classify them according to the taxonomy presented above.

2.2 Model refactoring An emerging research trend is to port the idea of refactoring to the modeling level, for example by applying refactoring techniques to UML models [8,9,10].

Boger et al. developed a refactoring browser integrated with a UML modeling tool [9]. It supports refactoring of class diagrams, statechart diagrams, and activity diagrams.

For each of these diagrams, the user can apply refactorings that cannot easily or naturally be expressed in other diagrams or in the source code.

Sunyé et al. formally defined some statechart refactorings using OCL pre- and postconditions [8]. Similarly, Van Gorp et al. propose a UML extension to express the preand postconditions of source code refactorings using OCL [10]. The proposed extension allows an OCL empowered CASE tool to verify nontrivial pre and postconditions, to compose sequences of refactorings, and to use the OCL query engine to detect bad code smells. Such an approach is desirable as a way to refactor designs independent of 4 T. Mens the underlying programming language. Correa and Werner built further on these ideas, and implemented the refactorings in OCL-script, an extension of OCL [17].

An alternative approach is followed by Porres [18], who implements model refactorings as rule-based update transformations in SMW, a scripting language based on Python.

Zhang et al. developed a model transformation engine that integrates a model refactoring browser that automates and customises various refactoring methods for either generic models or domain-specific models [12].

Exercise 2. For each type of UML diagram you are familar with, try to come up with one or more examples of a model refactoring, i.e., a transformation that improves the structure of a UML model yet preserves its behaviour.

In the remainder of this tutorial, we will mainly restrict ourselves to model refactoring of UML class diagrams for various reasons. However, most of the ideas explained in this tutorial are directly applicable to refactorings of other kinds of models as well.

Even domain-specific models and non-UML-compliant models (e.g. database schemas in ER notation) can be targeted. The primary restriction is that the models have to be expressible in a diagrammatic, graph-like notation.

2.3 Model consistency

Another crucial aspect of model transformation, and model refactoring in particular, is model consistency. It will not be treated in this tutorial, but we briefly mention some relevant related work here.

Spanoudakis and Zisman [19] provided an excellent survey on inconsistency management in software engineering. According to them, an inconsistency is “a state in which two or more overlapping elements of different software models make assertions about aspects of the system they describe which are not jointly satisfiable". They claim that the following activities are essential for inconsistency management: detection of overlaps, detection of inconsistencies, diagnosis of inconsistencies, handling of inconsistencies, tracking, specification and application of an inconsistency management policy.

Since a UML model is typically composed of many different diagrams, the consistency between all these diagrams needs to maintained when any of them evolves. Sunyé et al. explored how the integrity of class diagrams and statecharts could be maintained after refactorings [8]. Van Der Straeten et al. explored the use of description logics as a way to specify and implement consistency rules and behaviour preservation rules [20,11].

Exercise 3. Give some examples of consistency problems that can occur in a UML model consisting of different kinds of UML diagrams. Consider only class diagrams, state transition diagrams (describing the internal behaviour of a class) and sequence diagrams (describing the message interations between class instances). Inconsistencies between these diagrams can arise when any of these diagrams is modified.

Graph transformations for model refactoring 5 The problem of consistency maintenance becomes even more problematic when we acknowledge the obvious fact that models are only an intermediate step in the software development life-cycle, where the actual executable program is the most important deliverable. In this context, consistency should be maintained between the modeling level and the implementation level. Modifications to the models should be automatically reected in the source code and vice versa. Again, this is a far from trivial problem that is outside the scope of this paper.

Exercise 4. Give an example of a consistency problem that can arise between UML design models and their generated source code when a small change is made to either the design models or the source code.

If you have a CASE tool available that allows you to generate programs from UML models, or to extract UML models from source code, verify whether this consistency problem is addressed by the CASE tool.

3 Graph transformation theory

Since the aim of this tutorial is to study the use of graph transformation for the purpose of model refactoring, in this section we will introduce the necessary theory and terminology about graph transformation. In Section 4 we will try to put this theory into practice by using two concrete graph transformation tools, AGG and Fujaba.

3.1 Introduction

Graph transformation theory has been developed over the last three decades as a suite of techniques and tools for formal modeling and very high-level visual programming.

Graph transformations can typically be found in two flavours: graph grammars and graph rewriting.

Graph grammars are the natural extension of Chomsky’s generative string grammars into the domain of graphs. Production rules for (string-) grammars are generalized into production rules on graphs, which generatively enumerate all the sentences (i.e., the “graphs”) of a graph grammar. Similarly, string rewriting can be generalized into graph rewriting. A string rewriting consists of a pattern and a replacement string. The pattern is matched against an input string, and the matched substring is replaced with the replacement string of the rule. In analogy, a graph rewriting consists of a pattern graph and a replacement graph. The application of a graph rewriting rule matches the pattern graph in an input graph, and replaces the matched subgraph with the replacement graph.

Many tools, even full-fledged programming environments (e.g., AGG [13] and Fujaba [15]), have been developed that illustrate the practical applicability of the graph transformation approach. These environments have demonstrated that (1) complex transformations can be expressed in the form of rewriting rules, and (2) graph rewriting rules can be compiled into efficient code. In recent years, a number of model transformation tools have emerged that use graph transformation as an underlying transformation engine. Concrete examples are GReAT [3], MOLA [4] and VIATRA [5]).

6 T. Mens

3.2 Graphs

According to Bézivin and many others, a model can naturally be represented as a graphbased structure. Figure 1 clarifies this idea, and shows the correspondence between models and their graph representation. In this subsection, we will formally define the notions of graph and type graph, as well as how they are related.

–  –  –

Pages:   || 2 | 3 | 4 | 5 |   ...   | 6 |

Similar works:

«Journal of Tourism Insights Volume 3 | Issue 1 Article 2 7-17-2012 Surfing as adventure travel: Motivations and lifestyles Zachariah Reynolds University of North Carolina Wilmington Nancy M. Hritz Dr. University of North Carolina Wilmington, hritzn@uncw.edu Follow this and additional works at: http://scholarworks.gvsu.edu/jti Part of the Recreation, Parks and Tourism Administration Commons, and the Tourism Commons Recommended Citation Reynolds, Zachariah and Hritz, Nancy M. Dr. (2012) Surfing...»

«IS SPEAKING IN TONGUES REALLY FOR EVANGELISM? GEORGE PAKI PEER REVIEWED Abstract: No biblical topic has received more scrutiny than has “glossolalia”1 which has attracted a variety of explanatory propositions from theologians of all persuasions. To most Pentecostals, the gift of tongues is both a pillar tenet and a “litmus test” for spirit-baptism. However, for the majority of the conservative evangelicals, tongues constitute a known language given for the purpose of evangelism. This...»

«BtN: Episode 10 Transcript 1/5/12 On this week's Behind the News. Why trouble for Parliament's Speaker is bad news for the Government. Celebrity tweets, can we really believe what they're saying? And we visit Burma to see why people finally have something to smile about. Hi I'm Nathan Bazley, welcome to Behind the News. Also on the show today, Tash checks out some pooches with a nose for trouble. But first. Slipper Slip up Reporter: Nathan Bazley INTRO: Ever since the last federal election life...»

«Hak Cipta Terpelihara © 2012 – Persatuan Sejarah Malaysia PERSEKUTUAN TANAH MELAYU MERDEKA, 31 OGOS 1957: LIKU DAN JEJAK PERJUANGAN PATRIOT DAN NASIONALIS MENENTANG BRITISH Abdullah Zakaria Ghazali* Pendahuluan Pada tahun ini, 31 Ogos 2012, genaplah 55 Persekutuan Tanah Melay (kini dikenali sebagai Malaysia) mencapai kemerdekaan. Sepanjang 55 tahun tersebut Malaysia mengalami berbagai pancaroba. Namun begitu. Malaysia terus menerus mencapai kemajuan dalam bcrbagai bidang. politk, ekonomi dan...»

«GEORGE USCĂTESCU LENGUAJE POÉTICO Y MUSICAL EN GARCÍA LORCA I La obra poética de Federico García Lorca se presta como pocas, entre las de su generación, a consideraciones destinadas a abrirla a una arquitectura musical. No quiere esto decir necesariamente que un discurso renovado entorno al caracter personalísimo de la obra poética de García Lorca, tenga que colocarse en la encrucijada entre musicología y lingűística ya mencionada por Jakobson en sus Cuestiones de Poética1. Ni la...»

«Jones, Andrew M. (2002) The ’global city’ misconceived: the myth of ’global management’ in transnational service firms. Geoforum 33 (3), pp. 335-350. ISSN 0016-7185. Downloaded from: http://eprints.bbk.ac.uk/395/ Usage Guidelines Please refer to usage guidelines at http://eprints.bbk.ac.uk/policies.html or alternatively contact lib-eprints@bbk.ac.uk. Birkbeck ePrints: an open access repository of the research output of Birkbeck College http://eprints.bbk.ac.uk Jones, Andrew (2002) The...»

«2016 GALLERY EQUINE GRAND NATIONAL CHAMPIONSHIPS To access the “Results” section for 2016 Gallery Equine Grand National Championships: go to www.showhorsecouncilaust.com.au follow link in top right hand corner to SHCA database click on “shows” make sure you select 2016 Gallery Equine Grand National Championships click on “results”, and make the selection for which day/class you want to see and then click on the button marked “all results” scroll down and you should see all of...»

«.But I had the antidote right here !!! Due to budget restraints CSI Redford will be discontinued Hey, look at what I found leaking out of that other students head Look at this. We've invented. AIR ! When we get to high school, I hear that Keisling will actually let us put stuff IN the test tubes. What are these things and what do you do with them? So THIS is where babies come from! Thurston Class of 1965 45 Year Reunion 1965 NEWS January 4 U.S. President Lyndon B. Johnson proclaims his Great...»

«Interaktive Visualisierungen für den Linkingund Suchprozess heterogener Informationen im Web Daniel Hienert 29. Oktober 2013 Vom Promotionsausschuss des Fachbereichs 4: Informatik der Universität Koblenz-Landau zur Verleihung des akademischen Grades Doktor der Naturwissenschaften (Dr. rer. nat.) genehmigte Dissertation. Tag der wissenschaftlichen Aussprache: 18. Oktober 2013 Vorsitzender des Promotionsausschusses: Prof. Dr. Rüdiger Grimm Promotionskommission Vorsitzender: Prof. Dr. Ralf...»

«Challenges of Graduate Students 1 Running Head: CHALLENGES OF GRADUATE STUDENTS Challenges of Graduate Students at Malaysian Higher Education Institutions Melati Sumari Western Michigan University Challenges of Graduate Students 2 Abstract In this paper, the challenges faced by graduate students in Malaysia are discussed. Structure of graduate programs, lack of research resources, limited research opportunities, lack of opportunity to involve in professional organizations, shortage of qualified...»

«THE GNOSTIC SOCIETY LIBRARY “The Nag Hammadi Library” The “Nag Hammadi Library” is a collection of early Christian Gnostic texts discovered near the Egyptian town of Nag Hammadi, in 1945. Nag Hammadi library The Nag Hammadi library (popularly known as The Gnostic Gospels) is a collection of early Christian Gnostic texts discovered near the town of Nag Hammâdi in 1945. That year, twelve leather-bound papyrus codices buried in a sealed jar were found by a local peasant named Mohammed...»

«All Rights Reserved Library of University of Jordan Center of Thesis Deposit III All Rights Reserved Library of University of Jordan Center of Thesis Deposit IV All Rights Reserved Library of University of Jordan Center of Thesis Deposit II All Rights Reserved Library of University of Jordan Center of Thesis Deposit III All Rights Reserved Library of University of Jordan Center of Thesis Deposit Dedication In the memory of my father, Dr. Nouh Al-Qudah The one who inspired me the most. The one...»

<<  HOME   |    CONTACTS
2016 www.dissertation.xlibx.info - Dissertations, online materials

Materials of this site are available for review, all rights belong to their respective owners.
If you do not agree with the fact that your material is placed on this site, please, email us, we will within 1-2 business days delete him.