Automatically Assessing and Extending Code Coverage for NPM Packages

Haiyang Sun, Andrea Rosa, Daniele Bonetta, Walter Binder

Research output: Chapter in Book / Report / Conference proceedingConference contributionAcademicpeer-review

Abstract

Typical Node.js applications extensively rely on packages hosted in the npm registry. As such packages may be used by thousands of other packages or applications, it is important to assess their code coverage. Moreover, increasing code coverage may help detect previously unknown issues. In this paper, we introduce TESA, a new tool that automatically assembles a test suite for any package in the npm registry. The test suite includes 1) tests written for the target package and usually hosted in its development repository, and 2) tests selected from dependent packages. The former tests allow assessing the code coverage of the target package, while the latter ones can increase code coverage by exploiting third-party tests that also exercise code in the target package. We use TESA to assess the code coverage of 500 popular npm packages. Then, we demonstrate that TESA can significantly increase code coverage by including tests from dependent packages. Finally, we show that the test suites assembled by TESA increase the effectiveness of existing dynamic program analyses to identify performance issues that are not detectable when only executing the developer's tests.
Original languageEnglish
Title of host publicationProceedings - 2021 IEEE/ACM International Conference on Automation of Software Test, AST 2021
PublisherInstitute of Electrical and Electronics Engineers Inc.
Pages40-49
ISBN (Electronic)9781665435673
DOIs
Publication statusPublished - 1 May 2021
Externally publishedYes
Event2nd IEEE/ACM International Conference on Automation of Software Test, AST 2021 - Virtual, Online
Duration: 20 May 202121 May 2021

Conference

Conference2nd IEEE/ACM International Conference on Automation of Software Test, AST 2021
CityVirtual, Online
Period20/05/2121/05/21

Funding

This work has been supported by Oracle (ERO project 1332), by the Hasler Foundation (project 20022) and by the Swiss National Science Foundation (project 200020 188688).

FundersFunder number
Schweizerischer Nationalfonds zur Förderung der Wissenschaftlichen Forschung200020 188688
Hasler Stiftung20022

    Fingerprint

    Dive into the research topics of 'Automatically Assessing and Extending Code Coverage for NPM Packages'. Together they form a unique fingerprint.

    Cite this