InspectCoder: Dynamic Analysis-Driven Self Repair through Interactive LLM-Debugger Collaboration
Open Access
- 10 April 2026
- journal article
- Published by Association for Computing Machinery (ACM) in Proceedings of the ACM on Programming Languages
- Vol. 10 (OOPSLA1) , 1041-1069
Abstract
Complex logic errors in LLM-generated code are challenging to diagnose and repair. While existing LLM-based self-repair approaches conduct intensive static semantic analysis or rely on superficial execution logs, they miss the in-depth runtime behaviors that often expose bug root causes—lacking the interactive dynamic analysis capabilities that make human debugging effective. We present InspectCoder, the first agentic program repair system that empowers LLMs to actively conduct dynamic analysis via interactive debugger control. Our dual-agent framework enables strategic breakpoint placement, targeted state inspection, and incremental runtime experimentation within stateful debugger sessions. Unlike existing methods that follow fixed log collection procedures, InspectCoder adaptively inspects and perturbs relevant intermediate states at runtime, and leverages immediate process rewards from debugger feedback to guide multi-step reasoning, transforming LLM debugging paradigm from blind trial-and-error into systematic root cause diagnosis. We conduct comprehensive experiments on two challenging self-repair benchmarks: BigCodeBench-R and LiveCodeBench-R. InspectCoder achieves 5.10%–60.37% relative improvements in repair accuracy over the strongest baseline, while delivering 1.67x-2.24x superior bug-fix efficiency respectively. We also contribute InspectWare, an open-source middleware that abstracts debugger complexities and maintains stateful debugging sessions across mainstream Python testing frameworks. Our work provides actionable insight into the interactive LLM-debugger systems, demonstrating the significant potential of LLM-driven dynamic analysis for automated software engineering.Keywords
All Related Versions
Funding Information
- National Natural Science Foundation of China (62125206)
- Zhejiang Pioneer (Jianbing) Project (2025C01198(SD2))
This publication has 37 references indexed in Scilit:
- Explainable automated debugging via large language model-driven scientific debuggingEmpirical Software Engineering, 2024
- CodeMind: A Framework to Challenge Large Language Models for Code ReasoningarXiv, 2024
- Exploring Interaction Patterns for Debugging: Enhancing Conversational Capabilities of AI-assistantsarXiv, 2024
- A Survey of Learning-based Automated Program RepairACM Transactions on Software Engineering and Methodology, 2023
- Keep the Conversation Going: Fixing 162 out of 337 bugs for $0.42 each using ChatGPTarXiv, 2023
- An Empirical Study on Learning Bug-Fixing Patches in the Wild via Neural Machine TranslationACM Transactions on Software Engineering and Methodology, 2019
- Nopol: Automatic Repair of Conditional Statement Bugs in Java ProgramsIEEE Transactions on Software Engineering, 2016
- GenProg: A Generic Method for Automatic Software RepairIEEE Transactions on Software Engineering, 2011
- Debugging strategies and tactics in a multi-representation software environmentInternational Journal of Human-Computer Studies, 2007
- Dynamically discovering likely program invariants to support program evolutionIEEE Transactions on Software Engineering, 2001