TY - GEN
T1 - An extensible approach for taming the challenges of JavaScript dead code elimination
AU - Obbink, Niels Groot
AU - Malavolta, Ivano
AU - Scoccia, Gian Luca
AU - Lago, Patricia
PY - 2018
Y1 - 2018
N2 - JavaScript is becoming the de-facto programming language of the Web. Large-scale web applications (web apps) written in Javascript are commonplace nowadays, with big technology players (e.g., Google, Facebook) using it in their core flagship products. Today, it is common practice to reuse existing JavaScript code, usually in the form of third-party libraries and frameworks. If on one side this practice helps in speeding up development time, on the other side it comes with the risk of bringing dead code, i.e., JavaScript code which is never executed, but still downloaded from the network and parsed in the browser. This overhead can negatively impact the overall performance and energy consumption of the web app. In this paper we present Lacuna, an approach for JavaScript dead code elimination, where existing JavaScript analysis techniques are applied in combination. The proposed approach supports both static and dynamic analyses, it is extensible, and independent of the specificities of the used JavaScript analysis techniques. Lacuna can be applied to any JavaScript code base, without imposing any constraints to the developer, e.g., on her coding style or on the use of some specific JavaScript feature (e.g., modules). Lacuna has been evaluated on a suite of 29 publicly-available web apps, composed of 15,946 JavaScript functions, and built with different JavaScript frameworks (e.g., Angular, Vue.js, jQuery). Despite being a prototype, Lacuna obtained promising results in terms of analysis execution time and precision.
AB - JavaScript is becoming the de-facto programming language of the Web. Large-scale web applications (web apps) written in Javascript are commonplace nowadays, with big technology players (e.g., Google, Facebook) using it in their core flagship products. Today, it is common practice to reuse existing JavaScript code, usually in the form of third-party libraries and frameworks. If on one side this practice helps in speeding up development time, on the other side it comes with the risk of bringing dead code, i.e., JavaScript code which is never executed, but still downloaded from the network and parsed in the browser. This overhead can negatively impact the overall performance and energy consumption of the web app. In this paper we present Lacuna, an approach for JavaScript dead code elimination, where existing JavaScript analysis techniques are applied in combination. The proposed approach supports both static and dynamic analyses, it is extensible, and independent of the specificities of the used JavaScript analysis techniques. Lacuna can be applied to any JavaScript code base, without imposing any constraints to the developer, e.g., on her coding style or on the use of some specific JavaScript feature (e.g., modules). Lacuna has been evaluated on a suite of 29 publicly-available web apps, composed of 15,946 JavaScript functions, and built with different JavaScript frameworks (e.g., Angular, Vue.js, jQuery). Despite being a prototype, Lacuna obtained promising results in terms of analysis execution time and precision.
UR - http://www.scopus.com/inward/record.url?scp=85051042251&partnerID=8YFLogxK
UR - http://www.scopus.com/inward/citedby.url?scp=85051042251&partnerID=8YFLogxK
U2 - 10.1109/SANER.2018.8330226
DO - 10.1109/SANER.2018.8330226
M3 - Conference contribution
T3 - IEEE International Conference on Software Analysis, Evolution and Reengineering (SANER) - Proceedings
SP - 402
EP - 412
BT - 25th IEEE International Conference on Software Analysis, Evolution and Reengineering, SANER 2018 - Proceedings
PB - Institute of Electrical and Electronics Engineers Inc.
T2 - 25th IEEE International Conference on Software Analysis, Evolution and Reengineering, SANER 2018
Y2 - 20 March 2018 through 23 March 2018
ER -