LLM4SZZ:基于大型语言模型上下文增强评估的SZZ算法改进
LLM4SZZ: Enhancing SZZ Algorithm with Context-Enhanced Assessment on Large Language Models
AI总结:
针对SZZ算法在识别引发缺陷提交时依赖静态技术、忽略关键上下文及召回率受限的问题,提出基于大型语言模型的LLM4SZZ框架,通过基于排序和上下文增强两种识别策略,在三个数据集上将F1分数提升6.9%至16.0%。
摘要:
SZZ算法是识别引发缺陷提交的主导技术,也是许多软件工程研究(如缺陷预测和静态代码分析)的基础。自SZZ算法提出以来,研究人员提出了许多变体以提升其性能。大多数变体依赖静态技术或启发式假设,易于实现,但性能提升往往有限。最近,一种基于深度学习的SZZ算法被引入以增强原始SZZ算法。然而,它需要复杂的预处理,且仅限于单一编程语言。此外,虽然它提高了精确率,却牺牲了召回率。而且,大多数变体忽略了关键信息(如提交信息和补丁上下文),且仅限于涉及删除行的缺陷修复提交。大型语言模型(LLMs)的出现为解决这些缺陷提供了机会。在本研究中,我们探讨了LLMs的优势与局限,并提出LLM4SZZ,该方法采用两种策略(即基于排序的识别和上下文增强的识别)来处理不同类型的缺陷修复提交。我们根据LLM理解缺陷并识别提交中是否存在缺陷的能力来决定采用哪种策略。上下文增强识别为LLM提供更多上下文,并要求其在一组候选提交中找到引发缺陷的提交。在基于排序的识别中,我们要求LLM从缺陷修复提交中选择缺陷语句,并根据其与根本原因的相关性进行排序。实验结果表明,LLM4SZZ在三个数据集上均优于所有基线方法,在不显著牺牲召回率的情况下,将F1分数提高了6.9%至16.0%。
英文摘要:
The SZZ algorithm is the dominant technique for identifying bug-inducing commits and serves as a foundation for many software engineering studies, such as bug prediction and static code analysis. Researchers have proposed many variants to enhance the SZZ algorithm's performance since its introduction. The majority of them rely on static techniques or heuristic assumptions, making them easy to implement, but their performance improvements are often limited. Recently, a deep learning-based SZZ algorithm has been introduced to enhance the original SZZ algorithm. However, it requires complex preprocessing and is restricted to a single programming language. Additionally, while it enhances precision, it sacrifices recall. Furthermore, most of variants overlook crucial information, such as commit messages and patch context, and are limited to bug-fixing commits involving deleted lines. The emergence of large language models (LLMs) offers an opportunity to address these drawbacks. In this study, we investigate the strengths and limitations of LLMs and propose LLM4SZZ, which employs two approaches (i.e., rank-based identification and context-enhanced identification) to handle different types of bug-fixing commits. We determine which approach to adopt based on the LLM's ability to comprehend the bug and identify whether the bug is present in a commit. The context-enhanced identification provides the LLM with more context and requires it to find the bug-inducing commit among a set of candidate commits. In rank-based identification, we ask the LLM to select buggy statements from the bug-fixing commit and rank them based on their relevance to the root cause. Experimental results show that LLM4SZZ outperforms all baselines across three datasets, improving F1-score by 6.9% to 16.0% without significantly sacrificing recall.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。