Automatic Metric Thresholds Derivation for Code Smell Detection
- 1 May 2015
- conference paper
- Published by Institute of Electrical and Electronics Engineers (IEEE)
- No. 23270950,p. 44-53
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
This publication has 24 references indexed in Scilit:
- COMETSACM SIGSOFT Software Engineering Notes, 2013
- Identifying thresholds for object-oriented software metricsJournal of Systems and Software, 2012
- Automatic detection of bad smells in code: An experimental assessment.The Journal of Object Technology, 2012
- Calculation and optimization of thresholds for sets of software metricsEmpirical Software Engineering, 2011
- Standardized code quality benchmarking for improving software maintainabilitySoftware Quality Journal, 2011
- Power laws in softwareACM Transactions on Software Engineering and Methodology, 2008
- Sample Quantiles in Statistical PackagesThe American Statistician, 1996
- The application of software maintainability models in industrial software systemsJournal of Systems and Software, 1995
- A metrics suite for object oriented designIEEE Transactions on Software Engineering, 1994
- NPATH: a measure of execution path complexity and its applicationsCommunications of the ACM, 1988