现代代码审查是开源软件(OSS)开发中流行的拉请求开发范式中的一个关键和不可或缺的实践。因此,在有大量参与者的项目中找到合适的评审员成为一项越来越具有挑战性的任务。已经开发了许多评论者推荐方法(评论者)来支持这一任务,其应用类似的策略,即首先对评论历史建模,然后基于模型预测/推荐评论者。显然,模型越能反映评论历史的真实情况,我们期望的推荐器性能就越高。然而,拉取请求开发范例中的一个典型场景,即一个拉取请求(PR)(例如由贡献者提交的修订或添加)可能有多个审阅者,并且他们可能通过公开发布的评论相互影响,在现有的开发者中没有很好地建模。我们采用超图技术来建模这种高阶关系(即本文中的一个PR与多个评论者),并开发了一种新的推荐器,即HGRec,它被12个OSS项目评估,超过87 K PR,680 K评论在准确性和推荐分布方面。结果表明,HGRec在推荐准确性方面优于最先进的推荐器。此外,在前三名准确的评论者中,HGRec更有可能推荐多样性的评论者,这有助于缓解核心评论者的工作量拥挤问题。此外,由于HGRec基于超图,超图是对模型审查历史的自然和可解释的表示,因此很容易在现代代码审查场景中容纳更多类型的实体和现实关系。作为第一次尝试,本研究揭示了超图在推进代码评审推荐的实用解决方案方面的潜力。
英文摘要:
Modern code review is a critical and indispensable practice in a pull-request development paradigm that prevails in Open Source Software (OSS) development. Finding a suitable reviewer in projects with massive participants thus becomes an increasingly challenging task. Many reviewer recommendation approaches (recommenders) have been developed to support this task which apply a similar strategy, i.e. modeling the review history first then followed by predicting/recommending a reviewer based on the model. Apparently, the better the model reflects the reality in review history, the higher recommender's performance we may expect. However, one typical scenario in a pull-request development paradigm, i.e. one Pull-Request (PR) (such as a revision or addition submitted by a contributor) may have multiple reviewers and they may impact each other through publicly posted comments, has not been modeled well in existing recommenders. We adopted the hypergraph technique to model this high-order relationship (i.e. one PR with multiple reviewers herein) and developed a new recommender, namely HGRec, which is evaluated by 12 OSS projects with more than 87K PRs, 680K comments in terms of accuracy and recommendation distribution. The results indicate that HGRec outperforms the state-of-the-art recommenders on recommendation accuracy. Besides, among the top three accurate recommenders, HGRec is more likely to recommend a diversity of reviewers, which can help to relieve the core reviewers' workload congestion issue. Moreover, since HGRec is based on hypergraph, which is a natural and interpretable representation to model review history, it is easy to accommodate more types of entities and realistic relationships in modern code review scenarios. As the first attempt, this study reveals the potentials of hypergraph on advancing the pragmatic solutions for code reviewer recommendation.
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(计算机科学学院,武汉大学)