The impact of context metrics on just-in-time defect prediction

被引:43
作者
Kondo, Masanari [1 ]
German, Daniel M. [2 ]
Mizuno, Osamu [1 ]
Choi, Eun-Hye [3 ]
机构
[1] Kyoto Inst Technol, Software Engn Lab, Kyoto, Japan
[2] Univ Victoria, Dept Comp Sci, Victoria, BC, Canada
[3] Informat Technol Res Inst, Natl Inst Adv Ind Sci, Technol, Sapporo, Japan
基金
加拿大自然科学与工程研究理事会; 日本学术振兴会;
关键词
Just-in-time defect prediction; Defect prediction; Source code changes; Context lines; Changed lines; Indentation metrics; Code churn metrics; SOFTWARE CHANGES; CODE CHURN; COMPLEXITY; FAULTS;
D O I
10.1007/s10664-019-09736-3
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Traditional just-in-time defect prediction approaches have been using changed lines of software to predict defective-changes in software development. However, they disregard information around the changed lines. Our main hypothesis is that such information has an impact on the likelihood that the change is defective. To take advantage of this information in defect prediction, we consider n-lines (n = 1,2, horizontal ellipsis ) that precede and follow the changed lines (which we call context lines), and propose metrics that measure them, which we call "Context Metrics." Specifically, these context metrics are defined as the number of words/keywords in the context lines. In a large-scale empirical study using six open source software projects, we compare the performance of using our context metrics, traditional code churn metrics (e.g., the number of modified subsystems), our extended context metrics which measure not only context lines but also changed lines, and combination metrics that use two extended context metrics at a prediction model for defect prediction. The results show that context metrics that consider the context lines of added-lines achieve the best median value in all cases in terms of a statistical test. Moreover, using few number of context lines is suitable for context metric that considers words, and using more number of context lines is suitable for context metric that considers keywords. Finally, the combination metrics of two extended context metrics significantly outperform all studied metrics in all studied projects w. r. t. the area under the receiver operation characteristic curve (AUC) and Matthews correlation coefficient (MCC).
引用
收藏
页码:890 / 939
页数:50
相关论文
共 64 条
[1]  
[Anonymous], 2004, ACM SIGSOFT Softw Eng Notes, DOI DOI 10.1145/1013886.1007524
[2]  
[Anonymous], Fear of Corona Outnumbers Fear of God?
[3]  
[Anonymous], 2007, Third International Workshop on Predictor Models in Software Engineering (PROMISE'07: ICSE Workshops 2007)
[4]  
[Anonymous], 2006, Proceedings of the 2006 International Workshop on Mining Software Repositories. MSR '06
[5]  
Aversano L., 2007, Proceedings of the Foundations of Software Engineering, P19
[6]   A validation of object-oriented design metrics as quality indicators [J].
Basili, VR ;
Briand, LC ;
Melo, WL .
IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 1996, 22 (10) :751-761
[7]  
Bettenburg N., 2012, 2012 9th IEEE Working Conference on Mining Software Repositories (MSR 2012), P60, DOI 10.1109/MSR.2012.6224300
[8]   Optimal classifier for imbalanced data using Matthews Correlation Coefficient metric [J].
Boughorbel, Sabri ;
Jarray, Fethi ;
El-Anbari, Mohammed .
PLOS ONE, 2017, 12 (06)
[9]  
Bowes D., 2012, Proceedings of the 8th International Conference on Predictive Models in Software Engineering, P109, DOI [DOI 10.1145/2365324.2365338, 10.1145/2365324.2365338]
[10]   Ten quick tips for machine learning in computational biology [J].
Chicco, Davide .
BIODATA MINING, 2017, 10