Code Reviewer Recommendation for Architecture Violations: An Exploratory Study

Ruiyin Li, Peng Liang, Paris Avgeriou

Introduction

Code review is a cornerstone of modern software quality assurance, yet its effectiveness is fundamentally limited by the expertise of the assigned reviewers. While many automated tools exist to recommend reviewers, most are generic, suggesting candidates based on recent file activity rather than specific technical competencies. This lack of specialization is particularly problematic for identifying "architecture violations"—changes that may be functionally correct but violate the system's structural rules, leading to long-term architectural erosion.

This study addresses a critical gap in software maintenance: How can we automatically recommend reviewers who possess the specific expertise required to identify and mitigate architectural decay? By moving beyond simple file-touch metrics and incorporating semantic analysis of past review discourse, the researchers propose a more nuanced approach to reviewer recommendation.

Methodology

The researchers developed a recommendation model that mines historical data through two distinct lenses:

  1. File Path Similarity: This approach utilizes Jaccard Coefficients and an adapted Hamming Distance to determine if a reviewer has experience within the specific directory structures being modified. This captures the "spatial" expertise of the developer.
  2. Semantic Similarity of Review Comments: This novel layer moves beyond code locations to analyze the content of past reviews. Using a Word2Vec model pre-trained on 15GB of Stack Overflow data, the authors measured the semantic distance between a new code change's context and the textual feedback previously provided by reviewers. This allows the system to identify reviewers who have historically discussed architectural concepts like design patterns, API specifications, or layering.

The study evaluated these methods individually and in combination against RevFinder, a prominent baseline tool that relies exclusively on file-path heuristics. Additionally, the researchers investigated the impact of evaluation methodology—specifically Incremental vs. Fixed sampling—to determine how different testing strategies influence reported performance.

Experimental Design

The study utilized a specialized dataset extracted from four major Open-Source Software (OSS) projects: OpenStack (Neutron and Nova) and Qt (Base and Creator).

Rather than analyzing all code reviews, the authors focused on a curated set of 547 review comments explicitly related to architecture violations. These comments, spanning from 2012 to 2020, represent the "needle in the haystack" of critical structural issues that generic recommendation tools often overlook.

Key Findings

1. The Superiority of Semantic Context

The results indicate that knowing where a developer has coded is insufficient for identifying architectural experts. The semantic similarity of past review comments provided a much stronger signal of a reviewer's ability to understand the underlying "why" of a system's structure.

2. The "Power of Three"

The researchers found that the highest accuracy was achieved by combining three similarity methods—typically two file-path metrics and one semantic metric. Interestingly, adding a fourth method often introduced noise, leading to diminishing returns. This suggests that a balanced, multi-modal approach is optimal for specialized recommendation tasks.

3. Performance Against Baselines

The proposed approach significantly outperformed RevFinder across nearly all metrics. In the Neutron project, for instance, the combined similarity approach was approximately four times more accurate than the baseline. Mean Reciprocal Rank (MRR) scores—indicating the position of the correct reviewer in the recommendation list—ranged from 0.06 to 0.36. While these values reflect the difficulty of the task, they represent a substantial improvement over existing generic methods.

4. The Sampling Trap

A significant methodological insight was the impact of sampling techniques. Fixed sampling (randomly selecting a test set) consistently yielded higher performance scores than Incremental sampling (which simulates a real-world chronological timeline). This finding suggests that many previous studies may have overestimated the effectiveness of their tools by using less rigorous, non-chronological evaluation methods.

Limitations and Future Work

Despite the promising results, the study identifies several challenges:

  • Data Sparsity: Architecture violations are relatively rare, making it difficult to train highly robust models compared to general bug-fix datasets.
  • Platform Specificity: The study focused on projects using Gerrit; different review cultures on platforms like GitHub or GitLab may yield different results.
  • Human Factors: The model currently ignores reviewer availability and workload, which are critical for real-world deployment.

Future research will explore hybrid models that integrate social network analysis (developer communication patterns) and test these algorithms within proprietary, commercial environments to validate their effectiveness outside the open-source ecosystem.

Conclusion

By combining file-path similarity with semantic analysis of historical review comments, this study demonstrates a more effective way to pair architectural violations with the right experts. Moving toward specialized recommendation systems is a vital step in preventing architectural erosion and maintaining the long-term health of complex software systems.

Summary updated

BibTeX
@inproceedings{li2023code,
  author = {Ruiyin Li and Peng Liang and Paris Avgeriou},
  title = {{Code Reviewer Recommendation for Architecture Violations: An Exploratory Study}},
  booktitle = {EASE},
  year = {2023},
  doi = {10.1145/3593434.3593450},
}
Figure