AgenticSZZ: Temporal Knowledge Graph-Guided Agentic Bug-Inducing Commit Identification
AgenticSZZ is a novel approach that leverages Temporal Knowledge Graphs and LLM agents to overcome the limitations of traditional git blame-based methods by reframing Bug-Inducing Commit identification as a graph search problem, thereby significantly improving detection accuracy through expanded historical context and causal reasoning.
Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
The Detective's New Map: How AgenticSZZ Finds Software Bugs
Imagine you are a detective trying to solve a mystery: Who broke the code? In the world of software, a "bug" is a mistake that causes a program to crash or act strangely. To fix it, you need to find the exact moment in history when a developer accidentally introduced that mistake. This moment is called the Bug-Inducing Commit (BIC).
For decades, detectives have used a standard tool called SZZ (named after its creators). Think of SZZ as a magnifying glass that looks at the "crime scene" (the code fix) and asks, "Who touched this specific line of code last?" It uses a command called git blame to point a finger at the most recent person who changed that line.
The Problem:
The authors of this paper discovered a major flaw in this old method. They looked at over 2,000 real-world bug fixes and found that 40% of the time, the magnifying glass points to the wrong person.
Why?
- The Red Herring: Sometimes the person who touched the line last just changed the font color or added a space (a "cosmetic change"). The real bug was introduced by someone else months ago, but the old SZZ tool can't see past the last person.
- The Missing Clue: Sometimes, the fix didn't touch any old lines at all; it just added new lines. In this case, the magnifying glass has nothing to look at, and the tool gives up entirely.
The Solution: AgenticSZZ
The authors, Yu Shi and his team from Queen's University, built a new system called AgenticSZZ. Instead of just looking at one line of code, they built a Time-Traveling Map (a Temporal Knowledge Graph) and hired a Super-Detective AI (an LLM Agent) to navigate it.
Here is how it works, using simple analogies:
1. Building the Map (The Temporal Knowledge Graph)
Imagine the history of a software project not as a straight line of text, but as a giant, 3D spiderweb.
- The Nodes: Every time a developer saves their work (a "commit"), it's a dot on the web.
- The Threads: The web connects these dots in two ways:
- Time: Who came before whom?
- Structure: Who changed the same files or functions?
- The Expansion: Unlike the old method that only looks at the immediate neighborhood, AgenticSZZ expands the map. It traces the web backward from the fix and backward from the "last person who touched the line." This ensures the map includes the "Red Herrings" and the "Missing Clues" that the old tool ignored.
2. The Super-Detective (The LLM Agent)
Now that they have the map, they need someone smart enough to read it. They didn't just ask a computer to scan the list; they hired an AI Agent equipped with special tools.
Think of this Agent as a detective with a toolkit:
- The List Maker: "Show me the top suspects."
- The Time Traveler: "Let me walk backward along the web to see who else touched this file."
- The Fact Checker: "Read the commit message and the code changes to see if this person actually broke the logic."
- The Logic Brain: "Does this change make sense as the cause of the bug?"
The Agent doesn't just guess. It explores the map, checks the evidence, and reasons through the history to find the real culprit, even if that person is far back in the timeline or on a different branch of the project.
The Results: A Better Detective
The team tested this new system on three massive datasets (Linux kernel, Apache projects, and GitHub repositories). Here is what they found:
- Success Rate: AgenticSZZ found the correct bug-inducing commit 16% to 34% more often than the best existing methods.
- Solving the Unsolvable: It successfully solved cases that were previously impossible, such as when the fix added new code (the "Blameless" cases) or when the bug was introduced by a commit that happened after the last person touched the line but before the fix.
- The "Sweet Spot" of AI: The authors tested different AI models to be the detective. They found that the AI needs to be "smart enough" to do the job. Smaller, cheaper AI models tended to give up too quickly or skip the important steps, failing to find the bug. Only the larger, more capable models could successfully navigate the complex web of history.
The Takeaway
The paper argues that finding software bugs isn't just about ranking a list of suspects (the old way); it's about searching a complex web of history (the new way).
By combining a Time-Traveling Map (which expands the search space) with a Reasoning AI Agent (which intelligently filters the suspects), AgenticSZZ solves a problem that has stumped software detectives for 20 years. It proves that to find the root cause of a bug, you sometimes have to look far beyond the person who last touched the code.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.