z-logo
Premium
Empirical study of abnormality in local variables and its application to fault‐prone Java method analysis
Author(s) -
Aman Hirohisa,
Amasaki Sousuke,
Yokogawa Tomoyuki,
Kawahara Minoru
Publication year - 2020
Publication title -
journal of software: evolution and process
Language(s) - English
Resource type - Journals
SCImago Journal Rank - 0.371
H-Index - 29
eISSN - 2047-7481
pISSN - 2047-7473
DOI - 10.1002/smr.2220
Subject(s) - abnormality , computer science , java , variable (mathematics) , variables , mahalanobis distance , coding (social sciences) , empirical research , statistics , artificial intelligence , machine learning , mathematics , psychology , programming language , social psychology , mathematical analysis
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.

This content is not available in your region!

Continue researching here.

Having issues? You can contact us here