Semantic Patches for Adaptation of JavaScript Programs to Evolving Libraries
Benjamin Barslev Nielsen, Martin Toldam Torp, Anders Møller
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.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
4 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- Characterizing Python Library Migrations cites Keep me Updated: An Empirical Study of Third-Party Library Updatability on Android
- Break to Adapt: Knowledge-Based Updates of Breaking Dependencies in JavaScript cites Detecting locations in JavaScript programs affected by breaking library changes
- A Sound Static Analysis Approach to I/O API Migration cites Keep me Updated: An Empirical Study of Third-Party Library Updatability on Android
- Highly illogical, Kirk: spotting type mismatches in the large despite broken contracts, unsound types, and too many linters cites Detecting locations in JavaScript programs affected by breaking library changes
Cited by top-tier papers4
- Highly illogical, Kirk: spotting type mismatches in the large despite broken contracts, unsound types, and too many lintersJoshua Hoeflich, Robert Bruce Findler, Manuel SerranoOOPSLA 2022 · 5 citations
- Characterizing Python Library MigrationsMohayeminul Islam, Ajay Kumar Jha, Ildar Akhmetov, Sarah NadiFSE 2024 · 3 citations
- Break to Adapt: Knowledge-Based Updates of Breaking Dependencies in JavaScriptYifan Xia, Chengwei Liu, Zifan Xie, Lyuye Zhang et al.FSE 2026
- A Sound Static Analysis Approach to I/O API MigrationShangyu Li, Zhaoyang Zhang, Sizhe Zhong, Diyu Zhou et al.OOPSLA 2025
Builds on2
- Keep me Updated: An Empirical Study of Third-Party Library Updatability on AndroidErik Derr, Sven Bugiel, Sascha Fahl, Yasemin Acar et al.CCS 2017 · 196 citations
- Detecting locations in JavaScript programs affected by breaking library changesAnders Møller, Benjamin Barslev Nielsen, Martin Toldam TorpOOPSLA 2020 · 32 citations
Related papers
- More Effective JavaScript Breaking Change Detection via Dynamic Object Relation GraphDezhen Kong, Jiakun Liu, Chao Ni, David Lo et al.ISSTA 2025
- APIfix: output-oriented program synthesis for combating breaking changes in librariesXiang Gao, Arjun Radhakrishna, Gustavo Soares, Ridwan Shariffdeen et al.OOPSLA 2021 · 17 citations
- Understanding the Impact of APIs Behavioral Breaking Changes on Client ApplicationsDhanushka Jayasuriya, Valerio Terragni, Jens Dietrich, Kelly BlincoeFSE 2024 · 8 citations
- Compiler-directed Migrating API Callsite of Client CodeHao Zhong, Na MengICSE 2024 · 5 citations
- The Fix Is Right at Hand: Fixing Incompatibility Errors Guided by Library Knowledge for Automatic Library UpgradeZhuotong Zhou, Susheng Wu, Junpeng Zhao, Bihuan Chen et al.ISSTA 2026
