Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
10.1145/3626252.3630787acmconferencesArticle/Chapter ViewAbstractPublication PagessigcseConference Proceedingsconference-collections
research-article

Automating Source Code Refactoring in the Classroom

Published: 07 March 2024 Publication History

Abstract

Refactoring is the practice of improving software quality without altering its external behavior. Developers intuitively refactor their code for multiple purposes, such as improving program comprehension, reducing code complexity, dealing with technical debt, and removing code smells. However, no prior studies have exposed the students to an experience of the process of antipatterns detection and refactoring correction, and provided students with toolset to practice it. To understand and increase the awareness of refactoring concepts, in this paper, we aim to reflect on our experience with teaching refactoring and how it helps students become more aware of bad programming practices and the importance of correcting them via refactoring. This paper discusses the results of an experiment in the classroom that involved carrying out various refactoring activities for the purpose of removing antipatterns using JDeodorant, an IDE plugin that supports antipatterns detection and refactoring. The results of the quantitative and qualitative analysis with 171 students show that students tend to appreciate the idea of learning refactoring and are satisfied with various aspects of the JDeodorant plugin's operation. Through this experiment, refactoring can turn into a vital part of the computing educational plan. We envision our findings enabling educators to support students with refactoring tools tuned towards safer and trustworthy refactoring.

References

[1]
[n. d.]. https://refactorings.github.io/education/.
[2]
[n. d.]. https://github.com/apache/logging-log4j2.
[3]
Shamsa Abid, Hamid Abdul Basit, and Naveed Arshad. 2015. Reflections on teaching refactoring: A tale of two projects. In Proceedings of the 2015 ACM Conference on Innovation and Technology in Computer Science Education. 225--230.
[4]
Eman Abdullah AlOmar, Salma Abdullah AlOmar, and Mohamed Wiem Mkaouer. 2023. On the use of static analysis to engage students with software quality improvement: An experience with pmd. arXiv preprint arXiv:2302.05554 (2023).
[5]
Eman Abdullah AlOmar, Moataz Chouchen, Mohamed Wiem Mkaouer, and Ali Ouni. 2022. Code Review Practices for Refactoring Changes: An Empirical Study on OpenStack. (2022), 1--13.
[6]
Eman Abdullah AlOmar, Mohamed Wiem Mkaouer, Christian Newman, and Ali Ouni. 2021. On preserving the behavior in software refactoring: A systematic mapping study. Information and Software Technology (2021), 106675.
[7]
Nicolas Anquetil, Anne Etien, Gaelle Andreo, and Stéphane Ducasse. 2019. Decomposing god classes at siemens. In 2019 IEEE International Conference on Software Maintenance and Evolution (ICSME). IEEE, 169--180.
[8]
Sarah L Ash and Patti H Clayton. 2009. Generating, deepening, and documenting learning: The power of critical reflection in applied learning. (2009).
[9]
Gabriele Bavota, Andrea De Lucia, Massimiliano Di Penta, Rocco Oliveto, and Fabio Palomba. 2015. An experimental investigation on the innate relationship between quality and refactoring. Journal of Systems and Software 107 (2015), 1--14.
[10]
Leema K Berland, Taylor H Martin, Pat Ko, Stephanie Baker Peacock, Jennifer J Rudolph, and Chris Golubski. 2013. Student learning in challenge-based engineering curricula. Journal of Pre-College Engineering Education Research (J-PEER) 3, 1 (2013), 5.
[11]
Narjes Bessghaier, Ali Ouni, and Mohamed Wiem Mkaouer. 2021. A longitudinal exploratory study on code smells in server side web applications. Software Quality Journal 29, 4 (2021), 901--941.
[12]
Anne Brockbank and Ian McGill. 2007. Facilitating reflective learning in higher education. McGraw-Hill Education (UK).
[13]
Shyam R Chidamber and Chris F Kemerer. 1994. A metrics suite for object oriented design. IEEE Transactions on software engineering 20, 6 (1994), 476--493.
[14]
Carol L Colbeck, Susan E Campbell, and Stefani A Bjorklund. 2000. Grouping in the dark: What college students learn from group projects. The Journal of Higher Education 71, 1 (2000), 60--83.
[15]
Daniela S Cruzes and Tore Dyba. 2011. Recommended steps for thematic synthesis in software engineering. In 2011 international symposium on empirical software engineering and measurement. IEEE, 275--284.
[16]
Ward Cunningham. 1992. The WyCash portfolio management system. ACM SIGPLAN OOPS Messenger 4, 2 (1992), 29--30.
[17]
Leonard Elezi, Sara Sali, Serge Demeyer, Alessandro Murgia, and Javier Pérez. 2016. A game of refactoring: Studying the impact of gamification in software refactoring. In Proceedings of the Scientific Workshop Proceedings of XP2016. 1--6.
[18]
Martin Fowler, Kent Beck, John Brant, William Opdyke, and don Roberts. 1999. Refactoring: Improving the Design of Existing Code. Addison-Wesley Longman Publishing Co., Inc., Boston, MA, USA. http://dl.acm.org/citation.cfm?id=311424
[19]
Yaroslav Golubev, Zarina Kurbatova, Eman Abdullah AlOmar, Timofey Bryksin, and Mohamed Wiem Mkaouer. 2021. One thousand and one stories: a large-scale survey of software refactoring. In Proceedings of the 29th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering. 1303--1313.
[20]
Robert J Grissom and John J Kim. 2005. Effect sizes for research : a broad practical approach. Mahwah, N.J. ; London : Lawrence Erlbaum Associates. Formerly CIP.
[21]
Thorsten Haendler and Gustaf Neumann. 2019. Serious refactoring games. In Proceedings of the 52nd Hawaii International Conference on System Sciences.
[22]
Thorsten Haendler, Gustaf Neumann, and Fiodor Smirnov. 2019. An interactive tutoring system for training software refactoring. Instructor 1 (2019), 4.
[23]
Thorsten Haendler, Gustaf Neumann, and Fiodor Smirnov. 2019. RefacTutor: an interactive tutoring system for software refactoring. In International Conference on Computer Supported Education. Springer, 236--261.
[24]
Cruz Izu, Paul Denny, and Sayoni Roy. 2022. A Resource to Support Novices Refactoring Conditional Statements. In Proceedings of the 27th ACM Conference on on Innovation and Technology in Computer Science Education Vol. 1. 344--350.
[25]
Hieke Keuning, Bastiaan Heeren, and Johan Jeuring. 2020. Student refactoring behaviour in a programming tutor. In Koli Calling'20: Proceedings of the 20th Koli Calling International Conference on Computing Education Research. 1--10.
[26]
Hieke Keuning, Bastiaan Heeren, and Johan Jeuring. 2021. A tutoring system to learn code refactoring. In Proceedings of the 52nd ACM Technical Symposium on Computer Science Education. 562--568.
[27]
Foutse Khomh, Massimiliano Di Penta, and Yann-Gael Gueheneuc. 2009. An exploratory study of the impact of code smells on software change-proneness. In 2009 16th Working Conference on Reverse Engineering. IEEE, 75--84.
[28]
Foutse Khomh, Massimiliano Di Penta, Yann-Gaël Guéhéneuc, and Giuliano Antoniol. 2012. An exploratory study of the impact of antipatterns on class change-and fault-proneness. Empirical Software Engineering 17, 3 (2012), 243--275.
[29]
Carlos López, Jesús M Alonso, Raúl Marticorena, and Jesús M Maudes. 2014. Design of e-activities for the learning of code refactoring tasks. In 2014 International Symposium on Computers in Education (SIIE). IEEE, 35--40.
[30]
Fabio Palomba, Gabriele Bavota, Massimiliano Di Penta, Fausto Fasano, Rocco Oliveto, and Andrea De Lucia. 2018. On the diffuseness and the impact on maintainability of code smells: a large scale empirical investigation. Empirical Software Engineering 23, 3 (2018), 1188--1221.
[31]
Felix Raab. 2012. CodeSmellExplorer: Tangible exploration of code smells and refactorings. In 2012 IEEE Symposium on Visual Languages and Human-Centric Computing (VL/HCC). IEEE, 261--262.
[32]
Danilo Silva, Nikolaos Tsantalis, and Marco Tulio Valente. 2016. Why We Refactor? Confessions of GitHub Contributors. In Proceedings of the 2016 24th ACM SIGSOFT International Symposium on Foundations of Software Engineering (Seattle, WA, USA) (FSE 2016). ACM, New York, NY, USA, 858--870. https://doi.org/10.1145/2950290.2950305
[33]
Suzanne Smith, Sara Stoecklin, and Catharina Serino. 2006. An innovative approach to teaching refactoring. In Proceedings of the 37th SIGCSE technical symposium on Computer science education. 349--353.
[34]
Sara Stoecklin, Suzanne Smith, and Catharina Serino. 2007. Teaching students to build well formed object-oriented methods through refactoring. ACM SIGCSE Bulletin 39, 1 (2007), 145--149.
[35]
Nikolaos Tsantalis, Theodoros Chaikalis, and Alexander Chatzigeorgiou. 2018. Ten years of JDeodorant: Lessons learned from the hunt for smells. In 2018 IEEE 25th international conference on software analysis, evolution and reengineering (SANER). IEEE, 4--14.
[36]
Frank Wilcoxon. 1945. Individual comparisons by ranking methods. Biometrics bulletin 1, 6 (1945), 80--83.

