CG-Diff: Organizing Code Changes Around Call Graphs

📅 2026-09-25
📈 Citations: 0
✨ Influential: 0
📄 PDF
🤖 AI Summary
This study addresses the limitation of traditional code review, which organizes changes by file and consequently fragments cross-file logic while impeding context navigation. To overcome this, we propose CG-Diffs, a call-graph-centric paradigm for organizing code changes. By integrating static analysis with graph decomposition algorithms, CG-Diffs constructs call graph diff subgraphs for pull requests, aggregating related functions scattered across multiple files into navigable, structured views complemented by a web-based visualization interface. Empirical evaluations demonstrate that CG-Diffs transcends the constraints of file-centric perspectives by effectively assisting reviewers in locating change contexts. Furthermore, it significantly enhances review efficiency in unfamiliar codebases, thereby validating the potential of graph-structured paradigms for modern code review practices.
📝 Abstract
Tools for code review present code changes file-by-file. We argue that, oftentimes, changes can be better organized around a call graph of the changed code. From an empirical study of GitHub pull requests (PRs) in-the-wild, we find that (1) in around 40% of the PRs, more than half of the changed functions (and methods) are connected by call graphs, and (2) necessary callees are often located in different files from their callers. Based on these findings, we develop the notion of CG-Diffs, subgraphs derived by decomposing a call graph of the changed code into smaller and more navigable directed graphs. We then implement a web-based interface for viewing PRs that restructures the PR around these CG-Diffs. Through a within-subject study comparing our interface against GitHub's PR view, we find that CG-Diffs help orient participants and provide them with more meaningful structures to navigate the PR. We also found several limitations: function nodes repeated across multiple CG-Diffs can be disorienting, and changes not contained in a function (e.g. globals, imports) are not as immediately apparent. Our study shows promise in using call graphs to help contextualize and navigate unfamiliar codebases, which may benefit new contributors to open source, and reviewers of unfamiliar LLM-generated PRs.
Problem

Research questions and friction points this paper is trying to address.

code review
call graph
pull request
code navigation
change organization
Innovation

Methods, ideas, or system contributions that make the work stand out.

Call Graph
Code Review
CG-Diffs
Pull Requests
Program Comprehension
🔎 Similar Papers
No similar papers found.