With great satisfaction, I announce that my PhD thesis, titled “Code Smells and Refactorings for Elixir,” is now publicly available! All the results and methodological details used in our research over the past three years can be openly accessed at:
Elixir is a modern functional programming language, created in 2012, whose popularity has been growing in the industry. Despite this fact, and to the best of our knowledge, there are few studies in the literature addressing the internal quality of systems implemented with this language. In particular, no study to date has investigated specific code smells or refactorings for Elixir. Therefore, to fill these research gaps, we take inspiration from Fowler’s well-known book on code smells and refactorings to prospect, study, document, and evaluate code smells and refactoring strategies specifically tailored to Elixir. In the first study, we employed a mixed-method approach to catalog 35 code smells, 23 of which are new and specific to Elixir, while 12 are traditional code smells cataloged by Fowler and Beck that also affect code implemented in this language. We validated this catalog by surveying 181 experienced Elixir developers from 37 countries across all continents. In a second study, we also adopted a mixed-method approach, including a systematic literature review, to catalog 82 refactoring strategies compatible with Elixir, 14 of which are novel and specific to this language. All these refactorings were validated through another survey answered by 151 developers from 42 countries. To document the cataloged code smells and refactorings, in addition to structured textual descriptions, we produced code examples representing them. Finally, we conducted a third study where the code smells and refactorings for Elixir were correlated, allowing the definition of practical guidelines on how each code smell can be removed systematically with the help of refactoring strategies. In this final study, we also cataloged five new composite refactorings for Elixir. Overall, the results of this thesis have practical implications for the prevention and removal of code smells in Elixir, as well as the prioritization of understanding and using refactoring strategies for this language.
I also have to sincerely thank all the members of the community who actively participated and helped this research thrive. In the acknowledgments section of the thesis (in Portuguese), I did not forget any of you!
Interesting how you managed to sniff out bad smells related to Elixir. Let us try to transform any or refactor any foul code smells in Elixir into beautiful notes of odor in highly functional code.
Thanks for putting this together. It’s super impressive!
I was curious what you think about plugging this into an embedding-based search system so devs could easily query it—especially to help with code quality. I built something kind of related called hexdocs-mcp, which helps AI tooling understand details about dependencies. It’s been a big help in my own workflow.
I’m using AI more in my dev process, and honestly, the code it writes isn’t great. Having a resource like this to point it toward or even just to use manually would be really useful.
I’ve been toying with the idea of building an MCP server that aggregates Elixir best practices. Your work would be an awesome addition. Would be cool to talk more if that sounds interesting.