Teaching Refactoring to Improve Code Quality with ChatGPT: An Experience Report in Undergraduate Lessons
Resumo
Refactoring presents a complex computational challenge, and its learning is intricate, requiring a solid foundation in computational thinking, programming and object-oriented concepts. Moreover, making students realize the importance and benefits of refactoring is also challenging. To address this complexity, we introduce a refactoring teaching method based on Generative Artificial Intelligence (GAI), incorporating single-loop and double-loop learning principles, focusing on fostering deeper and critical learning. We used ChatGPT, a GAI-based tool, and conducted an eight-week mixed-methods study involving 23 computer science undergraduate students. The study involved applying four distinct projects extracted from GitHub, where participants were tasked with identifying code smells and performing the necessary refactoring to improve code quality. The primary focus was on identifying both the positive and negative aspects of the method, as well as delineating the computational thinking characteristics developed during the process. The results indicate that the use of ChatGPT facilitated the learning of refactoring, contributing to the development of numerous computational thinking skills, especially problem formulation, decomposition, and abstraction. Thus, this paper contributes a GAI-based teaching method along with evidence on how it helps students develop refactoring skills.
Palavras-chave:
Generative Artificial Intelligence, ChatGPT, Refactory, Higher Education, Teaching, Computational Thinking
Publicado
05/11/2024
Como Citar
MENOLLI, André; STRIK, Bruno; RODRIGUES, Luiz.
Teaching Refactoring to Improve Code Quality with ChatGPT: An Experience Report in Undergraduate Lessons. In: SIMPÓSIO BRASILEIRO DE QUALIDADE DE SOFTWARE (SBQS), 23. , 2024, Bahia/BA.
Anais [...].
Porto Alegre: Sociedade Brasileira de Computação,
2024
.
p. 563–574.