Skip to content
Open access

ANVIL-FL: Runtime-Aware Fault Localization for Code Generation and Debugging

2026 · IEEE Access · Vol 14, pp. 115918-115937 · 0 citations · 34 references
Computer Science

TL;DR

By combining dynamic runtime signals with structured LLM prompting, this framework demonstrates that failure-proximal runtime context can yield accurate, explainable, and cost-effective method-level fault localization within the BugsInPy setting.

Abstract

Fault localization (FL) is a dominant debugging cost, yet most recent LLM-based FL systems rely on static or coverage-only signals. We introduce <sc>ANVIL-FL</sc> (Anchored Near-failure Value-Informed Localization), a two-turn, tool-free framework that combines LLM reasoning with failure-anchored runtime telemetry. A lightweight tracer runs the test session and stops at the first failure, recording project-scoped function calls/returns and exceptions. <sc>ANVIL-FL</sc> first narrows candidates by proximity to the failure chain, then ranks methods using value-informed I/O snapshots (arguments/returns) and executed code snippets, generating a Top-<inline-formula> <tex-math notation="LaTeX">$k$ </tex-math></inline-formula> list with rationales and confidence. On BugsInPy, <sc>ANVIL-FL</sc> achieves Top-1/3/5 accuracies of 57.6/68.6/70.3% on the SBFL-available subset (<inline-formula> <tex-math notation="LaTeX">$N=424$ </tex-math></inline-formula>) and 57.0/67.6/69.4% on our full in-scope set (<inline-formula> <tex-math notation="LaTeX">$N=454$ </tex-math></inline-formula>). Against the strongest SBFL baseline on the overlapping set, <sc>ANVIL-FL</sc> improves Top-1/3/5 by + 38.7/+ 39.1/+ 32.8 percentage points (pp). On an overlapping test set (<inline-formula> <tex-math notation="LaTeX">$N=452$ </tex-math></inline-formula>), <sc>ANVIL-FL</sc> approaches AutoFL’s accuracy (Top-1/3/5: 57.1/67.7/69.5% vs. 59.3/71.9/73.0%), while using about <inline-formula> <tex-math notation="LaTeX">$3\times $ </tex-math></inline-formula> fewer input and <inline-formula> <tex-math notation="LaTeX">$4.8\times $ </tex-math></inline-formula> fewer output tokens per bug. Tracing overhead is modest (median 9,394 events, 4.30 MB, 11.74 s), and the full pipeline localizes each bug end-to-end in a median of 44 s at roughly <inline-formula> <tex-math notation="LaTeX">${\$}0.008$ </tex-math></inline-formula> per bug. Ablations show that failure-chain anchoring dominates (removal: approx. −40.8 pp at Top-5), with runtime I/O and executed code providing smaller but notable gains. By combining dynamic runtime signals with structured LLM prompting, our framework demonstrates that failure-proximal runtime context can yield accurate, explainable, and cost-effective method-level fault localization within the BugsInPy setting.

Read PDF

Similar papers

#artificial intelligence Preprint Sep 2026

Metrics Failure in LLM-Based Code Vulnerability Repair: An Empirical Study and a Change-Aware Screen

It is argued that compile rate is a scientifically unreliable metric for single-function vulnerability repair, and this is supported with five controlled experiments over 203 vulnerable functions from Big-Vul, three open-source code LLMs (350M to 6.7B parameters), and three prompting strategies.

Om Nepal, Sushant Aryal, Oluseyi Olukola et al. · 0 citations
Open access 2026

Deployment-Oriented Evaluation of LLM-Generated Optimization Code: Repairability, Compatibility, and Constraint-Coverage in Parallel-Machine Scheduling

GenSE-Scheduler, a deployment-oriented framework for evaluating LLM-generated parallel-machine scheduling code, compares monolithic schedulers with four-stage modular pipelines under typed contracts, sandboxed execution, a failure taxonomy, stage-swap repair, and pre-composition compatibility prediction.

Achraf Ghorbel, Nourchène Elleuch Ben Ayed, Keletso J. Letsholo et al. · 0 citations
Book Open access Sep 2026

State-Aware Fuzzing of JavaScript Engines with LLM-Guided Instrumentation

The StateLens framework is presented, a framework that employs Large Language Models (LLM) to automate the discovery of deep internal states and significantly outperforms state-of-the-art fuzzers and uncovers 68 new bugs.

Wai-Kin Wong, Dong-Wei Xiao, Anthony Cheuk Tung Lai et al. · 0 citations
Open access Oct 2026

ConUT: Condition-Aware Test Generation for Complex Java Code

Automatically generating high-coverage unit tests for complex Java methods remains a formidable challenge, particularly when execution paths are guarded by intricate control-flow nesting and cross-class state dependencies. Existing LLM-based approaches predominantly follow a goal-driven paradigm, relying on unguided co...

Rui-Guo Yu, Rui-Qi Dong, Xi Xiao et al. · 0 citations
Preprint Aug 2026

CodeMechanic: Bug-Property-Guided Program Mitigation

This work presents CodeMechanic, a bug-property-guided system for generating constrained mit- igations for spatial memory corruption that combines a two-dimensional static and dynamic context extractor with in-prompt debugging knowledge and stepwise val- idation to limit the effect of LLM errors.

Han Zheng, Rafaila Galanopoulou, Ilia Shumailov et al. · 0 citations
#small language model Preprint Sep 2026

Path2Spec: Path-Aware Specification Generation via Large Language Models

This work introduces Path2Spec, a divide-and-conquer framework that leverages LLMs to extract all execution paths from an input program, generates path-specific specifications for each, and merges them into a comprehensive overall specification.

Dan Huang, Zhensu Sun, Hui-Hui Huang et al. · 0 citations

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.