A case study to evaluate the suitability of graph transformation tools for program refactoring (original) (raw)
Related papers
On the use of graph transformations for model refactoring
Model-driven software engineering promotes the use of models and transformations as primary artifacts. Several formalisms can be used for the specification of model transformations. We propose to represent models as graphs, and model transformations as graph transformations. In particular, we focus on the activity of model refactoring, and show how graph transformation theory 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, and provide two concrete experiments. Critical pair analysis in AGG enables the analysis of dependencies between model refactorings. The round-trip engineering facility of Fujaba enables the automatic generation of code for model refactorings.
Formalising refactorings with graph transformations
The widespread interest in refactoring - transforming the source-code of an object-oriented program without changing its external behaviour— has increased the need for a precise definition of refactoring transformations and their properties. In this paper we explore the use of graph rewriting for specifying refactorings and their effect on programs. We introduce a graph representation for programs and show how two representative refactorings can be expressed by graph productions. Then we demonstrate that it is possible to prove that refactorings preserve certain program properties, and that graph rewriting is a suitable formalism for such proofs.
A case study for program refactoring
2008
Abstract. This paper proposes a case for the GraBaTs' 08 tool contest. The graph transformation system to be implemented shall (i) import a graph-based representation of models of Java programs in a Gxl-based format,(ii) allow these models to be transformed interactively with three well-known program refactorings Encapsulate Field, Move Method, and Pull-up Method, and (iii) export the resulting models in the same Gxlformat.
Improving the Usability of a Graph Transformation Language
Electronic Notes in Theoretical Computer Science, 2006
Model transformation tools implemented using graph transformation techniques are often expected to provide high performance. For this reason, in the Graph Rewriting and Transformation (GReAT) language we have supported two techniques: pre-binding of selected pattern variables and explicit sequencing of transformation steps to improve the performance of the transformation engine. When applied to practical situations, we recognized three shortcomings in our approach: (1) no support for the convenient reuse of results of one rewriting step in another, distant step, (2) lack of a sorting capability for ordering the results of the pattern matching, and (3) absence of support for the distinguished merging of results of multiple pattern matches. In this paper we briefly highlight the relevant features of GReAT, describe three motivating examples that illustrate the problems, introduce our solutions: new extensions to the language, and compare the approaches to other languages.
( ICGT-DS 2010 ) Search-Based Refactoring based on Unfolding of Graph Transformation Systems
2011
To improve scalability and understandability of search-based refactoring, in this paper, we propose a formulation based on graph transformation which allows us to make use of partial order semantics and an associated analysis technique, the approximated unfolding of graph transformation systems. We use graphs to represent object-oriented software architectures at the class level and graph transformations to describe their refactoring operations. In the unfolding we can identify dependencies and conflicts between refactoring steps leading to an implicit and therefore more scalable representation of the search space. An optimisation algorithm based on the Ant Colony paradigm is used to explore this search space, aiming to find a sequence of refactoring steps that leads to the best design at a minimal costs.
Graph transformations and software engineering: Success stories and lost chances
Journal of Visual Languages & Computing, 2013
Textual as well as visual and diagrammatic notations are essential in software engineering, and are used in many different contexts. Chomsky grammars are the key tool to handle textual notations, and find many applications for textual languages. Visual and diagrammatic languages add spatial dimensions that reduce the applicability of textual grammars and call for new tools. Graph transformation systems have been studied for over 40 years and are a powerful tool to deal with syntax, semantics and transformation of diagrammatic notations. The enormous importance of visual and diagrammatic languages and the strong support that graph transformation provide to the manipulation of diagrammatic notations would suggest a big success of graph transformation in software engineering. Graph transformation systems find their application both as language generating devices and specification means for system evolution, and thus can have many applications in software engineering. In this paper we discuss the main features of graph transformation and how they can help software engineers. We look back to the many attempts to use graph transformations in software engineering in the last 15 years, identify some success stories, and discuss to what extent graph transformation succeeded, when they have not succeeded yet, what are the main causes of failures, and how they can help software engineering in the next 15 years.
Search-Based Refactoring based on Unfolding of Graph Transformation Systems
2015
Abstract: To improve scalability and understandability of search-based refactoring, in this paper, we propose a formulation based on graph transfor-mation which allows us to make use of partial order semantics and an associ-ated analysis technique, the approximated unfolding of graph transformation systems. We use graphs to represent object-oriented software architectures at the class level and graph transformations to describe their refactoring operations. In the unfolding we can identify dependencies and conflicts be-tween refactoring steps leading to an implicit and therefore more scalable representation of the search space. An optimisation algorithm based on the Ant Colony paradigm is used to explore this search space, aiming to find a sequence of refactoring steps that leads to the best design at a minimal costs.
Search-Based Refactoring using Unfolding of Graph Transformation Systems
Electronic Communication of The European Association of Software Science and Technology, 2011
To improve scalability and understandability of search-based refactoring, in this paper, we propose a formulation based on graph transformation which allows us to make use of partial order semantics and an associated analysis technique, the approximated unfolding of graph transformation systems. We use graphs to represent object-oriented software architectures at the class level and graph transformations to describe their refactoring operations. In the unfolding we can identify dependencies and conflicts between refactoring steps leading to an implicit and therefore more scalable representation of the search space. An optimisation algorithm based on the Ant Colony paradigm is used to explore this search space, aiming to find a sequence of refactoring steps that leads to the best design at a minimal costs.