A case study 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.
( 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.
Object-oriented refactoring using graph rewriting
2001
Abstract. This paper advocates need for a formal foundation for refactoring object-oriented software. More specifically, it investigates the potential of graph rewriting as candidate formalism. Using a small Java application as a case study, it shows how a range of different notions of behaviour preservation can be expressed in a formal, yet intuitive, way. A number of other open research topics that can benefit from a graph rewriting formalism are discussed as well. Keywords.
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.
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.
A Hierarchical Program Representation for Refactoring
Electronic Notes in Theoretical Computer Science, 2003
Currently there is a lot of interest in graph representations of software systems, as they provide a natural and flexible means to describe complex structures. The various visual sublanguages of the UML are perhaps the most obvious example of this. In [11] a graph representation of object-oriented programs was presented that enables one to describe refactoring operations (behaviour-preserving changes in the structure of a program) in a formal, concise way by graph rewriting productions. In general, however, a refactoring makes changes to a small part of a program, so the graph representation should only contain the information needed to carry out that refactoring. All other details are redundant and make the graph unnecessarily large for good visualization. A possible solution consists in using a hierarchical representation. Such a representation of object-oriented programs is presented in this paper. It is based on node-rewriting graph productions: each refinement step corresponds to a production. The construction is illustrated by applying it to a small Java simulation of a Local Area Network.