An extensible approach for taming the challenges of JavaScript dead code elimination

Autor: Gian Luca Scoccia, Niels Groot Obbink, Ivano Malavolta, Patricia Lago
Přispěvatelé: Software and Sustainability (S2), Software & Services
Jazyk: angličtina
Rok vydání: 2018
Předmět:
Zdroj: 25th IEEE International Conference on Software Analysis, Evolution and Reengineering, SANER 2018-Proceedings, 402-412
STARTPAGE=402;ENDPAGE=412;TITLE=25th IEEE International Conference on Software Analysis, Evolution and Reengineering, SANER 2018-Proceedings
Obbink, N G, Malavolta, I, Scoccia, G L & Lago, P 2018, An extensible approach for taming the challenges of JavaScript dead code elimination . in 25th IEEE International Conference on Software Analysis, Evolution and Reengineering, SANER 2018-Proceedings ., 8330226, IEEE International Conference on Software Analysis, Evolution and Reengineering (SANER)-Proceedings, no. March, vol. 2018, Institute of Electrical and Electronics Engineers Inc., pp. 402-412, 25th IEEE International Conference on Software Analysis, Evolution and Reengineering, SANER 2018, Campobasso, Italy, 20/03/18 . https://doi.org/10.1109/SANER.2018.8330226
SANER
DOI: 10.1109/SANER.2018.8330226
Popis: 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.
Databáze: OpenAIRE