Constructing models for predicting extract subclass refactoring opportunities using object-oriented quality metrics

  • Authors:
  • Jehad Al Dallal

  • Affiliations:
  • Department of Information Science, Kuwait University, P.O. Box 5969, Safat 13060, Kuwait

  • Venue:
  • Information and Software Technology
  • Year:
  • 2012

Quantified Score

Hi-index 0.00

Visualization

Abstract

Context: Refactoring is a maintenance task that refers to the process of restructuring software source code to enhance its quality without affecting its external behavior. Inspecting and analyzing the source code of the system under consideration to identify the classes in need of extract subclass refactoring (ESR) is a time consuming and costly process. Objective: This paper explores the abilities of several quality metrics considered individually and in combination to predict the classes in need of ESR. Method: For a given a class, this paper empirically investigates, using univariate logistic regression analysis, the abilities of 25 existing size, cohesion, and coupling metrics to predict whether the class is in need of restructuring by extracting a subclass from it. In addition, models of combined metrics based on multivariate logistic regression analysis were constructed and validated to predict the classes in need of ESR, and the best model is justifiably recommended. We explored the statistical relations between the values of the selected metrics and the decisions of the developers of six open source Java systems with respect to whether the classes require ESR. Results: The results indicate that there was a strong statistical relation between some of the quality metrics and the decision of whether ESR activity was required. From a statistical point of view, the recommended model of metrics has practical thresholds that lead to an outstanding classification of the classes into those that require ESR and those that do not. Conclusion: The proposed model can be applied to automatically predict the classes in need of ESR and present them as suggestions to developers working to enhance the system during the maintenance phase. In addition, the model is capable of ranking the classes of the system under consideration according to their degree of need of ESR.