Treffer: A study of JavaScript error handling

Title:
A study of JavaScript error handling
Contributors:
Publisher Information:
Universidade Federal de Pernambuco
UFPE
Brasil
Programa de Pos Graduacao em Ciencia da Computacao
Publication Year:
2019
Collection:
Repositório Institucional UFPE (Universidade Federal de Pernambuco)
Document Type:
Dissertation master thesis
File Description:
application/pdf
Language:
English
Rights:
openAccess ; Attribution-NonCommercial-NoDerivs 3.0 Brazil ; http://creativecommons.org/licenses/by-nc-nd/3.0/br/
Accession Number:
edsbas.C1DCFF54
Database:
BASE

Weitere Informationen

LIMA FILHO, Fernando José Castor de, também é conhecido(a) em citações bibliográficas por: CASTOR FILHO, Fernando ; JavaScript is in widespread use for both Web-based and Standalone software development. A large number of production quality, robust software systems are currently built using it. Because of its popularity, JavaScript has been the subject of a several empirical studies in the last few years. Previous research has analyzed uses of the eval function, how callbacks are employed, and other aspects of the language. In this work, we contribute to the existing body of knowledge by studying how developers employ error handling mechanisms in JavaScript systems. JavaScript provides two different mechanisms for handling errors, try-catch blocks and callback functions. These mechanisms are employed along with a number of abstractions that have not been previously studied in the context of error handling, namely: promises, events, and asynchronous functions. In addition, we evaluated the usage of global event handlers, which is applicable for scenarios where an error occurred and no handler was found. We analyzed 192 popular JavaScript repositories from Github, comprising more than 60 thousand files and 11 million lines of code. We also classified them as Web-based or Standalone, depending on Node.js framework usage. We analyzed how the error handling mechanisms of the language are employed, what error handling strategies are typically used, and how Web-based and Standalone systems differ regarding the error handling. Errors impact differently in Web-based and Standalone systems. Users may not concern about the errors in Web-based as it generally occurs in the console. Standalone systems deal differently with errors, once the system finds an error, it crashes and does not allow any further operation. Our findings indicate that pure callbacks are the predominant error handling mechanism in JavaScript systems (64.500 callback functions in our dataset), although try-catch blocks are also frequently used (51.200 ...