Investigation of the impact of cohesion on the change-proneness of Java interfaces:
R.A. Pingen · Research Repository (Delft University of Technology) · 2012
A lack of cohesion is often associated with bad software quality, and could lead to more changes and bugs in software. In this thesis the impact of cohesion on the change-proneness of Java interfaces is investigated. Showing the existence of a relation between these concepts can lead to better change prediction models that can support software developers in defect prediction and prevention tasks. An empirical study is performed on several open source projects to test three hypotheses. The first hypothesis investigates whether cohesion metrics correlate with the number of fine-grained source code changes. The results of the correlation analysis show a correlation between two cohesion metrics and the number of changes in Java interfaces. The confounding effect of class size is a possible explanation for the correlation between the cohesion metrics and the number of fine-grained changes. This idea is investigated through the second hypothesis, which studies the correlation between the cohesion metrics and interface size metrics. The hypothesis is accepted for the same two metrics. The third hypothesis of this thesis tries to answer whether cohesion metrics can improve change prediction models based on size. By performing three different experiments with multiple classification algorithms, we have found no evidence that supports the final hypothesis. Concluding, cohesion metrics can be used to predict changes in source code. However, they are not better predictors than size metrics, and we have found no evidence to support the idea that they can improve change prediction models based on size.