Code Smells and Refactorings for Elixir

  • Lucas Francisco da Matta Vegi UFMG
  • Marco Tulio Valente UFMG

Abstract


Elixir is a modern functional programming language that is steadily gaining popularity in the industry. However, there is still limited research on the internal code quality produced using this language. To address this gap, this Ph.D. thesis explores code smells and refactorings specific to Elixir, taking inspiration from Fowler’s classic catalogs. The first two studies employed a mixed-methods approach to identify and catalog 35 code smells (including 23 new ones and 12 commonly known), validated by 181 developers, as well as 82 refactorings (14 of which are novel), validated by 151 developers. The third study mapped relationships between code smells and corresponding refactorings, proposing practical guidelines for their systematic elimination. These findings had a real impact on the community of developers working with the language, contributing both to the prevention of code smells and to supporting the prioritization of refactorings in Elixir development.

Keywords: Code smells, Refactoring, Elixir, Functional programming, Mining software repositories, Grey literature review, Systematic literature review

References

Chaima Abid, Vahid Alizadeh, Marouane Kessentini, Thiago N. Ferreira, and Danny Dig. 2020. 30 years of software refactoring research: a systematic literature review. ArXiv abs/2007.02194 (2020), 1–23. DOI: 10.48550/arXiv.2007.02194

Matheus Deon Bordignon and Rodolfo Adamshuk Silva. 2020. Mutation operators for concurrent programs in Elixir. In 21st IEEE Latin-American Test Symposium (LATS). 1–6. DOI: 10.1109/LATS49555.2020.9093675

Matteo Bosco, Pasquale Cavoto, Augusto Ungolo, Biruk Asmare Muse, Foutse Khomh, Vittoria Nardone, and Massimiliano Di Penta. 2023. UnityLint: A Bad Smell Detector for Unity. In 31st IEEE/ACM International Conference on Program Comprehension (ICPC). 186–190. DOI: 10.1109/ICPC58990.2023.00033

Thomas Corbat, Lukas Felber, Mirko Stocker, and Peter Sommerlad. 2007. Ruby Refactoring Plug-in for Eclipse. In 22nd ACM SIGPLAN Conference on Object-Oriented Programming Systems and Applications Companion (OOPSLA). 779–780. DOI: 10.1145/1297846.1297884

Lucas Francisco da Matta Vegi. 2024. Code Smells and Refactorings for Elixir. PhD thesis. Universidade Federal de Minas Gerais, Brazil. [link]

Danny Dig. 2011. A Refactoring Approach to Parallelism. IEEE Software 28, 1 (2011), 17–22. DOI: 10.1109/MS.2011.1

Fabio Ferreira and Marco Tulio Valente. 2023. Detecting Code Smells in React-based Web Apps. Information and Software Technology 155 (2023), 1–16. DOI: 10.1016/j.infsof.2022.107111

Francesca Arcelli Fontana, Vincenzo Ferme, Alessandro Marino, Bartosz Walter, and Pawel Martenka. 2013. Investigating the impact of code smells on system’s quality: an empirical study on systems of different application domains. In 29th IEEE International Conference on Software Maintenance (ICSM). 260–269. DOI: 10.1109/ICSM.2013.37

Martin Fowler and Kent Beck. 1999. Refactoring: improving the design of existing code (1 ed.). Addison-Wesley.

Sarra Habchi, Geoffrey Hecht, Romain Rouvoy, and Naouel Moha. 2017. Code Smells in iOS apps: how do they compare to Android?. In 4th IEEE/ACM International Conference on Mobile Software Engineering and Systems (MOBILESoft). 110–121. DOI: 10.1109/MOBILESoft.2017.11

Geoffrey Hecht, Omar Benomar, Romain Rouvoy, Naouel Moha, and Laurence Duchien. 2015. Tracking the software quality of Android applications along their evolution. In 30th IEEE/ACM International Conference on Automated Software Engineering (ASE). 236–247. DOI: 10.1109/ASE.2015.46

Saša Jurić. 2024. Elixir in action (3 ed.). Manning.

M.M. Lehman. 1980. Programs, life cycles, and laws of software evolution. Proc. IEEE 68, 9 (1980), 1060–1076. DOI: 10.1109/PROC.1980.11805

