Modeling Review History for Reviewer Recommendation:A Hypergraph Approach

Guoping Rong, Yifan Zhang, Lanxin Yang, Fuli Zhang, Hongyu Kuang, He Zhang · DOI

Abstract

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.

Introduction

Modern Code Review (MCR) is the backbone of open-source software (OSS) development, yet finding the right person to review a specific pull request (PR) is a major bottleneck. If a PR is assigned to an unsuitable reviewer, it can sit idle for weeks; conversely, if it is consistently assigned to the same "core" maintainers, they suffer from workload congestion and burnout.

Existing recommendation tools generally fall into three categories: simple heuristics (e.g., "who touched this file last?"), machine learning classifiers, or standard graph models. However, these models often fail to reflect the reality of collaborative review. In a typical PR, multiple reviewers interact through public comments, influencing each other’s expertise and familiarity with the code. Standard graphs only model pairwise relationships, losing the context of group dynamics.

Methodology: The HGRec Approach

To address these limitations, this paper introduces HGRec, a novel reviewer recommendation system that uses hypergraphs to model complex, multi-party interactions. Unlike an ordinary graph where an edge connects exactly two nodes, a hyperedge can connect any number of vertices, preserving "high-order" relationships.

The HGRec workflow: from repository data to hypergraph construction and reviewer recommendation.

Hypergraph Construction and Weighting

The HGRec model represents review history as a hypergraph where vertices represent Pull Requests (PRs), Contributors, and Reviewers. Hyperedges represent the relationships between these entities. For instance, a single hyperedge connects a PR to all reviewers who commented on it.

The "strength" of these connections is weighted based on several factors:

  • PR-Reviewer: Determined by the frequency and recency of comments.
  • PR-Contributor: Based on the recency of the contributor's PR submission.
  • PR-PR: Calculated using file path similarity (Longest Common Prefix) and temporal distance.

Recommendation via Ranking

When a new PR arrives, it is temporarily integrated into the hypergraph. The system then performs a ranking task to identify which reviewer vertices are most "reachable" or relevant to the new PR vertex, effectively finding the best matches based on the entire historical web of interactions.

Experimental Evaluation

The authors evaluated HGRec using a massive dataset from 12 prominent GitHub OSS projects, spanning from January 2017 to June 2020.

Statistics of the 12 OSS projects used for evaluation, totaling over 87,000 PRs.

The evaluation employed a time-series strategy, training the model on 12 months of data and testing on the subsequent month, sliding this window 30 times to ensure robust results.

Key Results

  • Superior Accuracy: HGRec outperformed state-of-the-art baselines (such as AC, RevFinder, and EARec) in terms of Accuracy (ACC) and Mean Reciprocal Rank (MRR), leading in 8 out of 12 projects for Top-1 accuracy.
  • Workload Distribution: Most recommenders are "greedy," favoring active core reviewers. HGRec includes tuning parameters ($\alpha$ and $\lambda$) to optimize the Recommendation Distribution (RD). In the 'angular' project, while a Random Forest baseline assigned 77 PRs to one core reviewer in a month, HGRec recommended that same reviewer for only 39 PRs, distributing the load to other qualified candidates.
  • Interpretability: As a direct mapping of entities and interactions, the hypergraph provides a more natural and interpretable representation than "black box" deep learning models.

Conclusion and Future Work

HGRec demonstrates that modeling high-order relationships in code reviews significantly improves recommendation accuracy and workload balance. By preserving group context, the system identifies qualified reviewers who might otherwise be overlooked.

Future work includes refining hyperedge weights by distinguishing between different types of comments (e.g., deep architectural critiques vs. simple "LGTM") using Natural Language Processing (NLP). Additionally, the authors suggest incorporating organizational relationships to further enhance the model's realism and performance.

Summary updated

BibTeX
@inproceedings{rong2022modeling,
  author = {Guoping Rong and Yifan Zhang and Lanxin Yang and Fuli Zhang and Hongyu Kuang and He Zhang},
  title = {{Modeling Review History for Reviewer Recommendation:A Hypergraph Approach}},
  booktitle = {Proceedings of the 44th International Conference on Software Engineering},
  year = {2022},
  doi = {10.1145/3510003.3510213},
}
Figure