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

细粒度多文档提取与代码变更理由生成

Recovering Fine-Grained Code Change Rationale from Multiple Software Artifacts

William & Mary(威廉与玛丽学院)

Mehedi Sun, Antu Saha, Nadeeshan De Silva, Antonio Mastropaolo, Oscar Chaparro

AI总结:

本文研究如何从多个文档中提取代码变更理由,提出ARGUS方法,通过LLM生成简洁的变更理由摘要,提升代码理解和维护效率。

摘要:

理解过去代码变更的原因对于许多软件工程任务至关重要,包括重构、代码审查、诊断错误和实现新功能。然而,开发人员在定位和重建这些理由时面临困难,因为信息通常碎片化、文档不一致且分散在不同工件中。本文通过两个步骤解决这一挑战:首先,通过63个提交的实证研究分析了理由组件在不同工件中的分布;其次,引入ARGUS方法,通过LLM识别提交工件中的目标、需求和替代方案,并生成简洁的理由摘要。ARGUS在63个提交上进行了评估,其最佳版本在理由识别上达到51.4%的精确率和93.2%的召回率,并生成被用户认为有用的摘要,有助于代码审查、文档和调试等任务。

英文摘要:

Understanding the reasons behind past code changes is critical for refactoring, code review, and debugging. However, code change rationale is often fragmented, inconsistently documented, and scattered across heterogeneous artifacts. We address this challenge with two contributions. First, we conduct an empirical study of nine rationale components from an established taxonomy and trace where they are documented across artifacts associated with 63 commits from five widely used open-source Java projects. Seven components appear in practice, and rationale is highly fragmented: commit messages and pull requests primarily capture GOAL, while NEED and ALTERNATIVE are more often found in issues and pull requests. No single artifact type consistently captures all components, which presents the need for cross-document reasoning. Second, we introduce ARGUS, an LLM-based approach that identifies sentences expressing GOAL, NEED, and ALTERNATIVE across a commit's artifacts and synthesizes them into concise rationale summaries. ARGUS achieved 51.4% overall precision and 93.2% recall for rationale identification and generated summaries rated as accurate relative to reference summaries. Experiments across different LLMs showed varying identification performance but consistently accurate summaries. A user study with 12 Java programmers found these summaries useful for understanding unfamiliar code changes and supporting code review, documentation, debugging, and maintenance.

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

↑