arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2309.03044cs.SE
收藏

使用源代码度量和LLM的方法级缺陷严重性预测

Method-Level Bug Severity Prediction using Source Code Metrics and LLMs

Ehsan Mashhadi, Hossein Ahmadvand, Hadi Hemmati

AI总结:

本研究利用源代码度量和CodeBERT大语言模型,提出方法级缺陷严重性预测方法,显著提升预测效果,并集成两种架构进一步增强模型性能。

摘要:

在过去的几十年里,大量的研究工作致力于软件缺陷的预测。然而,该领域的大多数现有工作将所有缺陷视为相同,这在实践中并非如此。缺陷预测方法需要估计已识别缺陷的严重性,以便高严重性的缺陷得到立即关注。在本研究中,我们调查了源代码度量、使用大语言模型(LLMs)的源代码表示,以及它们在预测两个著名数据集的缺陷严重性标签中的组合。我们利用方法级粒度的多种源代码度量来训练八个不同的机器学习模型。我们的结果表明,决策树和随机森林模型在我们的多个评估指标上优于其他模型。然后,我们使用预训练的CodeBERT LLM来研究源代码表示在预测缺陷严重性方面的有效性。与基于源代码度量的最佳经典预测模型相比,CodeBERT微调在多个评估指标上将缺陷严重性预测结果显著提高了29%-140%。最后,我们将源代码度量作为额外输入集成到CodeBERT中,使用我们提出的两种架构,这两种架构都增强了CodeBERT模型的有效性。

英文摘要:

In the past couple of decades, significant research efforts are devoted to the prediction of software bugs. However, most existing work in this domain treats all bugs the same, which is not the case in practice. It is important for a defect prediction method to estimate the severity of the identified bugs so that the higher-severity ones get immediate attention. In this study, we investigate source code metrics, source code representation using large language models (LLMs), and their combination in predicting bug severity labels of two prominent datasets. We leverage several source metrics at method-level granularity to train eight different machine-learning models. Our results suggest that Decision Tree and Random Forest models outperform other models regarding our several evaluation metrics. We then use the pre-trained CodeBERT LLM to study the source code representations' effectiveness in predicting bug severity. CodeBERT finetuning improves the bug severity prediction results significantly in the range of 29%-140% for several evaluation metrics, compared to the best classic prediction model on source code metric. Finally, we integrate source code metrics into CodeBERT as an additional input, using our two proposed architectures, which both enhance the CodeBERT model effectiveness.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