Nudge: Accelerating Overdue Pull Requests Towards Completion

Chandra Shekhar Maddila, Sai Surya Upadrasta, Chetan Bansal, Nachiappan Nagappan, Georgios Gousios, Arie van Deursen · DOI

TL;DR

This paper introduces "Nudge," an intelligent system that accelerates the completion of overdue pull requests (PRs) in software development. By predicting PR completion times, detecting recent activity, and identifying the specific person blocking progress, Nudge sends timely, targeted notifications that significantly reduce PR resolution time and are well-received by developers.

What Problem Does This Paper Address?

In collaborative software development, pull requests (PRs) are crucial for code review and integration. However, they can become bottlenecks when authors or reviewers don't engage promptly, leading to stalled development, potential merge conflicts, and delayed delivery of value. Existing systems often lack the intelligence to identify who is blocking a PR and when to intervene effectively, leading to either too many or too few notifications, or notifications that are perceived as unhelpful. This paper aims to solve the problem of "stale" PRs by providing a smart, automated system to nudge the right people at the right time.

Methods

Nudge employs a three-pronged approach:

  1. Effort Estimation (Prediction Model): A machine learning model (specifically, gradient boosting) is trained to predict the expected lifetime of a pull request. This model uses historical data and various features related to the PR, author, and repository to estimate how long a PR should take to complete. This is a novel application of effort estimation at the individual PR level.
  2. Activity Detection: To avoid unnecessary notifications, Nudge monitors recent activity on a PR (e.g., new commits, comments, state changes). If there's been recent engagement, even if the PR is technically "overdue" by prediction, Nudge refrains from sending a notification. This acts as a crucial gatekeeper.
  3. Actor Identification: This module identifies the specific individual (author or reviewer) who is currently blocking the PR's progress. This allows Nudge to send targeted notifications, rather than generic alerts, to the person who needs to take action.

These components are integrated into a service that operates within Azure DevOps, leveraging its APIs and service hooks.

Datasets

The study utilizes data from Microsoft's internal development environments.

  • Training Data: Historical pull request data from various Microsoft repositories was used to train the prediction models.
  • Evaluation Data:
    • A randomized trial was conducted on 147 repositories, involving 8,500 pull requests.
  • A large-scale deployment was monitored across 8,000 repositories over a year, involving 210,000 notifications.
  • Data includes PR metadata, author information, and telemetry on PR completion times and developer feedback.

Key Insights and Ideas

  • PRs are complex: Predicting PR completion time is not a simple task; it requires considering a multitude of factors beyond just code size.
  • Context matters: Simply predicting an overdue PR isn't enough. Nudge's effectiveness hinges on understanding if progress is actually being made (activity detection) and who is responsible for the delay (actor identification).
  • Targeted nudges are key: Generic reminders are less effective. Identifying the specific blocker and notifying them directly significantly increases the likelihood of action.
  • Developer perception is crucial: For any tool to be adopted, it must be perceived as helpful, not annoying. Nudge's design prioritizes minimizing unnecessary notifications and providing actionable, context-aware nudges.
  • Scalability is achievable: The system's design, with its modular components and use of big data platforms, allows it to scale from hundreds to thousands of repositories without losing effectiveness.

Key Results

  • Reduced PR Lifetime: Nudge reduced the average pull request resolution time by 60.62% (from 197.2 hours to 77.7 hours for the full Nudge service).
  • High Developer Satisfaction: 73% of developers receiving Nudge notifications resolved them positively in the initial study, and 71.5% in the large-scale deployment.
  • Faster Completion: 81.53% of nudged PRs were closed within a week in the initial study, and 83.65% in the large-scale deployment.
  • Effective Actor Identification: The system accurately identified change blockers, with 130 out of 200 analyzed PRs being blocked by authors and 70 by reviewers.

Limitations and Future Work

  • Dependencies between PRs: Nudge currently doesn't account for PRs that are blocked by other PRs. Future work could involve scanning PR discussions for inter-PR dependencies.
  • Developer Availability: The current system only accounts for weekends and public holidays. Incorporating more sophisticated detection of developer absence (e.g., vacation detection) is suggested.
  • Learning from Feedback: Nudge doesn't currently learn from explicit negative feedback to adjust its models or parameters. Future work could focus on incorporating user feedback into the system.
  • Code Review Quality: The paper assumes Nudge doesn't affect the quality of code reviews or changes. Further investigation into whether developers rush and deliver lower quality work when nudged is needed.
  • Generalizability: While tested at Microsoft, the model's coefficients and factors might vary for other platforms like GitHub or GitLab, requiring adaptation.

Summary updated

BibTeX
@article{maddila2023nudge,
  author = {Chandra Shekhar Maddila and Sai Surya Upadrasta and Chetan Bansal and Nachiappan Nagappan and Georgios Gousios and Arie van Deursen},
  title = {{Nudge: Accelerating Overdue Pull Requests Towards Completion}},
  journal = {ACM Trans. Softw. Eng. Methodol.},
  year = {2023},
  doi = {10.1145/3544791},
}
Figure