arrow
返回

JavaScript Dead Code Identification, Elimination, and Empirical Assessment

delete2023-07-01
delete5
delete
OA
AI
I
Ivano Malavolta *
K
Kishan Nirghin
G
Gian Luca Scoccia
S
Simone Romano
S
S. Lombardi
G
Giuseppe Scanniello
P
Patricia Lago
DOI:10.1109/TSE.2023.3267848delete
delete原文链接
delete原文求助
delete分享
delete收藏
摘要

摘要

En 中文
Web apps are built by using a combination of HTML, CSS, and JavaScript. While building modern web apps, it is common practice to make use of third-party libraries and frameworks, as to improve developers' productivity and code quality. Alongside these benefits, the adoption of such libraries results in the introduction of JavaScript dead code, i.e., code implementing unused functionalities. The costs for downloading and parsing dead code can negatively contribute to the loading time and resource usage of web apps. The goal of our study is two-fold. First, we present Lacuna, an approach for automatically detecting and eliminating JavaScript dead code from web apps. The proposed approach supports both static and dynamic analyses, it is extensible and can be applied to any JavaScript code base, without imposing constraints on the coding style or on the use of specific JavaScript constructs. Second, by leveraging Lacuna we conduct an experiment to empirically evaluate the run-time overhead of JavaScript dead code in terms of energy consumption, performance, network usage, and resource usage in the context of mobile web apps. We applied Lacuna four times on 30 mobile web apps independently developed by third-party developers, each time eliminating dead code according to a different optimization level provided by Lacuna. Afterward, each different version of the web app is executed on an Android device, while collecting measures to assess the potential run-time overhead caused by dead code. Experimental results, among others, highlight that the removal of JavaScript dead code has a positive impact on the loading time of mobile web apps, while significantly reducing the number of bytes transferred over the network.
Keyword:
Terms-Dead code
JavaScript

期刊

IEEE Transactions on Software Engineering 封面图
IEEE Transactions on Software Engineering
IF:
5.6
论文数:
2.9K
被引数:
1.1W

机构

U
University of Salerno
学者数:
1.2W
论文数: 1.1W
被引数: 1.2W
University of LAquila 封面图
University of LAquila
学者数:
7.4K
论文数: 6.6K
被引数: 6.7K
V
Vrije Universiteit Amsterdam
学者数:
4.2W
论文数: 3.7W
被引数: 3.7W
U
University of Basilicata
学者数:
3.2K
论文数: 3.0K
被引数: 3.2K
学者 查看更多机构
引用论文

引用论文

err分享
err收藏
Learning to tie the knot: The acquisition of functional object representations by physical and observational experience
err2017-10-12
err0
errOAAI
errEmily S. Cross; Antonia F. de C. Hamilton; Nichola Rice Cohen; Scott T. Grafton
err分享
err收藏
err分享
err收藏
学者 查看更多内容