A study of JavaScript error handling

Detalhes bibliográficos
Autor(a) principal: SANTOS, Luana Martins dos
Data de Publicação: 2019
Tipo de documento: Dissertação
Idioma: eng
Título da fonte: Repositório Institucional da UFPE
Texto Completo: https://repositorio.ufpe.br/handle/123456789/34149
Resumo: LIMA FILHO, Fernando José Castor de, também é conhecido(a) em citações bibliográficas por: CASTOR FILHO, Fernando
id UFPE_6380a3119aeea0596c5308d1baaac253
oai_identifier_str oai:repositorio.ufpe.br:123456789/34149
network_acronym_str UFPE
network_name_str Repositório Institucional da UFPE
repository_id_str 2221
spelling SANTOS, Luana Martins doshttp://lattes.cnpq.br/6282326953631561http://lattes.cnpq.br/7310046838140771LIMA FILHO, Fernando José Castor de2019-10-03T18:27:26Z2019-10-03T18:27:26Z2019-02-14https://repositorio.ufpe.br/handle/123456789/34149LIMA FILHO, Fernando José Castor de, também é conhecido(a) em citações bibliográficas por: CASTOR FILHO, FernandoJavaScript 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 try-catch blocks). We found 22.44% of the try-catch blocks are empty, 15.48% of the error handlers ignore the error parameter (from catch clause). In callback functions, 8.66% ignore any error parameter it receives, and 5.54% reassign an error parameter. Web-based systems have a greater number of try-catch blocks than callback functions for error handling compared to standalone systems. Web-based systems have a greater number of handlers that ignore error parameters than standalone systems. In summary, our analysis shows that error-handling strategies are generally simplistic, mostly ignoring the error (11.5%) or leaving it empty (8.22%).JavaScript é amplamente usado para desenvolvimento de software tanto em sistemas Web-based quanto Standalone. Existe uma grande quantidade de sistemas desenvolvidos nessa linguagem. Devido à sua popularidade, o JavaScript tem sido objeto de vários estudos empíricos nos últimos anos. Pesquisas anteriores analisaram o uso da função eval, assim como callback functions e outros aspectos da linguagem. Neste trabalho, estudamos como os desenvolvedores empregam mecanismos de tratamento de erros em sistemas JavaScript. JavaScript fornece dois mecanismos diferentes para tratar erros: blocos try-catch e callback functions. Esses mecanismos são empregados em conjunto com um número de abstrações que não foram estudadas anteriormente no contexto do tratamento de erros, a saber: promises, eventos e funções asíncronas. Além disso, avaliamos o uso de tratadores de eventos globais, que é aplicável a cenários nos quais ocorreu um erro para o qual nenhum tratador foi encontrado. Analisamos 192 repositórios populares de JavaScript do Github, com mais de 60 mil arquivos e 11 milhões de linhas de código. Também os classificamos como Web-based ou Standalone, dependendo do uso do framework Node.js. Analisamos como os mecanismos de tratamento de erros da linguagem são empregados, quais estratégias de tratamento de erros são normalmente usadas e como os sistemas Web-based e Standalone diferem em relação ao tratamento de erros. Erros impactam diferentemente em sistemas Web-based e Standalone. Os usuários não percebem imediatamente erros ocorridos em sistemas Web-based, por geralmente aparecerem no console. Sistemas Standalone lidam de maneira diferente com erros, pois uma vez que o sistema encontra um erro, ele falha, não permitindo qualquer operação adicional. Nossas descobertas indicam que callbacks functions são o mecanismo predominante de tratamento de erros de sistemas JavaScript (existem 64,500 callbacks functions em nosso conjunto de dados), embora blocos try-catch também sejam usados com frequência (51,200 blocos try-catch). Encontramos que 22.44% dos blocos try-catch estão vazios, 15.48% dos tratadores de erro ignoram o parâmetro de erro (catch clause). Em callback functions, 8.66% ignoram qualquer parâmetro de erro que a função recebe, e 5.54% reatribuem um parâmetro de erro (como o argumento de erro de uma catch clause ou o argumento de uma callback function) a algum outro valor. Os sistemas Web-based possuem um maior número de blocos try-catch do que callback functions para tratamento de erros, em comparação com os sistemas Standalone. Os sistemas Web-based apresentam um maior número de tratadores que ignoram os parâmetros de erro do que sistemas Standalone. Em resumo, nossa análise mostra que as estratégias de tratamento de erros geralmente são simplistas, envolvendo principalmente ignorar o erro (11.5%) ou deixá-lo vazio (8.22%).engUniversidade Federal de PernambucoPrograma de Pos Graduacao em Ciencia da ComputacaoUFPEBrasilAttribution-NonCommercial-NoDerivs 3.0 Brazilhttp://creativecommons.org/licenses/by-nc-nd/3.0/br/info:eu-repo/semantics/openAccessEngenharia de softwareTratamento de errosA study of JavaScript error handlinginfo:eu-repo/semantics/publishedVersioninfo:eu-repo/semantics/masterThesismestradoreponame:Repositório Institucional da UFPEinstname:Universidade Federal de Pernambuco (UFPE)instacron:UFPETHUMBNAILDISSERTAÇÃO Luana Martins dos Santos.pdf.jpgDISSERTAÇÃO Luana Martins dos Santos.pdf.jpgGenerated Thumbnailimage/jpeg1216https://repositorio.ufpe.br/bitstream/123456789/34149/5/DISSERTA%c3%87%c3%83O%20Luana%20Martins%20dos%20Santos.pdf.jpg00afde144f2520efbdaa8d575f6c359cMD55ORIGINALDISSERTAÇÃO Luana Martins dos Santos.pdfDISSERTAÇÃO Luana Martins dos Santos.pdfapplication/pdf966385https://repositorio.ufpe.br/bitstream/123456789/34149/1/DISSERTA%c3%87%c3%83O%20Luana%20Martins%20dos%20Santos.pdf44786314bc4b002c61427581e8116b8cMD51CC-LICENSElicense_rdflicense_rdfapplication/rdf+xml; charset=utf-8811https://repositorio.ufpe.br/bitstream/123456789/34149/2/license_rdfe39d27027a6cc9cb039ad269a5db8e34MD52LICENSElicense.txtlicense.txttext/plain; charset=utf-82310https://repositorio.ufpe.br/bitstream/123456789/34149/3/license.txtbd573a5ca8288eb7272482765f819534MD53TEXTDISSERTAÇÃO Luana Martins dos Santos.pdf.txtDISSERTAÇÃO Luana Martins dos Santos.pdf.txtExtracted texttext/plain155182https://repositorio.ufpe.br/bitstream/123456789/34149/4/DISSERTA%c3%87%c3%83O%20Luana%20Martins%20dos%20Santos.pdf.txtb93595c440487170fcd4227820b763e8MD54123456789/341492021-07-19 16:08:48.126oai:repositorio.ufpe.br:123456789/34149TGljZW7Dp2EgZGUgRGlzdHJpYnVpw6fDo28gTsOjbyBFeGNsdXNpdmEKClRvZG8gZGVwb3NpdGFudGUgZGUgbWF0ZXJpYWwgbm8gUmVwb3NpdMOzcmlvIEluc3RpdHVjaW9uYWwgKFJJKSBkZXZlIGNvbmNlZGVyLCDDoCBVbml2ZXJzaWRhZGUgRmVkZXJhbCBkZSBQZXJuYW1idWNvIChVRlBFKSwgdW1hIExpY2Vuw6dhIGRlIERpc3RyaWJ1acOnw6NvIE7Do28gRXhjbHVzaXZhIHBhcmEgbWFudGVyIGUgdG9ybmFyIGFjZXNzw612ZWlzIG9zIHNldXMgZG9jdW1lbnRvcywgZW0gZm9ybWF0byBkaWdpdGFsLCBuZXN0ZSByZXBvc2l0w7NyaW8uCgpDb20gYSBjb25jZXNzw6NvIGRlc3RhIGxpY2Vuw6dhIG7Do28gZXhjbHVzaXZhLCBvIGRlcG9zaXRhbnRlIG1hbnTDqW0gdG9kb3Mgb3MgZGlyZWl0b3MgZGUgYXV0b3IuCl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXwoKTGljZW7Dp2EgZGUgRGlzdHJpYnVpw6fDo28gTsOjbyBFeGNsdXNpdmEKCkFvIGNvbmNvcmRhciBjb20gZXN0YSBsaWNlbsOnYSBlIGFjZWl0w6EtbGEsIHZvY8OqIChhdXRvciBvdSBkZXRlbnRvciBkb3MgZGlyZWl0b3MgYXV0b3JhaX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G9yIChlcykgZG9zIGRpcmVpdG9zIGRvIGRvY3VtZW50byBlbnRyZWd1ZSBlIG7Do28gZmFyw6EgcXVhbHF1ZXIgYWx0ZXJhw6fDo28sIHBhcmEgYWzDqW0gZG8gcHJldmlzdG8gbmEgYWzDrW5lYSBjKS4KRepositório InstitucionalPUBhttps://repositorio.ufpe.br/oai/requestattena@ufpe.bropendoar:22212021-07-19T19:08:48Repositório Institucional da UFPE - Universidade Federal de Pernambuco (UFPE)false
dc.title.pt_BR.fl_str_mv A study of JavaScript error handling
title A study of JavaScript error handling
spellingShingle A study of JavaScript error handling
SANTOS, Luana Martins dos
Engenharia de software
Tratamento de erros
title_short A study of JavaScript error handling
title_full A study of JavaScript error handling
title_fullStr A study of JavaScript error handling
title_full_unstemmed A study of JavaScript error handling
title_sort A study of JavaScript error handling
author SANTOS, Luana Martins dos
author_facet SANTOS, Luana Martins dos
author_role author
dc.contributor.authorLattes.pt_BR.fl_str_mv http://lattes.cnpq.br/6282326953631561
dc.contributor.advisorLattes.pt_BR.fl_str_mv http://lattes.cnpq.br/7310046838140771
dc.contributor.author.fl_str_mv SANTOS, Luana Martins dos
dc.contributor.advisor1.fl_str_mv LIMA FILHO, Fernando José Castor de
contributor_str_mv LIMA FILHO, Fernando José Castor de
dc.subject.por.fl_str_mv Engenharia de software
Tratamento de erros
topic Engenharia de software
Tratamento de erros
description LIMA FILHO, Fernando José Castor de, também é conhecido(a) em citações bibliográficas por: CASTOR FILHO, Fernando
publishDate 2019
dc.date.accessioned.fl_str_mv 2019-10-03T18:27:26Z
dc.date.available.fl_str_mv 2019-10-03T18:27:26Z
dc.date.issued.fl_str_mv 2019-02-14
dc.type.status.fl_str_mv info:eu-repo/semantics/publishedVersion
dc.type.driver.fl_str_mv info:eu-repo/semantics/masterThesis
format masterThesis
status_str publishedVersion
dc.identifier.uri.fl_str_mv https://repositorio.ufpe.br/handle/123456789/34149
url https://repositorio.ufpe.br/handle/123456789/34149
dc.language.iso.fl_str_mv eng
language eng
dc.rights.driver.fl_str_mv Attribution-NonCommercial-NoDerivs 3.0 Brazil
http://creativecommons.org/licenses/by-nc-nd/3.0/br/
info:eu-repo/semantics/openAccess
rights_invalid_str_mv Attribution-NonCommercial-NoDerivs 3.0 Brazil
http://creativecommons.org/licenses/by-nc-nd/3.0/br/
eu_rights_str_mv openAccess
dc.publisher.none.fl_str_mv Universidade Federal de Pernambuco
dc.publisher.program.fl_str_mv Programa de Pos Graduacao em Ciencia da Computacao
dc.publisher.initials.fl_str_mv UFPE
dc.publisher.country.fl_str_mv Brasil
publisher.none.fl_str_mv Universidade Federal de Pernambuco
dc.source.none.fl_str_mv reponame:Repositório Institucional da UFPE
instname:Universidade Federal de Pernambuco (UFPE)
instacron:UFPE
instname_str Universidade Federal de Pernambuco (UFPE)
instacron_str UFPE
institution UFPE
reponame_str Repositório Institucional da UFPE
collection Repositório Institucional da UFPE
bitstream.url.fl_str_mv https://repositorio.ufpe.br/bitstream/123456789/34149/5/DISSERTA%c3%87%c3%83O%20Luana%20Martins%20dos%20Santos.pdf.jpg
https://repositorio.ufpe.br/bitstream/123456789/34149/1/DISSERTA%c3%87%c3%83O%20Luana%20Martins%20dos%20Santos.pdf
https://repositorio.ufpe.br/bitstream/123456789/34149/2/license_rdf
https://repositorio.ufpe.br/bitstream/123456789/34149/3/license.txt
https://repositorio.ufpe.br/bitstream/123456789/34149/4/DISSERTA%c3%87%c3%83O%20Luana%20Martins%20dos%20Santos.pdf.txt
bitstream.checksum.fl_str_mv 00afde144f2520efbdaa8d575f6c359c
44786314bc4b002c61427581e8116b8c
e39d27027a6cc9cb039ad269a5db8e34
bd573a5ca8288eb7272482765f819534
b93595c440487170fcd4227820b763e8
bitstream.checksumAlgorithm.fl_str_mv MD5
MD5
MD5
MD5
MD5
repository.name.fl_str_mv Repositório Institucional da UFPE - Universidade Federal de Pernambuco (UFPE)
repository.mail.fl_str_mv attena@ufpe.br
_version_ 1802310742969417728