Large Language Model-Aided Partial Program Dependence Analysis
This program is tentative and subject to change.
Dependence analysis (DA) plays a critical role in software engineering, from code optimization to debugging. It is traditionally limited to scenarios where entire source code is available. In practice, however, developers often encounter incomplete or partial code snippets, as in StackOverflow (S/O) forums or during modular development, where program constructs are missing. This presents challenges for DA tools, which rely on syntactic and semantic correctness to correctly identify dependencies. Thus, existing DA tools for partial code often face trade-offs in precision and recall.
In this work, we introduce L𝜆MDA, a framework that addresses these limitations by leveraging large language models (LLMs) as context augmenters to enrich partial code snippets with the program elements required for enabling such analyses. Through our evaluation, we showed that L𝜆MDA exhibits high correctness and completeness guarantees, yielding a higher recall than traditional approaches, and a higher precision than learning-based approaches. Overall, L𝜆MDA improves over all baselines in partial program dependence analysis by 5%-265% and 16%-331% across S/O benchmarks. Moreover, we show L𝜆MDA’s effectiveness in providing exception handling suggestions as well as exception-flow analysis.