On the existence of high-impact refactoring opportunities in programs

  • Authors:
  • Jens Dietrich;Catherine McCartin;Ewan Tempero;Syed M. Ali Shah

  • Affiliations:
  • Massey University, Palmerston North, New Zealand;Massey University, Palmerston North, New Zealand;University of Auckland, Auckland, New Zealand;Massey University, Palmerston North, New Zealand

  • Venue:
  • ACSC '12 Proceedings of the Thirty-fifth Australasian Computer Science Conference - Volume 122
  • Year:
  • 2012

Quantified Score

Hi-index 0.00

Visualization

Abstract

The refactoring of large systems is difficult, with the possibility of many refactorings having to be done before any useful benefit is attained. We present a novel approach to detect starting points for the architectural refactoring of large and complex systems based on the analysis and manipulation of the type dependency graph extracted from programs. The proposed algorithm is based on the simultaneous analysis of multiple architectural antipatterns, and outputs dependencies between artefacts that participate in large numbers of instances of these antipatterns. If these dependencies can be removed, they represent high-impact refactoring opportunities: a small number of changes that have a major impact on the overall quality of the system, measured by counting architectural antipattern instances. The proposed algorithm is validated using an experiment where we analyse a set of 95 open-source Java programs for instances of four architectural patterns representing modularisation problems. We discuss some examples demonstrating how the computed dependencies can be removed from programs. This research is motivated by the emergence of technologies such as dependency injection frameworks and dynamic component models. These technologies try to improve the maintainability of systems by removing dependencies between system parts from program source code and managing them explicitly in configuration files.