The Map of the Archipelago of Refactorings

Apostolos Zarras, Theofanis Vartziotis, Panos Vassiliadis

Background. In [1], Fowler (with contributions by Beck, Brand, Opdyke and Roberts) introduced a well known catalog of 72 refactorings. To address the complexity and vastness of the refactorings space, Fowler grouped the 72 refactorings in six groups. However, the complexity of the space is further increased due to the inherent interconnection of these refactorings. Specifically, in Fowler's catalog, the documentation of each refactoring includes discussions that reflect relations with other refactorings which could be combined with the target refactoring, towards having more effective results. The "hidden" relations, refer to refactorings that could be performed before, or after the target refactoring. The "hidden" relations also concern alternative refactorings that could be performed instead of the target refactoring, or constituent refactorings that can be used to realize the target refactoring.

Overall, our study of Fowler's catalog brought out more than 100 relations between refactorings. In order to represent them concretely, we have introduced the map of the archipelago of refactorings, which is a graph with nodes representing Fowler's refactorings and edges representing their relations (details coming right away on edges). The size of the nodes and the tone of their colour indicate their importance in the map, concerning the total amount of relations (i.e., the sum of the node fan-in and fan-out) they are involved in.

What is the map of the archipelago of refactorings? In detail, the map is a graph that consists of 72 nodes, one for each refactoring included in Fowler's catalog. The in-depth study of Fowler's catalog revealed 3 different kinds of relations between refactorings, which correspond to different types of edges between the nodes of the map:

The full-fledged map of the archipelago of refactorings (click on it to zoom)

Clearly, the archipelago map is a very complex graph (its name is, of course, indicative of its nature). The complexity of the graph highlights the amount of information and the mental effort that is required from the developers, for the effective combination of refactorings.

Thus, to ease navigation, we divide the map in 6 major subgraphs, which we call regions.


A zoom out for the regions of map of the archipelago of refactorings (click on it to zoom)

The regions correspond to the 6 different categories of refactorings that are identified in Fowler's catalog.
Composing Methods consists of refactorings that allow to package code properly in methods.
Moving Features concerns refactorings that focus on responsibility assignment.
Organizing Data consists of refactorings that make working with data easier.
Simplifying Conditionals offers refactorings that deal with the complexity of conditional logic.
Simplifying Method calls provides refactorings that make method prototypes easier to understand and use.
Dealing with Generalization consists of refactorings that improve class hierarchies.

Refactoring Trip Advisor

The Refactoring Trip Advisor is an Eclipse Plug-in that allows to navigate through the map of the archipelago of refactorings. By following this link you can get more information about the tool and participate in a user study concerning its usefuleness.

Resources and Accreditation

All the figures are zipped here in png format.

All the figures are zipped here in graphml format, as exported by the yEd tool.

Credits

You may freely use the above resources, provided that you cite this results as:

Apostolos V. Zarras, Theofanis Vartziotis, Panos Vassiliadis. Navigating through the Archipelago of Refactorings. In Proceedings of the Joint 23rd ACM SIGSOFT Symposium on the Foundations of Software Engineering and 15th European Software Engineering Conference (FSE/ESEC), 2015.   

References

[1] M. Fowler. Refactoring: Improving the Design of Existing Code. Addison-Wesley, 2000.