Code Smells and Refactorings for Elixir

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

Resumo


Elixir is a modern functional language gaining traction in the industry, but the internal quality of the code written with this language still lacks research. To fill this gap, this thesis investigates code smells and refactorings specific to Elixir, drawing inspiration from classic Fowler catalogs. In the first two studies, a mixed-method approach was adopted to catalog 35 code smells (23 novel and 12 traditional), validated by 181 developers, and 82 refactorings (14 novel), validated by 151 developers. In the third study, we correlated code smells and refactorings, establishing practical guidelines for the disciplined removal of smells through refactorings. The results impact both the prevention of code smells and the prioritization of refactorings in Elixir, for instance.

Referências

Abid, C., Alizadeh, V., Kessentini, M., Ferreira, T. N., and Dig, D. (2020). 30 years of software refactoring research: a systematic literature review. ArXiv, abs/2007.02194:1–23.

Bordignon, M. D. and Silva, R. A. (2020). Mutation operators for concurrent programs in Elixir. In 21st IEEE Latin-American Test Symposium (LATS), pages 1–6.

Chen, Q., Câmara, R., Campos, J., Souto, A., and Ahmed, I. (2023). The smelly eight: An empirical study on the prevalence of code smells in Quantum Computing. In 45th IEEE/ACM International Conference on Software Engineering (ICSE), pages 1–13.

Corbat, T., Felber, L., Stocker, M., and Sommerlad, P. (2007). Ruby refactoring plug-in for Eclipse. In 22nd ACM SIGPLAN Conference on Object-Oriented Programming Systems and Applications Companion (OOPSLA), pages 779–780.

Dig, D. (2011). A refactoring approach to parallelism. IEEE Software, 28(1):17–22.

Ferreira, F. and Valente, M. T. (2023). Detecting code smells in React-based web apps. Information and Software Technology, 155:1–16.

Fontana, F. A., Ferme, V., Marino, A., Walter, B., and Martenka, P. (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), pages 260–269.

Fowler, M. and Beck, K. (1999). Refactoring: improving the design of existing code. Addison-Wesley, 1 edition.

Habchi, S., Hecht, G., Rouvoy, R., and Moha, N. (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), pages 110–121.

Hecht, G., Benomar, O., Rouvoy, R., Moha, N., and Duchien, L. (2015). Tracking the software quality of Android applications along their evolution. In 30th IEEE/ACM International Conference on Automated Software Engineering (ASE), pages 236–247.

Jurić, S. (2024). Elixir in action. Manning, 3 edition.

Lehman, M. (1980). Programs, life cycles, and laws of software evolution. Proceedings of the IEEE, 68(9):1060–1076.

Li, H. and Thompson, S. (2006). Comparative study of refactoring Haskell and Erlang programs. In 6th IEEE International Workshop on Source Code Analysis and Manipulation (SCAM), pages 197–206.

Meyer, B. (1997). Object-oriented software construction. Prentice Hall Englewood Cliffs, 2 edition.

Nardone, V., Muse, B. A., Abidi, M., Khomh, F., and Penta, M. D. (2023). Video game bad smells: What they are and how developers perceive them. ACM Trans. Softw. Eng. Methodol., 32(4):1–35.

Saboury, A., Musavi, P., Khomh, F., and Antoniol, G. (2017). An empirical study of code smells in JavaScript projects. In 24th IEEE International Conference on Software Analysis, Evolution and Reengineering (SANER), pages 294–305.

Sobrinho, E., De Lucia, A., and Maia, M. (2021). A systematic literature review on bad smells–5 w’s: which, when, what, who, where. IEEE Transactions on Software Engineering, 47(1):17–66.

Taibi, D., Janes, A., and Lenarduzzi, V. (2017). How developers perceive smells in source code: a replicated study. Information and Software Technology, 92(1):223–235.

Thomas, D. (2018). Programming Elixir - 1.6: functional - concurrent - pragmatic - fun. Pragmatic Bookshelf, 1 edition.

Vegi, L. F. M. (2024). Code Smells and Refactorings for Elixir. Phd thesis, Universidade Federal de Minas Gerais, Brazil.

Vegi, L. F. M. and Valente, M. T. (2022a). Catalog of Elixir-specific code smells. Available at: [link].

Vegi, L. F. M. and Valente, M. T. (2022b). Code smells in Elixir: early results from a grey literature review. In 30th International Conference on Program Comprehension (ICPC) - ERA track, pages 580–584.

Vegi, L. F. M. and Valente, M. T. (2023a). Towards a catalog of refactorings for Elixir. In 39th International Conference on Software Maintenance and Evolution (ICSME) - NIER track, pages 358–362.

Vegi, L. F. M. and Valente, M. T. (2023b). Understanding code smells in Elixir functional language. Empirical Software Engineering, 28(102):1–32.

Vegi, L. F. M. and Valente, M. T. (2025). Understanding refactorings in Elixir functional language. Empirical Software Engineering, 30(108):1–58.

Zhang, Z., Xing, Z., Xia, X., Xu, X., and Zhu, L. (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), page 696–708.

Zhang, Z., Xing, Z., Zhao, D., Xu, X., Zhu, L., and Lu, Q. (2024). Automated refactoring of non-idiomatic Python code with pythonic idioms. IEEE Transactions on Software Engineering, pages 1–22.

Zhao, J. (2023). On refactoring quantum programs in Q. In 4th IEEE International Conference on Quantum Computing and Engineering (QCE), pages 169–172.
Publicado
22/09/2025
VEGI, Lucas Francisco da Matta; VALENTE, Marco Tulio. Code Smells and Refactorings for Elixir. In: CONCURSO DE TESES E DISSERTAÇÕES EM ENGENHARIA DE SOFTWARE (DOUTORADO) - CONGRESSO BRASILEIRO DE SOFTWARE: TEORIA E PRÁTICA (CBSOFT), 16. , 2025, Recife/PE. Anais [...]. Porto Alegre: Sociedade Brasileira de Computação, 2025 . p. 20-34. DOI: https://doi.org/10.5753/cbsoft_estendido.2025.11411.