Title :
Automatic Metric Thresholds Derivation for Code Smell Detection
Author :
Fontana, Francesca Arcelli ; Ferme, Vincenzo ; Zanoni, Marco ; Yamashita, Aiko
Author_Institution :
Dept. of Inf., Syst. & Commun., Univ. of Milano-Bicocca, Milan, Italy
Abstract :
Code smells are archetypes of design shortcomings in the code that can potentially cause problems during maintenance. One known approach for detecting code smells is via detection rules: a combination of different object-oriented metrics with pre-defined threshold values. The usage of inadequate thresholds when using this approach could lead to either having too few observations (too many false negatives) or too many observations (too many false positives). Furthermore, without a clear methodology for deriving thresholds, one is left with those suggested in literature (or by the tool vendors), which may not necessarily be suitable to the context of analysis. In this paper, we propose a data-driven (i.e., Benchmark-based) method to derive threshold values for code metrics, which can be used for implementing detection rules for code smells. Our method is transparent, repeatable and enables the extraction of thresholds that respect the statistical properties of the metric in question (such as scale and distribution). Thus, our approach enables the calibration of code smell detection rules by selecting relevant systems as benchmark data. To illustrate our approach, we generated a benchmark dataset based on 74 systems of the Qualitas Corpus, and extracted the thresholds for five smell detection rules.
Keywords :
software maintenance; software metrics; Qualitas Corpus; automatic metric threshold derivation; benchmark dataset; benchmark-based method; code metrics; code smell detection rules; data-driven method; false negatives; false positives; object-oriented metrics; software maintenance; statistical properties; threshold extraction; threshold values; Benchmark testing; Complexity theory; Context; Couplings; Electronic mail; Measurement; Surgery; Benchmark dataset; Code smell detection; Metric thresholds;
Conference_Titel :
Emerging Trends in Software Metrics (WETSoM), 2015 IEEE/ACM 6th International Workshop on
Conference_Location :
Florence
DOI :
10.1109/WETSoM.2015.14