Software developers spend a significant portion of time fixing bugs in their projects. To streamline this process, bug localization approaches have been proposed to identify the source code files that are likely responsible for a particular bug. Prior work proposed several similarity-based machine-learning techniques for bug localization. Despite significant advances in these techniques, they do not directly optimize the evaluation measures. We argue that directly optimizing evaluation measures can positively contribute to the performance of bug localization approaches. Therefore, In this paper, we utilize Reinforcement Learning (RL) techniques to directly optimize the ranking metrics. We propose RLocator, a Reinforcement Learning-based bug localization approach. We formulate RLocator using a Markov Decision Process (MDP) to optimize the evaluation measures directly. We present the technique and experimentally evaluate it based on a benchmark dataset of 8,316 bug reports from six highly popular Apache projects. The results of our evaluation reveal that RLocator achieves a Mean Reciprocal Rank (MRR) of 0.62, a Mean Average Precision (MAP) of 0.59, and a Top 1 score of 0.46. We compare RLocator with two state-of-the-art bug localization tools, FLIM and BugLocator. Our evaluation reveals that RLocator outperforms both approaches by a substantial margin, with improvements of 38.3% in MAP, 36.73% in MRR, and 23.68% in the Top K metric. These findings highlight that directly optimizing evaluation measures considerably contributes to performance improvement of the bug localization problem.
翻译:软件开发人员花费大量时间修复项目中的缺陷。为简化这一过程,研究人员提出了缺陷定位方法,用于识别与特定缺陷最可能相关的源代码文件。已有工作提出了多种基于相似度的机器学习缺陷定位技术。尽管这些技术取得了显著进展,但它们并未直接优化评估指标。我们认为,直接优化评估指标对提升缺陷定位方法的性能具有积极作用。因此,本文利用强化学习技术直接优化排序指标,提出了一种基于强化学习的缺陷定位方法RLocator。我们将RLocator构建为马尔可夫决策过程以直接优化评估指标,并基于包含来自六个热门Apache项目的8316份缺陷报告的标准数据集进行了实验评估。评估结果显示,RLocator的平均倒数排名为0.62,平均精度均值为0.59,Top1得分为0.46。与两种最新缺陷定位工具FLIM和BugLocator的对比表明,RLocator在MAP、MRR和Top K指标上分别提升38.3%、36.73%和23.68%,显著优于上述方法。这些发现表明,直接优化评估指标对提升缺陷定位问题性能具有重要贡献。