一句话:提出重构感知的可追溯性模型,重建被重构打断的代码历史,从而显著提升基于历史的缺陷定位效果。
软件演化过程中会产生大量缺陷报告,而定位需要修改的源文件十分困难。基于信息检索的缺陷定位技术通过将缺陷报告与代码历史信息(如已解决的缺陷报告、提交日志)关联来进行定位,高效且易用,但它们几乎都忽略了一个问题:代码重构。重构在软件演化中很常见,但从版本控制系统的角度看,重构会打断代码历史,例如类被重命名后会被视为两个具有独立历史的不同类,从而影响所有依赖代码历史的技术。本文提出重构感知的可追溯性模型(RAT)来跟踪代码演化历史:通过分析代码重构的影响,将本已碎片化的历史正确地拼接起来,从而重建代码历史。为验证重构感知历史确实有益,作者研究了三种广泛采用、依赖代码历史的缺陷定位技术,并在 11 个开源项目上进行评估。结果表明,考虑代码重构能在不显著改动这些技术本身的前提下显著改善其缺陷定位结果;项目中使用的重构越多,收益越明显。作者认为,大量利用代码历史的现有工作都能从本工作中获益。
A large number of bug reports are created during the evolution of a software system. Locating the source code files that need to be changed in order to fix these bugs is a challenging task. Information retrieval-based bug localization techniques do so by correlating bug reports with historical information about the source code (e.g., previously resolved bug reports, commit logs). These techniques have shown to be efficient and easy to use. However, one flaw that is nearly omnipresent in all these techniques is that they ignore code refactorings. Code refactorings are common during software system evolution, but from the perspective of typical version control systems, they break the code history. For example, a class when renamed then appears as two separate classes with separate histories. Obviously, this is a problem that affects any technique that leverages code history. This paper proposes a refactoring-aware traceability model to keep track of the code evolution history. With this model, we reconstruct the code history by analyzing the impact of code refactorings to correctly stitch together what would otherwise be a fragmented history. To demonstrate that a refactoring aware history is indeed beneficial, we investigated three widely adopted bug localization techniques that make use of code history, which are important components in existing approaches. Our evaluation on 11 open source projects shows that taking code refactorings into account significantly improves the results of these bug localization techniques without significant changes to the techniques themselves. The more refactorings are used in a project, the stronger the benefit we observed. Based on our findings, we believe that much of the state of the art leveraging code history should benefit from our work.
@inproceedings{NiuAHMGLE23,
title = {RAT: A Refactoring-Aware Traceability Model for Bug Localization},
author = {Feifei Niu and Wesley K. G. Assunção and LiGuo Huang and Christoph Mayr-Dorn and Jidong Ge and Bin Luo and Alexander Egyed},
booktitle = {ICSE},
year = {2023},
doi = {10.1109/icse48619.2023.00028}
}