Empirical study of abnormality in local variables and its application to fault-prone Java']Java method analysis

被引:1
作者
Aman, Hirohisa [1 ]
Amasaki, Sousuke [2 ]
Yokogawa, Tomoyuki [2 ]
Kawahara, Minoru [1 ]
机构
[1] Ehime Univ, Ctr Informat Technol, Matsuyama, Ehime, Japan
[2] Okayama Prefectural Univ, Fac Comp Sci & Syst Engn, Okayama, Japan
基金
日本学术振兴会;
关键词
abnormality; fault-prone method analysis; local variable; Mahalanobis distance; naming; scope; SOFTWARE; PREDICTION;
D O I
10.1002/smr.2220
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Programmers are familiar with local variables, and in many cases, they can freely define the local variables they use. Thus, the properties of these variables are widely diverse, and this may cause variations in the quality of code. Although variables are named in accordance with coding conventions, the following matters have not received much attention from an empirical viewpoint: automatically deciding whether a local variable is "abnormal" and determining the harmful effect of an abnormal variable. This study focuses on the trends in the name, type, and scope of local variables, then proposes the use of the Mahalanobis distance to evaluate their abnormality. The empirical study entailed collecting local variables from eight open-source software projects, and the paper reports the following findings: (a) the trend in the variation of the names of variables according to their type; (b) the majority of variables have short names with narrow scopes, where a name is often a word or an abbreviation thereof; (c) methods with an abnormal variable are approximately 1.4 times more likely to be fault prone than methods that contain only normal variables; (d) the proposed abnormality metric can be useful in a random forest-based fault-prone method analysis model.
引用
收藏
页数:24
相关论文
共 45 条
[1]  
Aman H, 2016, JOINT P 4 INT WORKSH, P4
[2]  
Aman H, 2015, INT SYMP EMP SOFTWAR, P50
[3]  
[Anonymous], 2003, Refactoring Workbook
[4]  
Binkley D, 2013, IEEE WORK CONF MIN S, P401, DOI 10.1109/MSR.2013.6624055
[5]   Identifier length and limited programmer memory [J].
Binkley, Dave ;
Lawrie, Dawn ;
Maex, Steve ;
Morrell, Christopher .
SCIENCE OF COMPUTER PROGRAMMING, 2009, 74 (07) :430-445
[6]  
Boswell D., 2011, ART READABLE CODE
[7]   Random forests [J].
Breiman, L .
MACHINE LEARNING, 2001, 45 (01) :5-32
[8]   A family of experiments to assess the effectiveness and efficiency of source code obfuscation techniques [J].
Ceccato, Mariano ;
Di Penta, Massimiliano ;
Falcarin, Paolo ;
Ricca, Filippo ;
Torchiano, Marco ;
Tonella, Paolo .
EMPIRICAL SOFTWARE ENGINEERING, 2014, 19 (04) :1040-1074
[9]  
Cudney E.A., 2009, Journal of Industrial and Systems Engineering, V2, P250
[10]   A Framework for Evaluating the Results of the SZZ Approach for Identifying Bug-Introducing Changes [J].
da Costa, Daniel Alencar ;
McIntosh, Shane ;
Shang, Weiyi ;
Kulesza, Uira ;
Coelho, Roberta ;
Hassan, Ahmed E. .
IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 2017, 43 (07) :641-657