一句话:提出 Ripple,用 LLM 做意图感知的变更影响分析,以两阶段设计平衡精度与召回,F1 提升 39.7%–380.8%。
变更影响分析(IA)旨在识别共同变更的程序元素集合(影响集),对多项软件工程任务至关重要,但现有方法难以在精度(正确识别受影响元素)与召回(找出全部相关元素)之间取得平衡,且难以支持由给定变更意图决定共变元素的意图感知场景。本文提出 Ripple,一种意图感知的影响分析方法:它利用大语言模型捕捉变更依赖,将变更意图与程序元素关联并估计其共变关系。为缓解精度—召回权衡,Ripple 采用两阶段设计:一是“种子到范围”扩展策略,利用演化耦合与依赖耦合扩大影响集以提升召回;二是“先规划后预测”策略,由 LLM 生成的变更计划精化影响估计以提升精度。作者在 Apache 项目的真实提交上评估 Ripple,相较现有 IA 方法 F1 分数提升 39.7%–380.8%,并允许用户依据偏好侧重精度或召回。
Change impact analysis (IA), which identifies the set of co-changed program elements (i.e., impact set), is critical for several software engineering tasks. However, existing IA approaches struggle with a trade-off between precision (correctly detecting impacted elements) and recall (detecting all relevant ones). More importantly, they are limited in intent-aware settings, where co-changing elements are determined by a given change intent. In this work, we propose Ripple, an intent-aware IA approach that leverages large language models (LLMs) to capture change dependencies by linking intent to program elements and estimating their co-change relationships. To address the precision-recall tradeoff, we adopt a two-phase design: (1) a seed-to-scope expansion strategy that expands the impact set using evolutionary and dependence coupling to improve recall, and (2) a plan-then-predict strategy where an LLM-generated change plan refines impact estimation for higher precision. We evaluate Ripple on real-world commits from Apache projects, achieving a 39.7%–380.8% improvement in F1-score over existing IA approaches. In addition, Ripple introduces flexibility, allowing users to prioritize higher precision or recall based on their preferences.