On the ability of complexity metrics to predict fault-prone classes in object-oriented systems

  • Authors:
  • Yuming Zhou;Baowen Xu;Hareton Leung

  • Affiliations:
  • State Key Laboratory for Novel Software Technology, Nanjing University, China and Department of Computer Science and Technology, Nanjing University, China;State Key Laboratory for Novel Software Technology, Nanjing University, China and Department of Computer Science and Technology, Nanjing University, China;Department of Computing, Hong Kong Polytechnic University, China

  • Venue:
  • Journal of Systems and Software
  • Year:
  • 2010

Quantified Score

Hi-index 0.00

Visualization

Abstract

Many studies use logistic regression models to investigate the ability of complexity metrics to predict fault-prone classes. However, it is not uncommon to see the inappropriate use of performance indictors such as odds ratio in previous studies. In particular, a recent study by Olague et al. uses the odds ratio associated with one unit increase in a metric to compare the relative magnitude of the associations between individual metrics and fault-proneness. In addition, the percents of concordant, discordant, and tied pairs are used to evaluate the predictive effectiveness of a univariate logistic regression model. Their results suggest that lesser known complexity metrics such as standard deviation method complexity (SDMC) and average method complexity (AMC) are better predictors than the two commonly used metrics: lines of code (LOC) and weighted method McCabe complexity (WMC). In this paper, however, we show that (1) the odds ratio associated with one standard deviation increase, rather than one unit increase, in a metric should be used to compare the relative magnitudes of the effects of individual metrics on fault-proneness. Otherwise, misleading results may be obtained; and that (2) the connection of the percents of concordant, discordant, and tied pairs with the predictive effectiveness of a univariate logistic regression model is false, as they indeed do not depend on the model. Furthermore, we use the data collected from three versions of Eclipse to re-examine the ability of complexity metrics to predict fault-proneness. Our experimental results reveal that: (1) many metrics exhibit moderate or almost moderate ability in discriminating between fault-prone and not fault-prone classes; (2) LOC and WMC are indeed better fault-proneness predictors than SDMC and AMC; and (3) the explanatory power of other complexity metrics in addition to LOC is limited.