Identifying classes in legacy javaScript code
| Ano de defesa: | 2017 |
|---|---|
| Autor(a) principal: | |
| Orientador(a): | |
| Banca de defesa: | |
| Tipo de documento: | Tese |
| Tipo de acesso: | Acesso aberto |
| Idioma: | eng |
| Instituição de defesa: |
Universidade Federal de Minas Gerais
|
| Programa de Pós-Graduação: |
Não Informado pela instituição
|
| Departamento: |
Não Informado pela instituição
|
| País: |
Não Informado pela instituição
|
| Palavras-chave em Português: | |
| Link de acesso: | https://hdl.handle.net/1843/JCES-ATKN9X |
Resumo: | JavaScript is the most popular programming language for the Web. Although the language is prototype-based, developers often emulate class-based abstractions in JavaScript to master the increasing complexity of their applications. Identifying structures similar to classes in JavaScript code can support these developers in the following activities: (i) program comprehension; (ii) migration to the new JavaScript syntax that supports classes, introduced by ECMAScript 6 (ES6); and (iii) implementation of supporting tools, including IDEs with class-based views and reverse engineering tools. In this thesis, we dene, implement, and evaluate a set of heuristics to identify class-like structures, and their dependencies, in legacy JavaScript code, i.e., code implemented in versions prior to ES6. We report on a large and in-depth study to understand how class emulation is employed, using a dataset of 918 JavaScript applications available on GitHub. We found evidence that structures emulating classes are present in almost 70% of the studied systems. We perform a eld study with 60 developers to evaluate the accuracy of our strategy and tool. The results indicate that our tool is able to identify class-like structures in legacy JavaScript systems. We also demonstrate how to use a static type-checker to infer types that correspond to class references. We perform a study with two open-source applications aiming to measure the accuracy of the proposed approach to identify class-to-class dependencies. We achieve precision of 100% in both systems, and the values of recall ranges from 80% to 86% for dependencies in general and from 85% to 96% for associations. Moreover, we present a set of rules to migrate class-like structures to use the new ES6 class syntax. In our study, we detail cases that are straightforward to migrate (the good parts), cases that require manual and ad-hoc migration (the bad parts), and cases that cannot be migrated due to limitations and restrictions of ES6 (the ugly parts). Finally, we present a set of reasons that can lead developers to postpone or reject the adoption of ES6 classes, based on the feedback received after submitting pull requests suggesting the migration |
| id |
UFMG_b696008672eb00501dee64e30dd09722 |
|---|---|
| oai_identifier_str |
oai:repositorio.ufmg.br:1843/JCES-ATKN9X |
| network_acronym_str |
UFMG |
| network_name_str |
Repositório Institucional da UFMG |
| repository_id_str |
|
| spelling |
Identifying classes in legacy javaScript codeReengenhariaComputaçãoEngenharia reversaCompreensão de programasJavaScript (Linguagem de programação de computador)Compreensão de programasEngenharia reversaJavascriptJavaScript is the most popular programming language for the Web. Although the language is prototype-based, developers often emulate class-based abstractions in JavaScript to master the increasing complexity of their applications. Identifying structures similar to classes in JavaScript code can support these developers in the following activities: (i) program comprehension; (ii) migration to the new JavaScript syntax that supports classes, introduced by ECMAScript 6 (ES6); and (iii) implementation of supporting tools, including IDEs with class-based views and reverse engineering tools. In this thesis, we dene, implement, and evaluate a set of heuristics to identify class-like structures, and their dependencies, in legacy JavaScript code, i.e., code implemented in versions prior to ES6. We report on a large and in-depth study to understand how class emulation is employed, using a dataset of 918 JavaScript applications available on GitHub. We found evidence that structures emulating classes are present in almost 70% of the studied systems. We perform a eld study with 60 developers to evaluate the accuracy of our strategy and tool. The results indicate that our tool is able to identify class-like structures in legacy JavaScript systems. We also demonstrate how to use a static type-checker to infer types that correspond to class references. We perform a study with two open-source applications aiming to measure the accuracy of the proposed approach to identify class-to-class dependencies. We achieve precision of 100% in both systems, and the values of recall ranges from 80% to 86% for dependencies in general and from 85% to 96% for associations. Moreover, we present a set of rules to migrate class-like structures to use the new ES6 class syntax. In our study, we detail cases that are straightforward to migrate (the good parts), cases that require manual and ad-hoc migration (the bad parts), and cases that cannot be migrated due to limitations and restrictions of ES6 (the ugly parts). Finally, we present a set of reasons that can lead developers to postpone or reject the adoption of ES6 classes, based on the feedback received after submitting pull requests suggesting the migrationUniversidade Federal de Minas Gerais2019-08-11T07:56:25Z2025-09-09T00:08:43Z2019-08-11T07:56:25Z2017-09-15info:eu-repo/semantics/publishedVersioninfo:eu-repo/semantics/doctoralThesisapplication/pdfhttps://hdl.handle.net/1843/JCES-ATKN9XLeonardo Humberto Guimar?es Silvainfo:eu-repo/semantics/openAccessengreponame:Repositório Institucional da UFMGinstname:Universidade Federal de Minas Gerais (UFMG)instacron:UFMG2025-09-09T00:08:43Zoai:repositorio.ufmg.br:1843/JCES-ATKN9XRepositório InstitucionalPUBhttps://repositorio.ufmg.br/oairepositorio@ufmg.bropendoar:2025-09-09T00:08:43Repositório Institucional da UFMG - Universidade Federal de Minas Gerais (UFMG)false |
| dc.title.none.fl_str_mv |
Identifying classes in legacy javaScript code |
| title |
Identifying classes in legacy javaScript code |
| spellingShingle |
Identifying classes in legacy javaScript code Leonardo Humberto Guimar?es Silva Reengenharia Computação Engenharia reversa Compreensão de programas JavaScript (Linguagem de programação de computador) Compreensão de programas Engenharia reversa Javascript |
| title_short |
Identifying classes in legacy javaScript code |
| title_full |
Identifying classes in legacy javaScript code |
| title_fullStr |
Identifying classes in legacy javaScript code |
| title_full_unstemmed |
Identifying classes in legacy javaScript code |
| title_sort |
Identifying classes in legacy javaScript code |
| author |
Leonardo Humberto Guimar?es Silva |
| author_facet |
Leonardo Humberto Guimar?es Silva |
| author_role |
author |
| dc.contributor.author.fl_str_mv |
Leonardo Humberto Guimar?es Silva |
| dc.subject.por.fl_str_mv |
Reengenharia Computação Engenharia reversa Compreensão de programas JavaScript (Linguagem de programação de computador) Compreensão de programas Engenharia reversa Javascript |
| topic |
Reengenharia Computação Engenharia reversa Compreensão de programas JavaScript (Linguagem de programação de computador) Compreensão de programas Engenharia reversa Javascript |
| description |
JavaScript is the most popular programming language for the Web. Although the language is prototype-based, developers often emulate class-based abstractions in JavaScript to master the increasing complexity of their applications. Identifying structures similar to classes in JavaScript code can support these developers in the following activities: (i) program comprehension; (ii) migration to the new JavaScript syntax that supports classes, introduced by ECMAScript 6 (ES6); and (iii) implementation of supporting tools, including IDEs with class-based views and reverse engineering tools. In this thesis, we dene, implement, and evaluate a set of heuristics to identify class-like structures, and their dependencies, in legacy JavaScript code, i.e., code implemented in versions prior to ES6. We report on a large and in-depth study to understand how class emulation is employed, using a dataset of 918 JavaScript applications available on GitHub. We found evidence that structures emulating classes are present in almost 70% of the studied systems. We perform a eld study with 60 developers to evaluate the accuracy of our strategy and tool. The results indicate that our tool is able to identify class-like structures in legacy JavaScript systems. We also demonstrate how to use a static type-checker to infer types that correspond to class references. We perform a study with two open-source applications aiming to measure the accuracy of the proposed approach to identify class-to-class dependencies. We achieve precision of 100% in both systems, and the values of recall ranges from 80% to 86% for dependencies in general and from 85% to 96% for associations. Moreover, we present a set of rules to migrate class-like structures to use the new ES6 class syntax. In our study, we detail cases that are straightforward to migrate (the good parts), cases that require manual and ad-hoc migration (the bad parts), and cases that cannot be migrated due to limitations and restrictions of ES6 (the ugly parts). Finally, we present a set of reasons that can lead developers to postpone or reject the adoption of ES6 classes, based on the feedback received after submitting pull requests suggesting the migration |
| publishDate |
2017 |
| dc.date.none.fl_str_mv |
2017-09-15 2019-08-11T07:56:25Z 2019-08-11T07:56:25Z 2025-09-09T00:08:43Z |
| dc.type.status.fl_str_mv |
info:eu-repo/semantics/publishedVersion |
| dc.type.driver.fl_str_mv |
info:eu-repo/semantics/doctoralThesis |
| format |
doctoralThesis |
| status_str |
publishedVersion |
| dc.identifier.uri.fl_str_mv |
https://hdl.handle.net/1843/JCES-ATKN9X |
| url |
https://hdl.handle.net/1843/JCES-ATKN9X |
| dc.language.iso.fl_str_mv |
eng |
| language |
eng |
| dc.rights.driver.fl_str_mv |
info:eu-repo/semantics/openAccess |
| eu_rights_str_mv |
openAccess |
| dc.format.none.fl_str_mv |
application/pdf |
| dc.publisher.none.fl_str_mv |
Universidade Federal de Minas Gerais |
| publisher.none.fl_str_mv |
Universidade Federal de Minas Gerais |
| dc.source.none.fl_str_mv |
reponame:Repositório Institucional da UFMG instname:Universidade Federal de Minas Gerais (UFMG) instacron:UFMG |
| instname_str |
Universidade Federal de Minas Gerais (UFMG) |
| instacron_str |
UFMG |
| institution |
UFMG |
| reponame_str |
Repositório Institucional da UFMG |
| collection |
Repositório Institucional da UFMG |
| repository.name.fl_str_mv |
Repositório Institucional da UFMG - Universidade Federal de Minas Gerais (UFMG) |
| repository.mail.fl_str_mv |
repositorio@ufmg.br |
| _version_ |
1856414046404739072 |