Empirical analysis of the relationship between CC and SLOC in a large corpus of Java methods

Abstract : Measuring the internal quality of source code is one of the traditional goals of making software development into an engineering discipline. Cyclomatic complexity (CC) is an often used source code quality metric, next to source lines of code (SLOC). However, the use of the CC metric is challenged by the repeated claim that CC is redundant with respect to SLOC because of strong linear correlation. We conducted an extensive literature study of the CC/SLOC correlation results. Next, we tested correlation on large Java (17.6 M methods) and C (6.3 M functions) corpora. Our results show that linear correlation between SLOC and CC is only moderate as a result of increasingly high variance. We further observe that aggregating CC and SLOC as well as performing a power transform improves the correlation. Our conclusion is that the observed linear correlation between CC and SLOC of Java methods or C functions is not strong enough to conclude that CC is redundant with SLOC. This conclusion contradicts earlier claims from literature but concurs with the widely accepted practice of measuring of CC next to SLOC
Type de document :
Communication dans un congrès
Moonen, L. M. F. and Pollock, L. IEEE International Conference on Software Maintenance and Evolution 2014, Sep 2014, Victoria, Canada. IEEE Computer Society, pp.221 - 230, 2014
Liste complète des métadonnées

https://hal.inria.fr/hal-01110843
Contributeur : Anne Jaigu <>
Soumis le : jeudi 29 janvier 2015 - 09:00:08
Dernière modification le : mercredi 20 décembre 2017 - 17:42:07

Identifiants

  • HAL Id : hal-01110843, version 1

Collections

Citation

Davy Landman, Alexander Serebrenik, Jurgen Vinju. Empirical analysis of the relationship between CC and SLOC in a large corpus of Java methods. Moonen, L. M. F. and Pollock, L. IEEE International Conference on Software Maintenance and Evolution 2014, Sep 2014, Victoria, Canada. IEEE Computer Society, pp.221 - 230, 2014. 〈hal-01110843〉

Partager

Métriques

Consultations de la notice

91