arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2606.21187cs.SE
收藏

JavaScript变更影响推荐:来自历史和运行时分析的教训

Change Impact Recommendation for JavaScript: Lessons from History and Runtime Analysis

Simon Fraser University(西蒙菲莎大学);Magellan AI(麦哲伦人工智能)

Sadjad Tavakoli, Saba Alimadadi

AI总结:

针对JavaScript动态特性导致的依赖推断难题,通过结合历史共变模式挖掘和动态依赖分析,提出混合方法Caprese,实验表明两种信号互补,混合推荐效果更优。

摘要:

理解代码变更的下游影响对于软件维护、调试和回归测试至关重要。对于JavaScript应用程序,这一任务尤其具有挑战性,因为回调、事件、异步执行和共享可变状态等动态语言特性使得依赖关系难以精确推断。现有的变更影响推荐方法主要依赖于基于依赖的分析或仓库挖掘。基于依赖的技术,特别是动态分析,从观察到的执行中捕获运行时交互,但可能遗漏分析期间未执行的关系。相比之下,基于历史的技术从过去的变更中揭示演化耦合,但由于嘈杂的共变模式,常常引入不精确的推荐。为了研究这些方法在JavaScript中的优势和局限性,我们设计并评估了三种推荐技术:使用共变模式挖掘的基于历史的方法、基于动态依赖的方法以及结合两种信号的混合方法。我们在统一框架Caprese中实现了这些技术,并使用专家策划的参考检查集对10个开源Node.js应用程序进行了评估。我们的结果显示,基于历史和动态分析识别的候选者之间重叠度低,在较宽的检查预算下仅有22%的重叠,表明这两种方法捕获了互补的影响信号。动态分析通常产生更高的精确度,而基于历史的分析识别出依赖分析遗漏的其他相关候选者。这些发现表明,JavaScript中的实际变更影响推荐受益于结合运行时和演化信号,因为单一技术不足以捕获所有相关的检查候选者。

英文摘要:

Understanding the downstream effects of code changes is essential for software maintenance, debugging, and regression testing. This task is particularly challenging for JavaScript applications, where dynamic language features such as callbacks, events, asynchronous execution, and shared mutable state make dependencies difficult to infer precisely. Existing change impact recommendation approaches rely primarily on either dependency-based analysis or repository mining. Dependency-based techniques, particularly dynamic analysis, capture runtime interactions from observed execution but may miss relationships not exercised during analysis. In contrast, history-based techniques uncover evolutionary coupling from past changes but often introduce imprecise recommendations due to noisy co-change patterns. To investigate the strengths and limitations of these approaches in JavaScript, we engineer and evaluate three recommendation techniques: a history-based approach using co-change pattern mining, a dynamic dependency-based approach, and a hybrid approach combining both signals. We implement these techniques in a unified framework, Caprese, and evaluate them on 10 open-source Node.js applications using expert-curated reference inspection sets. Our results reveal low overlap between candidates identified by history-based and dynamic analyses, with only 22% overlap at broader inspection budgets, indicating that the two approaches capture complementary impact signals. Dynamic analysis generally yields higher precision, while history-based analysis identifies additional relevant candidates missed by dependency analysis. These findings suggest that practical change impact recommendation in JavaScript benefits from combining runtime and evolutionary signals, as no single technique sufficiently captures all relevant inspection candidates.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