arXiv:2410.21673cs.SEcs.AI2024-10中稿 · publication in ACM…综述

用知识引导提示学习提升代码审查请求质量,让开发者更易获得有效回应。

Knowledge-Guided Prompt Learning for Request Quality Assurance in Public Code Review

  • 通过硬提示和软提示融合,将请求必要性判断与标签推荐转为掩码语言模型任务。
  • 在2011-2023年数据集上,必要性预测提升2.3%-8.4%,标签推荐提升1.4%-6.9%。
  • 适合关注代码审查效率、开源协作优化的研究者与开发者使用。

公开代码审查(PCR)在软件问答社区中被用于帮助开发者获取高质量、高效的审查服务。现有方法主要从评审者视角出发,包括寻找合适评审人、预测评论质量以及生成或推荐审查意见。然而,如何满足开发者发布的审查需求以提升其可见性,进而促进更好响应的问题尚未充分研究。为此,我们提出知识引导的提示学习框架KP-PCR,实现基于开发者的代码审查请求质量保障,即请求必要性预测与标签推荐两个子任务。具体地,我们通过文本提示调优将两个任务重构为掩码语言模型任务,利用硬提示构造提示模板;同时引入经微调大模型的知识引导(软提示),并借助程序依赖图刻画代码片段。最终通过答案工程模块输出预测结果。此外,我们分析了基于轻量前缀的知识引入操作的时间复杂度。在2011-2023年间的PCR数据集上的实验表明,我们的方法在请求必要性预测上优于基线2.3%-8.4%,在标签推荐上提升1.4%-6.9%。代码已开源至https://github.com/WUT-IDEA/KP-PCR。

原文摘要 · Abstract (English)

Public Code Review (PCR) is developed in the Software Question Answering (SQA) community, assisting developers in exploring high-quality and efficient review services. Current methods on PCR mainly focus on the reviewer's perspective, including finding a capable reviewer, predicting comment quality, and recommending/generating review comments. However, it is not well studied that how to satisfy the review necessity requests posted by developers which can increase their visibility, which in turn acts as a prerequisite for better review responses. To this end, we propose K nowledge-guided P rompt learning for P ublic Code Review (KP-PCR) to achieve developer-based code review request quality assurance (i.e., predicting request necessity and recommending tags subtask). Specifically, we reformulate the two subtasks via 1) text prompt tuning which converts both of them into a Masked Language Model (MLM) by constructing prompt templates using hard prompt; and 2) knowledge and code prefix tuning which introduces knowledge guidance from fine-tuned large language models by soft prompt, and uses program dependence graph to characterize code snippets. Finally, both of the request necessity prediction and tag recommendation subtasks output predicted results through an answer engineering module. In addition, we further analysis the time complexity of our KP-PCR that has lightweight prefix based the operation of introducing knowledge guidance. Experimental results on the PCR dataset for the period 2011-2023 demonstrate that our KP-PCR outperforms baselines by 2.3%-8.4% in the request necessity prediction and by 1.4%-6.9% in the tag recommendation. The code implementation is released at https://github.com/WUT-IDEA/KP-PCR

代码审查提示学习知识引导软件工程

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。