TL;DR
This paper introduces HGRec, a novel reviewer recommendation system that uses hypergraphs to model the complex, multi-party interactions inherent in modern code reviews. By capturing "high-order" relationships—such as multiple reviewers collaborating on a single pull request (PR)—HGRec achieves higher recommendation accuracy than state-of-the-art methods while more effectively balancing the workload across a diverse pool of reviewers.
What Problem Does This Paper Address?
Modern Code Review (MCR) is the backbone of open-source software (OSS) development, yet finding the right person to review a specific pull request is a major bottleneck. If a PR is assigned to the wrong person, it can sit idle for weeks; if it's always assigned to the same "core" maintainers, they suffer from workload congestion and burnout.
Existing recommendation tools generally fall into three camps: simple heuristics (e.g., "who touched this file last?"), machine learning classifiers, or standard graph models. The authors argue that these models fail because they don't reflect reality. 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 (Reviewer A and Reviewer B both saw PR1), which loses the context of the group dynamic.
Methods
The authors propose a Hypergraph approach. Unlike an ordinary graph where an edge connects exactly two nodes, a hyperedge can connect any number of vertices.
1. Hypergraph Construction
The model represents the review history as a hypergraph where:
- Vertices represent three types of entities: Pull Requests (PRs), Contributors, and Reviewers.
- Hyperedges represent relationships. For example, one hyperedge connects a PR to all the reviewers who commented on it.
2. Weighting the Relationships
The "strength" of these connections isn't uniform. HGRec calculates weights based on:
- PR-Reviewer: Based on the frequency and recency of comments. More recent interactions carry more weight.
- PR-Contributor: Based on how recently the contributor submitted the PR.
- PR-PR: Based on file path similarity (using the Longest Common Prefix) and temporal distance. If two PRs modify similar files at similar times, they are closely linked.
3. Recommendation via Ranking
When a new PR arrives, it is temporarily added to the hypergraph. The system then performs a "search and ranking" task. It calculates a ranking vector ($f^*$) that identifies 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.
Datasets
The authors evaluated HGRec using a massive dataset from 12 well-known GitHub OSS projects, including:
- Large-scale projects: Angular, Rails, Bitcoin, and Scikit-learn.
- Diverse ecosystems: Akka, Django, Symfony, and others.
- Scale: The dataset spans from Jan 2017 to June 2020, encompassing over 87,000 PRs and 680,000 comments.
The evaluation used a "time-series" strategy: they trained the model on 12 months of data and then tested it on the subsequent month, sliding this window 30 times to ensure the results were robust over time.
Key Insights and Ideas
- High-Order Matters: The "aha moment" is that code review is a team sport, not a series of 1-on-1 interactions. By using hyperedges, HGRec preserves the "group context" of a review, which leads to more precise modeling of a reviewer's actual expertise.
- Accuracy vs. Diversity: Most recommenders are "greedy"—they recommend the most active core reviewers because they have the most data. HGRec includes hyperparameters ($\alpha$ and $\lambda$) that allow the system to tune for Recommendation Distribution (RD). This helps the system find "non-core" reviewers who are qualified but less overwhelmed.
- Interpretability: Because the hypergraph is a direct mapping of entities and their interactions, the recommendations are more "natural" and easier for humans to understand compared to deep learning "black boxes."
Key Results
- Superior Accuracy: HGRec outperformed state-of-the-art baselines (like AC, RevFinder, and EARec) in terms of Accuracy (ACC) and Mean Reciprocal Rank (MRR). It took the lead in 8 out of 12 projects for Top-1 accuracy.
- Better Workload Balance: In the 'angular' project, a top-performing baseline (Random Forest) assigned 77 PRs to a single core reviewer in one month. In contrast, HGRec recommended that same reviewer for only 39 PRs, instead distributing the remaining load to other qualified candidates.
- Mitigating Burnout: Among the top three most accurate recommenders, HGRec was the most likely to recommend a diverse set of reviewers, directly addressing the "workload congestion" issue.
Limitations and Future Work
- External Validity: The study focused exclusively on GitHub OSS projects. The dynamics of code review in a corporate, private environment or on platforms like Gerrit might differ.
- Noise in Comments: The current model treats all comments equally. It doesn't distinguish between a deep architectural critique and a simple "LGTM" (Looks Good To Me).
- Future Directions: The authors suggest incorporating organizational relationships (e.g., who works for the same company) and using Natural Language Processing (NLP) to analyze the actual content of review comments to further refine the hyperedge weights.
Summary updated