Common refactorings, a dependency graph and some code smells: an empirical study of Java OSS

  • Authors:
  • S. Counsell;Y. Hassoun;G. Loizou;R. Najjar

  • Affiliations:
  • Brunel University, Uxbridge, Middlesex;Imperial College, London South Kensington;School of Information Sys. and Computing, Birkbeck, London;School of Information Sys. and Computing, Birkbeck, London

  • Venue:
  • Proceedings of the 2006 ACM/IEEE international symposium on Empirical software engineering
  • Year:
  • 2006

Quantified Score

Hi-index 0.00

Visualization

Abstract

Refactoring, as a software engineering discipline has emerged over recent years to become an important aspect of maintaining software. Refactoring refers to the restructuring of software according to specific mechanics and principles. In this paper, we describe an analysis of the results from a tool whose purpose was to identify and extract refactorings from seven open-source Java systems. In particular, we analyzed the mechanics of the most commonly and least commonly applied refactorings to try and account for their frequency. Results showed the most common refactorings of the fifteen coined a 'Gang of Six', to be generally those with a high in-degree and low out-degree when mapped on a dependency graph; the same refactorings also featured strongly in the remedying of bad code smells. Remarkably and surprisingly, inheritance and encapsulationbased refactorings were found to have been applied relatively infrequently - we offer explanations for why this may be the case. The paper thus identifies 'core' refactorings central to many of the changes made by developers on open-source systems. While we can not guarantee that developers consciously undertake refactoring in any sense, the empirical results demonstrate that simple renaming and moving fields/methods between classes are common components of open-source system re-engineering. From a wider software engineering perspective, knowledge of what a modification will incur in likely sub-tasks is of value to developers whether working on open-source or other forms of software.