Evaluating the effectiveness of object-oriented metrics for bug prediction
Abstract
In our experiments we examined the general relationship between object-oriented metrics and the fault-proneness of classes. We analyzed a large open-source program called Mozilla, calculated 58 object-oriented metrics for Mozilla at the class level \cite FSG04, collected the reported and corrected bugs from the bug tracking system of Mozilla and associated them with the classes. We applied logistic regression to examine which metrics could be used to predict the fault proneness of the classes. We found that 17 of the 58 object-oriented metrics were useful predictors, but to a different extent. The CBO (Coupling Between Object classes) metric was the best, but it was only slightly better than NOI (Number of Outgoing Invocations) and RFC (Response Set for a Class), which proved useful as well. We also examined the metrics in terms of their categories and we found that coupling metrics were the best predictors for finding bugs, but the complexity and size metrics also gave good results. On the other hand, in tests all the inheritance-related metrics were statistically insignificant.