Detecting Locations in JavaScript Programs Affected by Breaking Library Changes

Anders Møller, Benjamin Barslev Nielsen, and Martin Toldam Torp

JavaScript libraries are widely used and evolve rapidly. Adapting client code to non-backwards compatible changes in libraries is a difficult manual task. In this paper we address the challenge of how to locate affected API uses in client code, by the use of a simple pattern language for expressing API access points and a pattern-matching tool based on lightweight static analysis.

Experimental evaluation on 15 popular npm packages shows that typical breaking changes are easy to express as patterns. Running the static analysis on 265 clients of these packages shows that it is accurate and efficient: it reveals usages of breaking APIs with only 14% false positives and no false negatives, and takes less than a second per client on average. In addition, the analysis is able to report its confidence, which makes it easier to identify the false positives. These results suggest that the approach, despite its simplicity, can reduce the manual effort of the client developers.

[ PDF | BibTeX | supplementary material | video ]