Automatically Assessing and Extending Code Coverage for NPM Packages

05/14/2021
by   Haiyang Sun, et al.
0

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.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
03/16/2021

A Quantitative Assessment of Package Freshness in Linux Distributions

Linux users expect fresh packages in the official repositories of their ...
research
01/20/2022

npm-filter: Automating the mining of dynamic information from npm packages

The static properties of code repositories, e.g., lines of code, depende...
research
06/19/2022

Phantom Artifacts Code Review Coverage in Dependency Updates

The goal of this study is to aid developers in securely accepting depend...
research
05/20/2019

Tools for analyzing R code the tidy way

With the current emphasis on reproducibility and replicability, there is...
research
08/16/2021

Systematic Generation of Conformance Tests for JavaScript

JavaScript implementations are tested for conformance to the ECMAScript ...
research
07/19/2022

TestSelector: Automatic Test Suite Selection for Student Projects – Extended Version

Computer Science course instructors routinely have to create comprehensi...
research
09/26/2022

Test Coverage for Network Configurations

We develop NetCov, the first tool to reveal which network configuration ...

Please sign up or login with your details

Forgot password? Click here to reset