paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Semantic Patches for Adaptation of JavaScript Programs to Evolving Libraries

将 JavaScript 程序适配到演化中库的语义补丁
ICSE 2021 IEEE/ACM 43rd International Conference on Software Engineering (ICSE)2021匹配度 3/10 · 该论文属于基于静态分析与语义补丁的JavaScript库迁移工具,与用户当前追踪的PL↔AI交叉、浮点程序分析、贝叶斯程序分析等核心方向没有直接交集;仅在“静态分析/抽象解释”这一技术手段上有弱关联,且不涉及LLM/Agent或工业AI场景。引用 21 inbox
Benjamin Barslev Nielsen, Martin Toldam Torp, Anders Moller
crossref: 2026-09-12dblp: 2026-09-12

AI 速览

一句话:提出 JSFIX,利用语义补丁、静态分析和交互式确认来检测并适配 JavaScript 客户端因库破坏性变更而失效的代码。

JavaScript 库更新常引入破坏性变更,客户端开发者需人工定位受影响代码并编写补丁,过程繁琐易错。本文提出 JSFIX:给定形式化描述破坏性变更的语义补丁,工具先借助已有静态分析近似定位受影响位置,再通过交互式问答过滤误报,最后自动变换这些代码以兼容新版本库。作者在 12 个流行 JavaScript 库和 203 个客户端上评估,表明语义补丁能准确表达多数实际破坏性变更,JSFIX 可成功适配大多数客户端;其中 31 个客户端接受了其 pull request。平均每个客户端仅需数秒即可处理 3.8 个受影响位置,并向用户提出 2.7 个问题,显著减少人工适配工作量。

问题
JavaScript 库演化中的破坏性变更迫使客户端开发者人工定位并修补不兼容代码,该过程繁琐、易错且完全手动。
方法
JSFIX 使用语义补丁形式化描述破坏性变更,结合静态分析近似定位受影响位置,并通过交互式问答过滤误报后自动变换客户端代码。
评估
在 12 个流行 JS 库和 203 个客户端上评估,JSFIX 能表达多数实际破坏性变更并成功适配大多数客户端,31 个客户端接受了其 pull request,平均数秒处理 3.8 个位置、仅需 2.7 个用户问题。
原文摘要(Abstract)

JavaScript libraries are often updated and sometimes breaking changes are introduced in the process, resulting in the client developers having to adapt their code to the changes. In addition to locating the affected parts of their code, the client developers must apply suitable patches, which is a tedious, error-prone, and entirely manual process. To reduce the manual effort, we present JSFIX. Given a collection of semantic patches, which are formalized descriptions of the breaking changes, the tool detects the locations affected by breaking changes and then transforms those parts of the code to become compatible with the new library version. JSFIX relies on an existing static analysis to approximate the set of affected locations, and an interactive process where the user answers questions about the client code to filter away false positives. An evaluation involving 12 popular JavaScript libraries and 203 clients shows that our notion of semantic patches can accurately express most of the breaking changes that occur in practice, and that JSFIX can successfully adapt most of the clients to the changes. In particular, 31 clients have accepted pull requests made by JSFIX, indicating that the code quality is good enough for practical usage. It takes JSFIX only a few seconds to patch, on average, 3.8 source locations affected by breaking changes in each client, with only 2.7 questions to the user, which suggests that the approach can significantly reduce the manual effort required when adapting JavaScript programs to evolving libraries.

链接与引用

DOI 原文 · PDF(开放获取) · DBLP

BibTeX
@inproceedings{NielsenTM21,
  title = {Semantic Patches for Adaptation of JavaScript Programs to Evolving Libraries},
  author = {Benjamin Barslev Nielsen and Martin Toldam Torp and Anders Moller},
  booktitle = {ICSE},
  year = {2021},
  doi = {10.1109/icse43902.2021.00020}
}