Refactoring graphs: reasoning about refactoring over time

Bibliographic Details
Main Author: Aline Norberta de Brito
Publication Date: 2023
Format: Doctoral thesis
Language: eng
Source: Repositório Institucional da UFMG
Download full: http://hdl.handle.net/1843/56371
https://orcid.org/0000-0002-7088-4935
Summary: Frequently, practitioners refactor their code, producing new entities or changing the structure of existing ones. Sometimes, these transformations are performed in a constrained time frame. In other cases, they generate sequences of modifications performed over a long time period, a scenario not usually considered in the literature. In this context, the main goal of this Ph.D. thesis is to characterize and understand refactoring operations performed over time. For this purpose, we introduce a novel abstraction for reasoning about refactorings, named refactoring graphs. In this graph-based abstraction, nodes represent methods or functions, and edges refer to refactoring operations. We organize the research into three major working units. We start by defining the proposed abstraction, describing the elements and providing a set of scripts to detect refactoring graphs in real-world projects. Then, in the second working unit, we characterize about 1.5K refactoring subgraphs from popular Java and JavaScript projects hosted on GitHub. The results confirmed our hypothesis that refactorings are not only sole operations. There are also sequences of transformations performed over time. Besides, we also perform a qualitative study, in which we contact developers responsible by subgraphs describing large operations, aiming to identify their main reasons to perform such operations. Finally, in the last working unit, we explore applications of the proposed graph-based model. First, we evaluate refactoring tasks performed by undergraduate students from a Software Engineering course, relying on refactoring graphs to understand and inspect the operations. In other words, we assume a professor's perspective who needs to understand practical exercises on refactoring. We also propose a catalog of common refactorings performed over time, which we decide to call composite refactorings. We rely on refactoring graphs to document and illustrate instances of composites detected in an oracle with hundreds of operations and in the history of popular projects hosted on GitHub.
id UFMG_a09038fed1ae1c93e22771b3128607d3
oai_identifier_str oai:repositorio.ufmg.br:1843/56371
network_acronym_str UFMG
network_name_str Repositório Institucional da UFMG
repository_id_str
spelling Marco Tulio de Oliveira Valentehttp://lattes.cnpq.br/2147157840592913André Cavalcante HoraElisa Yumi NakagawaFernando José Castor de Lima FilhoEduardo Magno Lages FigueiredoTayana Uchôa Contehttp://lattes.cnpq.br/5513766633619869Aline Norberta de Brito2023-07-17T12:51:58Z2023-07-17T12:51:58Z2023-03-10http://hdl.handle.net/1843/56371https://orcid.org/0000-0002-7088-4935Frequently, practitioners refactor their code, producing new entities or changing the structure of existing ones. Sometimes, these transformations are performed in a constrained time frame. In other cases, they generate sequences of modifications performed over a long time period, a scenario not usually considered in the literature. In this context, the main goal of this Ph.D. thesis is to characterize and understand refactoring operations performed over time. For this purpose, we introduce a novel abstraction for reasoning about refactorings, named refactoring graphs. In this graph-based abstraction, nodes represent methods or functions, and edges refer to refactoring operations. We organize the research into three major working units. We start by defining the proposed abstraction, describing the elements and providing a set of scripts to detect refactoring graphs in real-world projects. Then, in the second working unit, we characterize about 1.5K refactoring subgraphs from popular Java and JavaScript projects hosted on GitHub. The results confirmed our hypothesis that refactorings are not only sole operations. There are also sequences of transformations performed over time. Besides, we also perform a qualitative study, in which we contact developers responsible by subgraphs describing large operations, aiming to identify their main reasons to perform such operations. Finally, in the last working unit, we explore applications of the proposed graph-based model. First, we evaluate refactoring tasks performed by undergraduate students from a Software Engineering course, relying on refactoring graphs to understand and inspect the operations. In other words, we assume a professor's perspective who needs to understand practical exercises on refactoring. We also propose a catalog of common refactorings performed over time, which we decide to call composite refactorings. We rely on refactoring graphs to document and illustrate instances of composites detected in an oracle with hundreds of operations and in the history of popular projects hosted on GitHub.Frequentemente, desenvolvedores refatoram o código, criando novas entidades ou alterando estruturas existentes. Algumas vezes, estas operações são realizadas em um curto período. Em outros casos, as operações geram sequências de modificações realizadas ao longo do tempo, um cenário que usualmente não é considerado na literatura. Neste contexto, o principal objetivo deste trabalho é caracterizar e compreender refatorações realizadas ao longo do tempo. Para tanto, propõe-se uma nova abstração denominada grafos de refatoração (refactoring graphs). Neste modelo baseado em grafos, os vértices representam métodos ou funções e as arestas referem-se às operações de refatoração. Esta pesquisa está organizada em três grandes trabalhos. Inicialmente, define-se a abstração proposta, descrevendo os principais elementos e provendo um conjunto de scripts que permite a detecção de grafos de refatoração em sistemas de software reais. Em seguida, na segunda unidade de trabalho, caracteriza-se aproximadamente 1,5 mil grafos de refatoração provenientes de projetos Java e JavaScript populares hospedados no GitHub. Os resultados confirmam que as refatorações não são apenas operações únicas, mas também sequências de transformações realizadas ao longo do tempo. Além disso, um estudo qualitativo é realizado, no qual contactou-se os desenvolvedores responsáveis por subgrafos que descrevem grandes operações, visando identificar as suas principais motivações. Por fim, na última unidade de trabalho, explora-se aplicações para a abstração proposta na tese. Inicialmente, avalia-se operações realizadas por alunos de uma disciplina de Engenharia de Software, contando com os grafos de refatoração para compreender e inspecionar as operações. Logo, assume-se a perspectiva de professor que almeja entender atividades práticas neste contexto. Além disso, propõe-se um catálogo de refatorações comumente realizadas ao longo do tempo, denominadas refatorações compostas. Os grafos de refatoração são utilizados para documentar e ilustrar instâncias do catálogo detectadas em um oráculo com centenas de refatorações e no histórico de projetos populares hospedados no GitHub.CNPq - Conselho Nacional de Desenvolvimento Científico e TecnológicoFAPEMIG - Fundação de Amparo à Pesquisa do Estado de Minas GeraisCAPES - Coordenação de Aperfeiçoamento de Pessoal de Nível SuperiorengUniversidade Federal de Minas GeraisPrograma de Pós-Graduação em Ciência da ComputaçãoUFMGBrasilICX - DEPARTAMENTO DE CIÊNCIA DA COMPUTAÇÃOComputação – TesesEngenharia de software – TesesGrafos de refatoração – TesesMineração de repositórios de software – TesesRefactoringRefactoring graphsMining software repositoriesSoftware evolutionRefactoring graphs: reasoning about refactoring over timeinfo:eu-repo/semantics/publishedVersioninfo:eu-repo/semantics/doctoralThesisinfo:eu-repo/semantics/openAccessreponame:Repositório Institucional da UFMGinstname:Universidade Federal de Minas Gerais (UFMG)instacron:UFMGLICENSElicense.txtlicense.txttext/plain; charset=utf-82118https://repositorio.ufmg.br/bitstream/1843/56371/4/license.txtcda590c95a0b51b4d15f60c9642ca272MD54ORIGINALRefactoring graphs: reasoning about refactoring over time.pdfRefactoring graphs: reasoning about refactoring over time.pdfapplication/pdf18383711https://repositorio.ufmg.br/bitstream/1843/56371/3/Refactoring%20graphs%3a%20reasoning%20about%20refactoring%20over%20time.pdf041ae67b5cb6282c89099fb001b7f1f8MD531843/563712023-07-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ugbm8gY29udGXDumRvIGRhIHB1YmxpY2HDp8OjbyBvcmEgZGVwb3NpdGFkYS4KCkNBU08gQSBQVUJMSUNBw4fDg08gT1JBIERFUE9TSVRBREEgVEVOSEEgU0lETyBSRVNVTFRBRE8gREUgVU0gUEFUUk9Dw41OSU8gT1UgQVBPSU8gREUgVU1BIEFHw4pOQ0lBIERFIEZPTUVOVE8gT1UgT1VUUk8gT1JHQU5JU01PLCBWT0PDiiBERUNMQVJBIFFVRSBSRVNQRUlUT1UgVE9ET1MgRSBRVUFJU1FVRVIgRElSRUlUT1MgREUgUkVWSVPDg08gQ09NTyBUQU1Cw4lNIEFTIERFTUFJUyBPQlJJR0HDh8OVRVMgRVhJR0lEQVMgUE9SIENPTlRSQVRPIE9VIEFDT1JETy4KCk8gUmVwb3NpdMOzcmlvIEluc3RpdHVjaW9uYWwgZGEgVUZNRyBzZSBjb21wcm9tZXRlIGEgaWRlbnRpZmljYXIgY2xhcmFtZW50ZSBvIHNldSBub21lKHMpIG91IG8ocykgbm9tZXMocykgZG8ocykgZGV0ZW50b3IoZXMpIGRvcyBkaXJlaXRvcyBhdXRvcmFpcyBkYSBwdWJsaWNhw6fDo28sIGUgbsOjbyBmYXLDoSBxdWFscXVlciBhbHRlcmHDp8OjbywgYWzDqW0gZGFxdWVsYXMgY29uY2VkaWRhcyBwb3IgZXN0YSBsaWNlbsOnYS4KRepositório de PublicaçõesPUBhttps://repositorio.ufmg.br/oaiopendoar:2023-07-17T12:51:59Repositório Institucional da UFMG - Universidade Federal de Minas Gerais (UFMG)false
dc.title.pt_BR.fl_str_mv Refactoring graphs: reasoning about refactoring over time
title Refactoring graphs: reasoning about refactoring over time
spellingShingle Refactoring graphs: reasoning about refactoring over time
Aline Norberta de Brito
Refactoring
Refactoring graphs
Mining software repositories
Software evolution
Computação – Teses
Engenharia de software – Teses
Grafos de refatoração – Teses
Mineração de repositórios de software – Teses
title_short Refactoring graphs: reasoning about refactoring over time
title_full Refactoring graphs: reasoning about refactoring over time
title_fullStr Refactoring graphs: reasoning about refactoring over time
title_full_unstemmed Refactoring graphs: reasoning about refactoring over time
title_sort Refactoring graphs: reasoning about refactoring over time
author Aline Norberta de Brito
author_facet Aline Norberta de Brito
author_role author
dc.contributor.advisor1.fl_str_mv Marco Tulio de Oliveira Valente
dc.contributor.advisor1Lattes.fl_str_mv http://lattes.cnpq.br/2147157840592913
dc.contributor.advisor-co1.fl_str_mv André Cavalcante Hora
dc.contributor.referee1.fl_str_mv Elisa Yumi Nakagawa
dc.contributor.referee2.fl_str_mv Fernando José Castor de Lima Filho
dc.contributor.referee3.fl_str_mv Eduardo Magno Lages Figueiredo
dc.contributor.referee4.fl_str_mv Tayana Uchôa Conte
dc.contributor.authorLattes.fl_str_mv http://lattes.cnpq.br/5513766633619869
dc.contributor.author.fl_str_mv Aline Norberta de Brito
contributor_str_mv Marco Tulio de Oliveira Valente
André Cavalcante Hora
Elisa Yumi Nakagawa
Fernando José Castor de Lima Filho
Eduardo Magno Lages Figueiredo
Tayana Uchôa Conte
dc.subject.por.fl_str_mv Refactoring
Refactoring graphs
Mining software repositories
Software evolution
topic Refactoring
Refactoring graphs
Mining software repositories
Software evolution
Computação – Teses
Engenharia de software – Teses
Grafos de refatoração – Teses
Mineração de repositórios de software – Teses
dc.subject.other.pt_BR.fl_str_mv Computação – Teses
Engenharia de software – Teses
Grafos de refatoração – Teses
Mineração de repositórios de software – Teses
description Frequently, practitioners refactor their code, producing new entities or changing the structure of existing ones. Sometimes, these transformations are performed in a constrained time frame. In other cases, they generate sequences of modifications performed over a long time period, a scenario not usually considered in the literature. In this context, the main goal of this Ph.D. thesis is to characterize and understand refactoring operations performed over time. For this purpose, we introduce a novel abstraction for reasoning about refactorings, named refactoring graphs. In this graph-based abstraction, nodes represent methods or functions, and edges refer to refactoring operations. We organize the research into three major working units. We start by defining the proposed abstraction, describing the elements and providing a set of scripts to detect refactoring graphs in real-world projects. Then, in the second working unit, we characterize about 1.5K refactoring subgraphs from popular Java and JavaScript projects hosted on GitHub. The results confirmed our hypothesis that refactorings are not only sole operations. There are also sequences of transformations performed over time. Besides, we also perform a qualitative study, in which we contact developers responsible by subgraphs describing large operations, aiming to identify their main reasons to perform such operations. Finally, in the last working unit, we explore applications of the proposed graph-based model. First, we evaluate refactoring tasks performed by undergraduate students from a Software Engineering course, relying on refactoring graphs to understand and inspect the operations. In other words, we assume a professor's perspective who needs to understand practical exercises on refactoring. We also propose a catalog of common refactorings performed over time, which we decide to call composite refactorings. We rely on refactoring graphs to document and illustrate instances of composites detected in an oracle with hundreds of operations and in the history of popular projects hosted on GitHub.
publishDate 2023
dc.date.accessioned.fl_str_mv 2023-07-17T12:51:58Z
dc.date.available.fl_str_mv 2023-07-17T12:51:58Z
dc.date.issued.fl_str_mv 2023-03-10
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 http://hdl.handle.net/1843/56371
dc.identifier.orcid.pt_BR.fl_str_mv https://orcid.org/0000-0002-7088-4935
url http://hdl.handle.net/1843/56371
https://orcid.org/0000-0002-7088-4935
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.publisher.none.fl_str_mv Universidade Federal de Minas Gerais
dc.publisher.program.fl_str_mv Programa de Pós-Graduação em Ciência da Computação
dc.publisher.initials.fl_str_mv UFMG
dc.publisher.country.fl_str_mv Brasil
dc.publisher.department.fl_str_mv ICX - DEPARTAMENTO DE CIÊNCIA DA COMPUTAÇÃO
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
bitstream.url.fl_str_mv https://repositorio.ufmg.br/bitstream/1843/56371/4/license.txt
https://repositorio.ufmg.br/bitstream/1843/56371/3/Refactoring%20graphs%3a%20reasoning%20about%20refactoring%20over%20time.pdf
bitstream.checksum.fl_str_mv cda590c95a0b51b4d15f60c9642ca272
041ae67b5cb6282c89099fb001b7f1f8
bitstream.checksumAlgorithm.fl_str_mv MD5
MD5
repository.name.fl_str_mv Repositório Institucional da UFMG - Universidade Federal de Minas Gerais (UFMG)
repository.mail.fl_str_mv
_version_ 1797971112950235136