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. Instead, they use different metrics in the training and testing phases, which can negatively impact the model performance in retrieval tasks. In this paper, we propose RLocator, a Reinforcement Learning-based (RL) bug localization approach. We formulate the bug localization problem 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. Our evaluation shows that RLocator achieves up to a Mean Reciprocal Rank (MRR) of 0.62 and a Mean Average Precision (MAP) of 0.59. Our results demonstrate that directly optimizing evaluation measures considerably contributes to performance improvement of the bug localization problem.
翻译:软件开发人员将大量时间用于修复项目中的缺陷。为优化这一过程,研究者提出了多种缺陷定位方法,旨在识别导致特定缺陷的源代码文件。此前的工作提出了多种基于相似度的机器学习技术用于缺陷定位。尽管这些技术取得了显著进展,但它们并未直接优化评估指标,而是在训练和测试阶段使用不同的度量标准,这会降低检索任务中模型的性能。本文提出RLocator——一种基于强化学习的缺陷定位方法。我们通过马尔可夫决策过程对缺陷定位问题进行建模,以直接优化评估指标。我们详细阐述了该技术,并基于包含来自六个高流行度Apache项目的8,316份缺陷报告的标准数据集进行了实验评估。评估结果显示,RLocator的平均倒数排名达到0.62,平均精度均值达到0.59。实验结果表明,直接优化评估指标显著提升了缺陷定位问题的性能表现。