Code review is a common practice in software development and often conducted before code changes are merged into the code repository. A number of approaches for automatically recommending appropriate reviewers have been proposed to match such code changes to pertinent reviewers. However, such approaches are generic, i.e., they do not focus on specific types of issues during code reviews. In this paper, we propose an approach that focuses on architecture violations, one of the most critical type of issues identified during code review. Specifically, we aim at automating the recommendation of code reviewers, who are potentially qualified to review architecture violations, based on reviews of code changes. To this end, we selected three common similarity detection methods to measure the file path similarity of code commits and the semantic similarity of review comments. We conducted a series of experiments on finding the appropriate reviewers through evaluating and comparing these similarity detection methods in separate and combined ways with the baseline reviewer recommendation approach, RevFinder. The results show that the common similarity detection methods can produce acceptable performance scores and achieve a better performance than RevFinder. The sampling techniques used in recommending code reviewers can impact the performance of reviewer recommendation approaches. We also discuss the potential implications of our findings for both researchers and practitioners.
Modeling Review History for Reviewer Recommendation:A Hypergraph Approach
现代代码审查是开源软件(OSS)开发中流行的拉请求开发范式中的一个关键和不可或缺的实践。因此,在有大量参与者的项目中找到合适的评审员成为一项越来越具有挑战性的任务。已经开发了许多评论者推荐方法(评论者)来支持这一任务,其应用类似的策略,即首先对评论历史建模,然后基于模型预测/推荐评论者。显然,模型越能反映评论历史的真实情况,我们期望的推荐器性能就越高。然而,拉取请求开发范例中的一个典型场景,即一个拉取请求(PR)(例如由贡献者提交的修订或添加)可能有多个审阅者,并且他们可能通过公开发布的评论相互影响,在现有的开发者中没有很好地建模。我们采用超图技术来建模这种高阶关系(即本文中的一个PR与多个评论者),并开发了一种新的推荐器,即HGRec,它被12个OSS项目评估,超过87 K PR,680 K评论在准确性和推荐分布方面。结果表明,HGRec在推荐准确性方面优于最先进的推荐器。此外,在前三名准确的评论者中,HGRec更有可能推荐多样性的评论者,这有助于缓解核心评论者的工作量拥挤问题。此外,由于HGRec基于超图,超图是对模型审查历史的自然和可解释的表示,因此很容易在现代代码审查场景中容纳更多类型的实体和现实关系。作为第一次尝试,本研究揭示了超图在推进代码评审推荐的实用解决方案方面的潜力。
RACK: Automatic API Recommendation using Crowdsourced Knowledge
传统的代码搜索引擎通常不能很好地执行自然语言查询,因为它们主要应用关键字匹配。因此,这些引擎需要精心设计的查询,其中包含有关代码搜索编程API的信息。不幸的是,现有的研究表明,准备一个有效的代码搜索查询是既具有挑战性和耗时的开发人员。在本文中,我们提出了一种新的API推荐技术--RACK,它通过利用Stack Overflow的众包知识中的关键字-API关联,为代码搜索的自然语言查询推荐相关API列表。我们首先使用11个核心Java包和来自Stack Overflow的344 K Java帖子进行探索性研究来激励我们的技术。使用150个代码搜索查询随机选择的三个Java教程网站的实验表明,我们的技术建议正确的API类的前10名的结果约79%的查询,这是非常有前途的。与最先进技术的两个变体的比较还表明,RACK不仅在Top-K准确率方面,而且在平均平均精确率和平均召回率方面都大大优于它们。
Knowledge-Guided Prompt Learning for Request Quality Assurance in Public Code Review
School of Computer Science(计算机科学学院);Artificial Intelligence, Wuhan University of Technology(人工智能,武汉理工大学);China Mobile Design Institute Co., Ltd.(中国移动设计研究院有限公司);School of Computer Science, Wuhan University(计算机科学学院,武汉大学)