Type Regression Testing to Detect Breaking Changes in Node.js Libraries

Gianluca Mezzetti, Anders Møller, Martin Toldam Torp

Research output: Contribution to book/anthology/report/proceedingArticle in proceedingsResearchpeer-review

19 Citations (Scopus)
530 Downloads (Pure)

Abstract

The npm repository contains JavaScript libraries that are used by millions of software developers. Its semantic versioning system relies on the ability to distinguish between breaking and non-breaking changes when libraries are updated. However, the dynamic nature of JavaScript often causes unintended breaking changes to be detected too late, which undermines the robustness of the applications. We present a novel technique, type regression testing, to automatically determine whether an update of a library implementation affects the types of its public interface, according to how the library is being used by other npm packages. By leveraging available test suites of clients, type regression testing uses a dynamic analysis to learn models of the library interface. Comparing the models before and after an update effectively amplifies the existing tests by revealing changes that may affect the clients. Experimental results on 12 widely used libraries show that the technique can identify type-related breaking changes with high accuracy. It fully automatically classifies at least 90% of the updates correctly as either major or as minor or patch, and it detects 26 breaking changes among the minor and patch updates.

Original languageEnglish
Title of host publication32nd European Conference on Object-Oriented Programming, ECOOP 2018
EditorsTodd D. Millstein
Number of pages24
Volume109
PublisherDagstuhl Publishing
Publication date1 Jul 2018
Pages7:1-7:24
Article number7
ISBN (Print)978-3-95977-079-8
ISBN (Electronic)9783959770798
DOIs
Publication statusPublished - 1 Jul 2018
Event32nd European Conference on Object-Oriented Programming (ECOOP 2018) - Amsterdam, Netherlands
Duration: 16 Jul 201821 Jul 2018
Conference number: 32
https://conf.researchr.org/home/ecoop-2018

Conference

Conference32nd European Conference on Object-Oriented Programming (ECOOP 2018)
Number32
Country/TerritoryNetherlands
CityAmsterdam
Period16/07/201821/07/2018
Internet address
SeriesLeibniz International Proceedings in Informatics
Volume109
ISSN1868-8969

Keywords

  • Dynamic analysis
  • JavaScript
  • Semantic versioning

Fingerprint

Dive into the research topics of 'Type Regression Testing to Detect Breaking Changes in Node.js Libraries'. Together they form a unique fingerprint.

Cite this