Litcius/Paper detail

Deep Just-In-Time Defect Localization

Fangcheng Qiu, Zhipeng Gao, Xin Xia, David Lo, John Grundy, Xinyu Wang

2021IEEE Transactions on Software Engineering16 citationsDOIOpen Access PDF

Abstract

During software development and maintenance, defect localization is an essential part of software quality assurance. Even though different techniques have been proposed for defect localization, i.e., information retrieval (IR)-based techniques and spectrum-based techniques, they can only work after the defect has been exposed, which can be too late and costly to adapt to the newly introduced bugs in the daily development. To assist developers to detect bugs in time and avoid introducing them, just-in-time (JIT) bug localization techniques have been proposed, which is targeting to locate suspicious buggy code after a change commit has been submitted. In this paper, we propose a novel JIT defect localization approach, named DeepDL (Deep Learning-based defect localization), to locate defect code lines within a defect introducing change. DeepDL employs a neural language model to capture the semantics of the code lines, in this way, the naturalness of each code line can be learned and converted to a suspiciousness score. The core of our DeepDL is a deep learning-based neural language model. We train the neural language model with previous snapshots (history versions) of a project so that it can calculate the naturalness of a piece of code. In its application, for a given new code change, DeepDL automatically assigns a suspiciousness score to each code line and sorts these code lines in descending order of this score. The code lines at the top of the list are considered as potential defect locations. Our tool can assist developers efciently check buggy lines at an early stage, which is able to reduce the risk of introducing bugs in time and improve the developers condence in the reliability of their software. We conducted an extensive experiment on 14 open source Java projects with a total of 11,615 buggy changes. We evaluate the experimental results considering four evaluation metrics. The experimental results show that our method outperforms the state-of-the-art by a substantial margin.

Topics & Concepts

Computer scienceNaturalnessSource lines of codeCode (set theory)Artificial intelligenceDeep learningCommitProgramming languageSoftware qualitySoftwareSoftware bugArtificial neural networkNatural language processingSoftware developmentMachine learningDatabasePhysicsQuantum mechanicsSet (abstract data type)Software Engineering ResearchSoftware Reliability and Analysis ResearchSoftware System Performance and Reliability