HAFixAgent: 기록 인식 자동 프로그램 수정 에이전트
HAFixAgent: History-Aware Automated Program Repair Agent
November 2, 2025
저자: Yu Shi, Hao Li, Bram Adams, Ahmed E. Hassan
cs.AI
초록
자동 프로그램 수리(APR) 분야는 최근 대규모 언어 모델과 에이전트 기반 시스템으로 전환되고 있지만, 대부분의 시스템은 저장소 기록을 간과한 채 로컬 스냅샷 컨텍스트에 의존하고 있습니다. 선행 연구에 따르면 버그가 발생한 라인을 마지막으로 수정한 커밋이 종종 버그를 유발한 커밋이기 때문에, 저장소 기록은 단일 라인 버그 수리에 도움이 됩니다. 본 논문에서는 저장소 기록이 특히 복잡한 다중 행 버그를 대상으로 규모 있는 에이전트 기반 APR 시스템의 성능도 향상시킬 수 있는지 조사합니다. 우리는 저장소 비난(blame) 정보에서 도출된 발견적 정보를 수리 루프에 주입하는 HAFixAgent(History-Aware Bug-Fixing Agent)를 제시합니다. Defects4J의 실제 버그 854개 전체를 대상으로 한 예비 연구는 버그와 관련된 기록이 광범위하게 존재하면서도 매우 집중되어 있음을 보여주어 우리의 설계에 동기를 부여했습니다. HAFixAgent와 두 가지 최신 기준선을 경험적으로 비교한 결과는 다음과 같습니다: (1) 효과성: HAFixAgent는 에이전트 기반 기준선 대비 212.3%, 다중 행 버그 처리 기준선 대비 29.9% 크게 향상되었습니다. (2) 효율성: 기록 활용은 에이전트 단계를 크게 증가시키지 않으며 토큰 비용을 비슷한 수준으로 유지했고, 특히 복잡한 다중 파일-다중 행 버그의 중간값 비용이 현저히 낮았습니다. (3) 실용성: 서로 다른 역사적 발견적 정보를 결합하면 더 많은 버그를 수리할 수 있어 명확한 비용-편익 균형을 제공합니다. HAFixAgent는 기록 인식 에이전트 기반 APR을 위한 실용적인 방법론을 제시합니다. 즉, 에이전트를 버전 관리 기록에 기반하게 하고, diff 기반 역사적 컨텍스트를 우선시하며, 필요 시 상호 보완적인 발견적 정보를 통합하는 것입니다.
English
Automated program repair (APR) has recently shifted toward large language
models and agent-based systems, yet most systems rely on local snapshot
context, overlooking repository history. Prior work shows that repository
history helps repair single-line bugs, since the last commit touching the buggy
line is often the bug-introducing one. In this paper, we investigate whether
repository history can also improve agentic APR systems at scale, especially
for complex multi-hunk bugs. We present HAFixAgent, a History-Aware Bug-Fixing
Agent that injects blame-derived repository heuristics into its repair loop. A
preliminary study of all 854 real-world bugs from Defects4J motivates our
design, showing that bug-relevant history is both widely available and highly
concentrated. Empirical comparison of HAFixAgent with two state-of-the-art
baselines shows: (1) Effectiveness: HAFixAgent significantly improves over the
agent-based baseline (by 212.3%) and the multi-hunk baseline (by 29.9%). (2)
Efficiency: history does not significantly increase agent steps and keeps token
costs comparable, with notably lower median costs for complex
multi-file-multi-hunk bugs. (3) Practicality: combining different historical
heuristics repairs more bugs, offering a clear cost-benefit trade-off.
HAFixAgent offers a practical recipe for history-aware agentic APR: ground the
agent in version control history, prioritize diff-based historical context, and
integrate complementary heuristics when needed.