超越基于相似度的生成:利用问题-提交可追溯性指导提交消息生成
Beyond Similarity-Based Generation: Guiding Commit Message Generation with Issue-Commit Traceability
AI总结:
本文针对现有提交消息生成方法仅优化相似度的局限,提出协作多智能体框架TraceMsg,利用问题-提交可追溯性指导生成,在六个开源项目上实现Hit@1和MRR的显著提升。
摘要:
提交消息记录代码变更,帮助开发者理解和维护软件。为减少编写提交消息的人工工作量,提交消息生成(CMG)方法会自动生成用自然语言描述代码变更的提交消息。现有CMG方法通常将CMG视为独立任务,主要针对生成消息与开发者编写的参考消息的相似度进行优化,但该目标可能无法准确反映生成的提交消息的实际实用性,这一局限在当前AI辅助软件工程工作流中尤为突出——提交消息作为共享信息服务于不同软件工程活动。为填补该空白,本文提出TraceMsg,利用问题-提交可追溯性(一种典型的软件工程活动)指导提交消息生成。TraceMsg是一个协作多智能体框架,协调消息生成、可追溯性推理和反馈引导的优化,使生成的消息可服务于可追溯性,同时利用推理反馈指导基于问题的优化。本文在六个开源项目上评估TraceMsg,实验结果显示,TraceMsg的平均Hit@1为0.893,MRR为0.911,相较于各指标的最佳基线,Hit@1提升13.16%,MRR提升38.75%。
英文摘要:
Commit messages provide records of code changes and help developers understand and maintain software. To reduce the manual effort involved in writing them, commit message generation (CMG) approaches automatically generate commit messages that describe code changes in natural language. Existing CMG approaches generally treat CMG as a standalone task and optimize generated messages primarily for similarity to developer-written references. However, this objective may not properly reflect the practical usefulness of generated commit messages. This limitation matters in current AI-assisted software engineering workflows, where commit messages are used as shared information to serve different software engineering activities. To fill this gap, we propose TraceMsg, which uses issue-commit traceability, a representative software engineering activity, to guide commit message generation. TraceMsg is a collaborative multi-agent framework that coordinates message generation, traceability reasoning, and feedback-guided refinement, allowing generated messages to serve traceability while using reasoning feedback to guide issue-conditioned refinement. We evaluate TraceMsg on six open-source projects. The experimental results show that TraceMsg achieves an average Hit@1 of 0.893 and an MRR of 0.911, improving Hit@1 and MRR by 13.16% and 38.75%, respectively, over the best baseline for each metric.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。