Smart Prediction for Test Smells Refactorings

Nome completo do aluno

 

Luana Almeida Martins

 

Título do trabalho

 

Smart prediction for test smells refactorings

 

Resumo do trabalho

 

Test smells are considered bad practices for developing the test code. Their presence can reduce the test code quality, thus harming software testing and maintenance activities. Software refactoring has been a key practice to handle smells and improve software quality without changing its behavior. However, existing refactoring tools target production code with very different characteristics than test code. Despite the research invested in test smell refactoring, little is known about whether current refactorings improve the test code quality. This thesis proposal presents our research to help developers decide when and how to refactor test smells through a machine learning-based approach. First, we aim to mine refactorings performed by developers to derive a catalog of test-specific refactorings and their impact on the test code. Our findings show that developers prefer specific features of the testing frameworks, which may lead to test smells such as Inappropriate Assertion and Handling Exceptions. While the refactorings proposed in the literature aligned with the evolution of testing frameworks to help refactor test smells, the Inappropriate Assertion remains unexplored in the literature. Second, we aim to understand whether developers target low-quality test codes to perform refactorings and the effects of refactorings on test code quality improvement. Our findings show that low-quality test code, especially regarding structural metrics, is more likely to undergo refactorings. Common refactorings between test and production code contribute more to improving test code quality in terms of cohesion, size, and complexity. Test-specific refactorings enhance quality concerning the resolution of test smells. Third, we aim to learn whether developers would perform refactorings and which refactorings they would apply to improve the test code quality. Results indicate that the accuracy of Support Vector Machines models varies between 30\% and 100\% in different projects for detecting when a developer would perform a refactoring. However, accuracy decreases for detecting specific refactorings due to the low data on test refactorings found in analyzed projects. Overall, this research demonstrates the feasibility of using structural metrics and test smells for detecting test refactorings. In addition, it highlights the need for improvements through the analysis of synthetic data and project development context. The proposed approach represents a promising step towards supporting the detection and refactoring of test smells aligned with development practices currently adopted by developers.

 

Orientador

 

Ivan do Carmo Machado

 

Co-orientador

 

Heitor Augustus Xavier Costa (UFLA)

 

Membro Titular Externo 1 (com afiliação)

 

Silvia Regina Vergilio (UFPR) - PQ-1D

 

Link para o curriculum lattes

 

http://lattes.cnpq.br/0401470121643212

 

Membro Titular Externo 2 (com afiliação)

 

Eduardo Magno Lages Figueiredo (UFMG) - PQ-2

 

Link para o curriculum lattes

 

http://lattes.cnpq.br/1265706528850746

 

Membro Titular Interno 1 ou Titular Externo 3 (com afiliação)

 

Rohit Gheyi (UFCG) - PQ-2

 

Link para o curriculum lattes

 

http://lattes.cnpq.br/2931270888717344

 

Membro Titular Interno 2 ou Titular Externo 4 (com afiliação)

 

Manoel Gomes de Mendonça Neto (PGCOMP/UFBA) - PQ-2

 

Link para o curriculum lattes

 

http://lattes.cnpq.br/1608062196337851

 

Membro Suplente Externo 1 (com afiliação)

 

Márcio de Medeiros Ribeiro (UFAL) - PQ-1D

 

Link para o curriculum lattes

 

http://lattes.cnpq.br/9300936571715992

 

Membro Suplente Externo 2 (com afiliação)

 

Sheila dos Santos Reinehr (PUC/PR) - PQ-2

 

Link para o curriculum lattes

 

http://lattes.cnpq.br/8130292521370915

 

Membro Suplente Interno 1 ou Suplente Externo 3 (com afiliação)

 

Eduardo Santana de Almeida (UFBA) - PQ-1C

 

Link para o curriculum lattes

 

http://lattes.cnpq.br/8538761803577291

 

Membro Suplente Interno 2 ou Suplente Externo 4 (com afiliação)

 

Tayana Uchôa Conte (UFAM) - PQ-2

 

Link para o curriculum lattes

 

http://lattes.cnpq.br/6682919653508224

 

Data da defesa

 

26 Mar, 2024

 

Horário da defesa

 

9:30 AM

 

 

Data da Defesa: 
26/03/2024 - 09:30
Tipo de Defesa: 
Defesa de Doutorado