Automatic metric thresholds derivation for code smell detection

被引:51
作者
Fontana, Francesca Arcelli [1 ]
Ferme, Vincenzo [2 ]
Zanoni, Marco [1 ]
Yamashita, Aiko [3 ]
机构
[1] Univ Milano Bicocca, Dept Informat Syst & Commun, Milan, Italy
[2] Univ Lugano USI, Fac Informat, Lugano, Switzerland
[3] Mesan AS, Oslo, Norway
来源
PROCEEDINGS SIXTH INTERNATIONAL WORKSHOP ON EMERGING TRENDS IN SOFTWARE METRICS WETSOM 2015 | 2015年
关键词
D O I
10.1109/WETSoM.2015.14
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
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.
引用
收藏
页码:44 / 53
页数:10
相关论文
共 35 条
[1]  
ALVES TL, 2010, P 2010 IEEE INT C SO, P1
[2]  
[Anonymous], 2014, SOFTWARE METRICS RIG
[3]  
[Anonymous], APSEC 10
[4]  
[Anonymous], THESIS
[5]   Standardized code quality benchmarking for improving software maintainability [J].
Baggen, Robert ;
Correia, Jose Pedro ;
Schill, Katrin ;
Visser, Joost .
SOFTWARE QUALITY JOURNAL, 2012, 20 (02) :287-307
[6]   Thresholds for object-oriented measures [J].
Benlarbi, S ;
El Emam, K ;
Goel, N ;
Rai, S .
11TH INTERNATIONAL SYMPOSIUM ON SOFTWARE RELIABILITY ENGINEERING, PROCEEDINGS, 2000, :24-37
[7]   A METRICS SUITE FOR OBJECT-ORIENTED DESIGN [J].
CHIDAMBER, SR ;
KEMERER, CF .
IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 1994, 20 (06) :476-493
[8]   THE APPLICATION OF SOFTWARE MAINTAINABILITY MODELS IN INDUSTRIAL SOFTWARE SYSTEMS [J].
COLEMAN, D ;
LOWTHER, B ;
OMAN, P .
JOURNAL OF SYSTEMS AND SOFTWARE, 1995, 29 (01) :3-16
[9]   Feature location using probabilistic ranking of methods based on execution scenarios and information retrieval [J].
Poshyvanyk, Denys ;
Gueheneuc, Yann-Gael ;
Marcus, Andrian ;
Antoniol, Giuliano ;
Rajlich, Vaclav .
IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 2007, 33 (06) :420-432
[10]  
Couto C., 2013, SOFTWARE ENG NOTES, V38, P1, DOI DOI 10.1145/2413038.2413047