Huiqing Li and Simon Thompson. 2006. Comparative Study of Refactoring Haskell and Erlang Programs. In 6th IEEE International Workshop on Source Code Analysis and Manipulation (SCAM). 197–206. DOI: 10.1109/SCAM.2006.8

Bertrand Meyer. 1997. Object-oriented software construction (2 ed.). Prentice Hall Englewood Cliffs.

Vittoria Nardone, Biruk Asmare Muse, Mouna Abidi, Foutse Khomh, and Massimiliano Di Penta. 2023. Video game bad smells: What they are and how developers perceive them. ACM Trans. Softw. Eng. Methodol. 32, 4 (2023), 1–35. DOI: 10.1145/3563214

Amir Saboury, Pooya Musavi, Foutse Khomh, and Giulio Antoniol. 2017. An empirical study of code smells in JavaScript projects. In 24th IEEE International Conference on Software Analysis, Evolution and Reengineering (SANER). 294–305. DOI: 10.1109/SANER.2017.7884630

Elder Sobrinho, Andrea De Lucia, and Marcelo Maia. 2021. A systematic literature review on bad smells–5 w’s: which, when, what, who, where. IEEE Transactions on Software Engineering 47, 1 (2021), 17–66. DOI: 10.1109/TSE.2018.2880977

Davide Taibi, Andrea Janes, and Valentina Lenarduzzi. 2017. How developers perceive smells in source code: a replicated study. Information and Software Technology 92, 1 (2017), 223–235. DOI: 10.1016/j.infsof.2017.08.008

Dave Thomas. 2018. Programming Elixir - 1.6: functional - concurrent - pragmatic - fun (1 ed.). Pragmatic Bookshelf.

Lucas Francisco da Matta Vegi and Marco Tulio Valente. 2025. Code Smells and Refactorings for Elixir. In Concurso de Teses e Dissertações em Engenharia de Software (CTD-ES) - XVI Congresso Brasileiro de Software: Teoria E Prática (CBSoft). 1–15.

Lucas Francisco Matta Vegi and Marco Tulio Valente. 2022. Code smells in Elixir: early results from a grey literature review. In 30th International Conference on Program Comprehension (ICPC) - ERA track. 580–584. DOI: 10.1145/3524610.3527881

Lucas Francisco Matta Vegi and Marco Tulio Valente. 2023. Towards a catalog of refactorings for Elixir. In 39th International Conference on Software Maintenance and Evolution (ICSME) - NIER track. 358–362. DOI: 10.1109/ICSME58846.2023.00045

Lucas Francisco Matta Vegi and Marco Tulio Valente. 2023. Understanding code smells in Elixir functional language. Empirical Software Engineering 28, 102 (2023), 1–32. DOI: 10.1007/s10664-023-10343-6

Lucas Francisco Matta Vegi and Marco Tulio Valente. 2025. Understanding refactorings in Elixir functional language. Empirical Software Engineering 30, 108 (2025), 1–58. DOI: 10.1007/s10664-025-10652-y

Zejun Zhang, Zhenchang Xing, Xin Xia, Xiwei Xu, and Liming Zhu. 2022. Making Python code idiomatic by automatic refactoring non-idiomatic Python code with pythonic idioms. In 30th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering (ESEC/FSE). 696–708. DOI: 10.1145/3540250.3549143

Zejun Zhang, Zhenchang Xing, Dehai Zhao, Xiwei Xu, Liming Zhu, and Qinghua Lu. 2024. Automated Refactoring of Non-Idiomatic Python Code with Pythonic Idioms. IEEE Transactions on Software Engineering (2024), 1–22. DOI: 10.1109/TSE.2024.3420886

Jianjun Zhao. 2023. On Refactoring Quantum Programs in Q#. In 4th IEEE International Conference on Quantum Computing and Engineering (QCE). 169–172. DOI: 10.1109/QCE57702.2023.10203
Published
2025-11-04
VEGI, Lucas Francisco da Matta; VALENTE, Marco Tulio. Code Smells and Refactorings for Elixir. In: BRAZILIAN SOFTWARE QUALITY SYMPOSIUM (SBQS), 24. , 2025, São José dos Campos/SP. Anais [...]. Porto Alegre: Sociedade Brasileira de Computação, 2025 . p. 571-573. DOI: https://doi.org/10.5753/sbqs.2025.15359.