How Do Developers Refactor Code to Improve Code Reusability?

Abstract

Refactoring is the de-facto practice to optimize software health. While there has been several studies proposing refactoring strate-gies to optimize software design through applying design patterns and removing design defects, little is known about how developers actually refactor their code to improve its reuse. Therefore, we extract, from 1,828 open source projects, a set of refactorings which were intended to improve the software reusability. We analyze the impact of reusability refactorings on state-of-the-art reusability metrics, and we compare the distribution of reusability refactoring types, with the distribution of the remaining mainstream refactorings. Overall, we found that the distribution of refac-toring types, applied in the context of reusability, is diffrerent from the distribution of refactoring types in mainstream development. In the refac- torings performed to improve reusability, source files are subject to more design level types of refactorings. Reusability refactorings significantly impact, high-level code elements, such as packages, classes, and methods, while typical refactorings, impact all code elements, including identifiers, and parameters.

Publication
International Conference on Software and Software Reuse
Eman Abdullah Alomar
Eman Abdullah Alomar
Assistant Professor of Software Engineering Department
Philip T Rodriguez
Philip T Rodriguez
Software Engineer
Christian D. Newman
Christian D. Newman
Assistant Professor

Research interests software refactoring and quality.

Ali Ouni
Ali Ouni
Associate Professor

Research interests software refactoring and quality.

Mohamed Wiem Mkaouer
Mohamed Wiem Mkaouer
Assistant Professor of Software Engineering

Research interests software refactoring and quality.