Software refactoring is a maintenance task that addresses code restructuring to improve its quality. Many studies have addressed the impact of different refactoring scenarios on software quality. This study presents a systematic literature review that aggregates, summarizes, and discusses the results of 76 relevant primary studies (PSs) concerning the impact of refactoring on several internal and external quality attributes. The included PSs were selected using inclusion and exclusion criteria applied to relevant articles published before the end of 2015. We analyzed the PSs based on a set of classification criteria, including software quality attributes and measures, refactoring scenarios, evaluation approaches, datasets, and impact results. We followed the vote-counting approach to determine the level of consistency among the PS reported results concerning the relationship between refactoring and software quality. The results indicated that different refactoring scenarios sometimes have opposite impacts on different quality attributes. Therefore, it is false that refactoring always improves all software quality aspects. The vote-counting study provided a clear view of the impacts of some individual refactoring scenarios on some internal quality attributes such as cohesion, coupling, complexity, inheritance, and size, but failed to identify their impacts on external and other internal quality attributes due to insufficient findings.
18 November 2010 in IEEE Transactions on Software Engineering
Several object-oriented cohesion metrics have been proposed in the literature. These metrics aim to measure the relationship between class members, namely, methods and attributes. Different metrics use different models to represent the connectivity pattern of cohesive interactions (CPCI) between class members. Most of these metrics are normalized to allow for easy comparison of the cohesion of different classes. However, in some cases, these metrics obtain the same cohesion values for different classes that have the same number of methods and attributes but different CPCIs. This leads to incorrectly considering the classes to be the same in terms of cohesion, even though their CPCIs clearly indicate that the degrees of cohesion are different. We refer to this as a lack of discrimination anomaly (LDA) problem. In this paper, we list and discuss cases in which the LDA problem exists, as expressed through the use of 16 cohesion metrics. In addition, we empirically study the frequent occurrence of the LDA problem when the considered metrics are applied to classes in five open source Java systems. Finally, we propose a metric and a simulation-based methodology to measure the discriminative power of cohesion metrics. The discrimination metric measures the probability that a cohesion metric will produce distinct cohesion values for classes with the same number of attributes and methods but different CPCIs. A highly discriminating cohesion metric is more desirable because it exhibits a lower chance of incorrectly considering classes to be cohesively equal when they have different CPCIs.
1 October 2012 in Information and Software Technology
Refactoring is a maintenance task that aims at enhancing the quality of a software’s source code by restructuring it without affecting the external behavior. Move method refactoring (MMR) involves reallocating a method by moving it from one class to the class in which the method is used most. Several studies have been performed to explore the impact of MMR on several quality attributes. However, these studies have several limitations related to the applied approaches, considered quality attributes, and size of the selected datasets. This paper reports an empirical study that applies statistical and machine learning (ML) approaches to explore the impact of MMR on code quality. The study overcame the limitations of the existing studies, and this improvement is expected to make the results of this study more reliable and trustworthy. We considered eight quality attributes and thirty quality measures, and a total of approximately 4 K classes from seven Java open-source systems were involved in the study. The results provide evidence that most of the quality attributes were significantly improved by MMR in most cases. In addition, the results show that a limited number of measures, when considered individually, have a significant ability to predict MMR, whereas most of the considered measures, when considered together, significantly contribute to the MMR prediction model. The constructed ML-based prediction model has an area under curve (AUC) value of 96.6%.