Just-In-Time Defect Identification and Localization: A Two-Phase Framework

被引:52
作者
Yan, Meng [1 ,2 ,3 ]
Xia, Xin [4 ]
Fan, Yuanrui [2 ]
Hassan, Ahmed E. [5 ]
Lo, David [6 ]
Li, Shanping [2 ]
机构
[1] Chongqing Univ, Sch Big Data & Software Engn, Chongqing 400000, Peoples R China
[2] Zhejiang Univ, Coll Comp Sci & Technol, Hangzhou 310027, Zhejiang, Peoples R China
[3] PengCheng Lab, Shenzhe 518066, Guangdong, Peoples R China
[4] Monash Univ, Fac Informat Technol, Melbourne, Vic 3800, Australia
[5] Queens Univ, Sch Comp, Kingston, ON K7L 3N6, Canada
[6] Singapore Management Univ, Sch Informat Syst, Singapore 188065, Singapore
基金
中国博士后科学基金; 澳大利亚研究理事会;
关键词
Defect localization; just-in-time; defect identification; software naturalness; BUGS;
D O I
10.1109/TSE.2020.2978819
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Defect localization aims to locate buggy program elements (e.g., buggy files, methods or lines of code) based on defect symptoms, e.g., bug reports or program spectrum. However, when we receive the defect symptoms, the defect has been exposed and negative impacts have been introduced. Thus, one challenging task is: whether we can locate buggy program prior to the appearance of the defect symptom (e.g., when buggy program elements are being committed to a version control system). We refer to this type of defect localization as " Just-In-Time (JIT) Defect localization". Although many prior studies have proposed various JIT defect identification methods to identify whether a new change is buggy, these prior methods do not locate the suspicious positions. Thus, JIT defect localization is the next step of JIT defect identification (i.e., after a buggy change is identified, suspicious source code lines are located). To address this problem, we propose a two-phase framework, i.e., JIT defect identification and JIT defect localization. Given a new change, JIT defect identification will identify it as buggy change or clean change first. If a new change is identified as buggy, JIT defect localization will rank the source code lines introduced by the new change according to their suspiciousness scores. The source code lines ranked at the top of the list are estimated as the defect location. For JIT defect identification phase, we use 14 change-level features to build a classifier by following existing approach. For JIT defect localization phase, we propose a JIT defect localization approach that leverages software naturalness with the N-gram model. To evaluate the proposed framework, we conduct an empirical study on 14 open source projects with a total of 177,250 changes. The results show that software naturalness is effective for our JIT defect localization. Our model achieves a reasonable performance, and outperforms the two baselines (i.e., random guess and a static bug finder (i.e., PMD)) by a substantial margin in terms of four ranking measures.
引用
收藏
页码:82 / 101
页数:20
相关论文
共 67 条
[1]  
Abdi H., 2007, ENCY MEASUREMENT STA, P103, DOI [DOI 10.4135/9781412952644, 10.4135/9781412952644]
[2]   A practical evaluation of spectrum-based fault localization [J].
Abreu, Rui ;
Zoeteweij, Peter ;
Golsteijn, Rob ;
van Gemund, Arjan J. C. .
JOURNAL OF SYSTEMS AND SOFTWARE, 2009, 82 (11) :1780-1792
[3]   Learning Natural Coding Conventions [J].
Allamanis, Miltiadis ;
Barr, Earl T. ;
Bird, Christian ;
Sutton, Charles .
22ND ACM SIGSOFT INTERNATIONAL SYMPOSIUM ON THE FOUNDATIONS OF SOFTWARE ENGINEERING (FSE 2014), 2014, :281-293
[4]   Bug Localization with Combination of Deep Learning and Information Retrieval [J].
An Ngoc Lam ;
Anh Tuan Nguyen ;
Hoan Anh Nguyen ;
Nguyen, Tien N. .
2017 IEEE/ACM 25TH INTERNATIONAL CONFERENCE ON PROGRAM COMPREHENSION (ICPC), 2017, :218-229
[5]   Combining Deep Learning with Information Retrieval to Localize Buggy Files for Bug Reports [J].
An Ngoc Lam ;
Anh Tuan Nguyen ;
Hoan Anh Nguyen ;
Nguyen, Tien N. .
2015 30TH IEEE/ACM INTERNATIONAL CONFERENCE ON AUTOMATED SOFTWARE ENGINEERING (ASE), 2015, :476-481
[6]  
[Anonymous], 2008, Introduction to Information Retrieval
[7]  
[Anonymous], 2014, ORDINAL METHODS BEHA
[8]  
[Anonymous], 2005, ASE, DOI DOI 10.1145/1101908.1101949
[9]  
[Anonymous], 2005, ACM SIGSOFT SOFTW EN, DOI 10.1145/1083142.1083147
[10]  
Arong, 2014, PROCEEDINGS OF 2014 IEEE INTERNATIONAL CONFERENCE ON PROGRESS IN INFORMATICS AND COMPUTING (PIC), P51, DOI 10.1109/PIC.2014.6972294