Index Terms

  1. Automating Source Code Refactoring in the Classroom

    Recommendations

    Comments

    Information & Contributors

    Information

    Published In

    cover image ACM Conferences
    SIGCSE 2024: Proceedings of the 55th ACM Technical Symposium on Computer Science Education V. 1
    March 2024
    1583 pages
    ISBN:9798400704239
    DOI:10.1145/3626252
    Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

    Sponsors

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    Published: 07 March 2024

    Permissions

    Request permissions for this article.

    Check for updates

    Badges

    • Best Paper

    Qualifiers

    • Research-article

    Conference

    SIGCSE 2024
    Sponsor:

    Acceptance Rates

    Overall Acceptance Rate 1,595 of 4,542 submissions, 35%

    Upcoming Conference

    SIGCSE Virtual 2024
    1st ACM Virtual Global Computing Education Conference
    December 5 - 8, 2024
    Virtual Event , NC , USA

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • 0
      Total Citations
    • 184
      Total Downloads
    • Downloads (Last 12 months)184
    • Downloads (Last 6 weeks)18
    Reflects downloads up to 17 Oct 2024

    Other Metrics

    Citations

    View Options

    Get Access

    Login options

    View options

    PDF

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader

    Media

    Figures

    Other

    Tables

    Share

    Share

    Share this Publication link

    Share on social media