skip to main content
10.1145/3387904.3389276acmconferencesArticle/Chapter ViewAbstractPublication PagesicseConference Proceedingsconference-collections
research-article
Open access

When Are Smells Indicators of Architectural Refactoring Opportunities: A Study of 50 Software Projects

Published: 12 September 2020 Publication History

Abstract

Refactoring is a widely adopted practice for improving code comprehension and for removing severe structural problems in a project. When refactorings affect the system architecture, they are called architectural refactorings. Unfortunately, developers usually do not know when and how they should apply refactorings to remove architectural problems. Nevertheless, they might be more susceptible to applying architectural refactoring if they rely on code smells and code refactoring -- two concepts that they usually deal with through their routine programming activities. To investigate if smells can serve as indicators of architectural refactoring opportunities, we conducted a retrospective study over the commit history of 50 software projects. We analyzed 52,667 refactored elements to investigate if they had architectural problems that could have been indicated by automatically-detected smells. We considered purely structural refactorings to identify elements that were likely to have architectural problems. We found that the proportion of refactored elements without smells is much lower than those refactored with smells. By analyzing the latter, we concluded that smells can be used as indicators of architectural refactoring opportunities when the affected source code is deteriorated, i.e., the code hosting two or more smells. For example, when God Class or Complex Class appear together with other smells, they are indicators of architectural refactoring opportunities. In general, smells that often co-occurred with other smells (67.53%) are indicators of architectural refactoring opportunities in most cases (88.53% of refactored elements). Our study also enables us to derive a catalog with patterns of smells that indicate refactoring opportunities to remove specific types of architectural problems. These patterns can guide developers and make them more susceptible to apply architectural refactorings.

References

[1]
M Abbes, F Khomh, Y Gueheneuc, and G Antoniol. 2011. An Empirical Study of the Impact of Two Antipatterns, Blob and Spaghetti Code, on Program Comprehension. In Proceedings of the 15th European Software Engineering Conference; Oldenburg, Germany. 181--190.
[2]
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. https://doi.org/10.1016/j.jss.2015.05.024
[3]
Timothy A. Budd. 2001. An Introduction to Object-Oriented Programming (3rd ed.). Addison-Wesley Longman Publishing Co., Inc., Boston, MA, USA.
[4]
Diego Cedrim, Alessandro Garcia, Melina Mongiovi, Rohit Gheyi, Leonardo Sousa, Rafael de Mello, Baldoino Fonseca, Márcio Ribeiro, and Alexander Chávez. 2017. Understanding the Impact of Refactoring on Smells: A Longitudinal Study of 23 Software Projects. In Proceedings of the 2017 11th Joint Meeting on Foundations of Software Engineering (ESEC/FSE 2017). ACM, New York, NY, USA, 465--475. https://doi.org/10.1145/3106237.3106259
[5]
Alexander Chávez, Isabella Ferreira, Eduardo Fernandes, Diego Cedrim, and Alessandro Garcia. 2017. How Does Refactoring Affect Internal Quality Attributes?: A Multi-project Study. In Proceedings of the 31st Brazilian Symposium on Software Engineering (SBES '17). ACM, New York, NY, USA, 74--83. https://doi.org/10.1145/3131151.3131171
[6]
O. Ciupke. 1999. Automatic detection of design problems in object-oriented reengineering. In Proceedings of Technology of Object-Oriented Languages and Systems - TOOLS 30 (Cat. No.PR00278). 18--32.
[7]
Bill Curtis, Jay Sappidi, and Alexandra Szynkarski. 2012. Estimating the Size, Cost, and Types of Technical Debt. In Proceedings of the Third International Workshop on Managing Technical Debt (MTD '12). IEEE Press, Piscataway, NJ, USA, 49--53. http://dl.acm.org/citation.cfm?id=2666036.2666045
[8]
Neil A. Ernst, Stephany Bellomo, Ipek Ozkaya, Robert L. Nord, and Ian Gorton. 2015. Measure It? Manage It? Ignore It? Software Practitioners and Technical Debt. In Proceedings of the 2015 10th Joint Meeting on Foundations of Software Engineering (ESEC/FSE 2015). Association for Computing Machinery, New York, NY, USA, 50--60. https://doi.org/10.1145/2786805.2786848
[9]
M Fowler. 1999. Refactoring: Improving the Design of Existing Code. Addison-Wesley Professional, Boston.
[10]
J Garcia, D Popescu, G Edwards, and N Medvidovic. 2009. Identifying Architectural Bad Smells. In CSMR09; Kaiserslautern, Germany. IEEE.
[11]
Joshua Garcia, Daniel Popescu, George Edwards, and Nenad Medvidovic. 2009. Toward a Catalogue of Architectural Bad Smells. In Architectures for Adaptive Software Systems, Raffaela Mirandola, Ian Gorton, and Christine Hofmeister (Eds.). Springer Berlin Heidelberg, Berlin, Heidelberg, 146--162.
[12]
M Godfrey and E Lee. 2000. Secrets from the Monster: Extracting Mozilla's Software Architecture. In CoSET-00; Limerick, Ireland. 15--23.
[13]
Phil Greenwood, Thiago Bartolomei, Eduardo Figueiredo, Marcos Dosea, Alessandro Garcia, Nelio Cacho, Cláudio Sant'Anna, Sergio Soares, Paulo Borba, Uirá Kulesza, and Awais Rashid. 2007. On the Impact of Aspectual Decompositions on Design Stability: An Empirical Study. In Proceedings of the 21st European Conference on Object-Oriented Programming (ECOOP'07). Springer-Verlag, Berlin, Heidelberg, 176--200. http://dl.acm.org/citation.cfm?id=2394758.2394771
[14]
P. Kaminski. 2007. Reforming Software Design Documentation. In 14th Working Conference on Reverse Engineering (WCRE 2007). 277--280.
[15]
Miryung Kim, Thomas Zimmermann, and Nachiappan Nagappan. 2012. A Field Study of Refactoring Challenges and Benefits. In Proceedings of the 20th International Symposium on the Foundations of Software Engineering (FSE '12). ACM, New York, NY, USA, Article 50, 11 pages. https://doi.org/10.1145/2393596.2393655
[16]
Miryung Kim, Thomas Zimmermann, and Nachiappan Nagappan. 2014. An empirical study of refactoringchallenges and benefits at microsoft. IEEE Transactions on Software Engineering 40, 7 (2014), 633--649.
[17]
M. Raveendra Kumar and R. Hari Kumar. 2011. Architectural Refactoring of a Mission Critical Integration Application: A Case Study. In Proceedings of the 4th India Software Engineering Conference (ISEC '11). Association for Computing Machinery, New York, NY, USA, 77--83. https://doi.org/10.1145/1953355.1953365
[18]
M Lanza and R Marinescu. 2006. Object-Oriented Metrics in Practice. Springer, Heidelberg.
[19]
Yun Lin, Xin Peng, Yuanfang Cai, Danny Dig, Diwen Zheng, and Wenyun Zhao. 2016. Interactive and Guided Architectural Refactoring with Search-Based Recommendation. In Proceedings of the 201624th ACM SIGSOFT International Symposium on Foundations of Software Engineering (FSE 2016). Association for Computing Machinery, New York, NY, USA, 535--546. https://doi.org/10.1145/2950290.2950317
[20]
M. Lippert and S. Roock. 2006. Refactoring in Large Software Projects: Performing Complex Restructurings Successfully. Wiley. https://books.google.com.br/books?id=bCEYuB83ROcC
[21]
A MacCormack, J Rusnak, and C Baldwin. 2006. Exploring the Structure of Complex Software Designs: An Empirical Study of Open Source and Proprietary Code. Manage. Sci. 52, 7 (2006), 1015--1030.
[22]
I Macia. 2013. On the Detection of Architecturally-Relevant Code Anomalies in Software Systems. Ph.D. Dissertation. Pontifical Catholic University of Rio de Janeiro, Informatics Department.
[23]
I. Macia, R. Arcoverde, A. Garcia, C. Chavez, and A. von Staa. 2012. On the Relevance of Code Anomalies for Identifying Architecture Degradation Symptoms. In CSMR12. 277--286.
[24]
Isela Macia, Joshua Garcia, Daniel Popescu, Alessandro Garcia, Nenad Medvidovic, and Arndt von Staa. 2012. Are Automatically-detected Code Anomalies Relevant to Architectural Modularity?: An Exploratory Analysis of Evolving Systems. In AOSD '12. ACM, New York, NY, USA, 167--178.
[25]
Marinescu. 2004. Detection strategies: metrics-based rules for detecting design flaws. In Proceedings of 20th IEEE International Conference on Software Maintenance (ICSM); Chicago, USA. 350--359.
[26]
Robert C. Martin and Micah Martin. 2006. Agile Principles, Patterns, and Practices in C# (Robert C. Martin). Prentice Hall PTR, Upper Saddle River, NJ, USA.
[27]
Ran Mo, Yuanfang Cai, R. Kazman, and Lu Xiao. 2015. Hotspot Patterns: The Formal Definition and Automatic Detection of Architecture Smells. In Software Architecture (WICSA), 2015 12th Working IEEE/IFIP Conference on. 51--60.
[28]
N. Moha, Y. g. Gueheneuc, and P. Leduc. 2006. Automatic Generation of Detection Algorithms for Design Defects. In 21st IEEE/ACM International Conference on Automated Software Engineering (ASE'06). 297--300. https://doi.org/10.1109/ASE.2006.22
[29]
N Moha, Y Gueheneuc, L Duchien, and A Le Meur. 2010. DECOR: A Method for the Specification and Detection of Code and Design Smells. IEEE Transaction on Software Engineering 36 (2010), 20--36.
[30]
Emerson Murphy-Hill, Chris Parnin, and Andrew P. Black. 2009. How We Refactor, and How We Know It. In Proceedings of the 31st International Conference on Software Engineering (ICSE '09). IEEE Computer Society, Washington, DC, USA, 287--297. https://doi.org/10.1109/ICSE.2009.5070529
[31]
W Oizumi, A Garcia, L Sousa, B Cafeo, and Y Zhao. 2016. Code Anomalies Flock Together: Exploring Code Anomaly Agglomerations for Locating Design Problems. In The 38th International Conference on Software Engineering; USA.
[32]
Willian Nalepa Oizumi, Leonardo da Silva Sousa, Anderson Oliveira, Alessandro Garcia, O. I. Anne Benedicte Agbachi, Roberto Felicio Oliveira, and Carlos Lucena. 2018. On the identification of design problems in stinky code: experiences and tool support. J. Braz. Comp. Soc. 24, 1 (2018), 13:1-13:30. https://doi.org/10.1186/s13173-018-0078-y
[33]
Anderson Oliveira, Leonardo Sousa, Willian Oizumi, and Alessandro Garcia. 2019. On the Prioritization of Design-Relevant Smelly Elements: A Mixed-Method, Multi-Project Study. In Proceedings of the XIII Brazilian Symposium on Software Components, Architectures, and Reuse (SBCARS '19). ACM, New York, NY, USA, 83--92. https://doi.org/10.1145/3357141.3357142
[34]
2020 Replication Package. 2020. https://figshare.com/s/3ac0da284f700d186dfa. (2020).
[35]
Meilir Page-Jones. 2000. Fundamentals of Object-oriented Design in UML. Addison-Wesley Longman Publishing Co., Inc., Boston, MA, USA.
[36]
F. Palomba, G. Bavota, M. D. Penta, R. Oliveto, and A. D. Lucia. 2014. Do They Really Smell Bad? A Study on Developers' Perception of Bad Code Smells. In 2014 IEEE International Conference on Software Maintenance and Evolution. 101--110. https://doi.org/10.1109/ICSME.2014.32
[37]
David L. Parnas. 1978. Designing Software for Ease of Extension and Contraction. In Proceedings of the 3rd International Conference on Software Engineering (ICSE '78). IEEE Press, Piscataway, NJ, USA, 264--277.
[38]
Dewayne E. Perry and Alexander L. Wolf. 1992. Foundations for the Study of Software Architecture. SIGSOFT Softw. Eng. Notes 17, 4 (Oct. 1992), 40--52. https://doi.org/10.1145/141874.141884
[39]
P. Rachow. 2019. Refactoring Decision Support for Developers and Architects Based on Architectural Impact. In 2019 IEEE International Conference on Software Architecture Companion (ICSA-C). 262--266. https://doi.org/10.1109/ICSA-C.2019.00054
[40]
Refactoring Oracle [n. d.]. Refactoring Oracle. ([n. d.]). http://refactoring.encs.concordia.ca/oracle/
[41]
Luca Rizzi, Francesca Arcelli Fontana, and Riccardo Roveda. 2018. Support for Architectural Smell Refactoring. In Proceedings of the 2nd International Workshop on Refactoring (IWoR 2018). Association for Computing Machinery, New York, NY, USA, 7--10. https://doi.org/10.1145/3242163.3242165
[42]
Santonu Sarkar, Shubha Ramachandran, G. Sathish Kumar, Madhu K. Iyengar, K. Rangarajan, and Saravanan Sivagnanam. 2009. Modularization of a Large-Scale Business Application: A Case Study. IEEE Softw. 26, 2 (March 2009), 28--35. https://doi.org/10.1109/MS.2009.42
[43]
S Schach, B Jin, D Wright, G Heller, and A Offutt. 2002. Maintainability of the Linux kernel. Software, IEE Proceedings - 149, 1 (2002), 18--23.
[44]
Marcelino Campos Oliveira Silva, Marco Tulio Valente, and Ricardo Terra. 2016. Does Technical Debt Lead to the Rejection of Pull Requests?. In Proceedings of the 12th Brazilian Symposium on Information Systems (SBSI '16). 248--254.
[45]
Leonardo Sousa, Anderson Oliveira, Willian Oizumi, Simone Barbosa, Alessandro Garcia, Jaejoon Lee, Marcos Kalinowski, Rafael de Mello, Baldoino Fonseca, Roberto Oliveira, Carlos Lucena, and Rodrigo Paes. 2018. Identifying Design Problems in the Source Code: A Grounded Theory. In Proceedings of the 40th International Conference on Software Engineering (ICSE '18). ACM, New York, NY, USA, 921--931. https://doi.org/10.1145/3180155.3180239
[46]
Leonardo Sousa, Roberto Oliveira, Alessandro Garcia, Jaejoon Lee, Tayana Conte, Willian Oizumi, Rafael de Mello, Adriana Lopes, Natasha Valentim, Edson Oliveira, and Carlos Lucena. 2017. How Do Software Developers Identify Design Problems?: A Qualitative Analysis. In Proceedings of 31st Brazilian Symposium on Software Engineering (SBES'17). 12.
[47]
Michael Stal. 2014. Chapter 3 - Refactoring Software Architectures. In Agile Software Architecture, Muhammad Ali Babar, Alan W. Brown, and Ivan Mistrik (Eds.). Morgan Kaufmann, Boston, 63--82. https://doi.org/10.1016/B978-0-12-407772-0.00003-4
[48]
Girish Suryanarayana, Ganesh Samarthyam, and Tushar Sharma. 2014. Refactoring for Software Design Smells: Managing Technical Debt (1st ed.). Morgan Kaufmann Publishers Inc., San Francisco, CA, USA.
[49]
A. Trifu and R. Marinescu. 2005. Diagnosing design problems in object oriented systems. In WCRE'05. 10 pp.
[50]
Adrian Trifu and Urs Reupke. 2007. Towards Automated Restructuring of Object Oriented Systems. In CSMR '07. IEEE, Washington, DC, USA, 39--48.
[51]
Nikolaos Tsantalis, Victor Guana, Eleni Stroulia, and Abram Hindle. 2013. A multidimensional empirical study on refactoring activity. In Proceedings of the 2013 Conference of the Center for Advanced Studies on Collaborative Research. IBM Corp., 132--146.
[52]
Nikolaos Tsantalis, Matin Mansouri, Laleh M. Eshkevari, Davood Mazinanian, and Danny Dig. 2018. Accurate and Efficient Refactoring Detection in Commit History. In Proceedings of the 40th International Conference on Software Engineering (ICSE '18). ACM, New York, NY, USA, 483--494. https://doi.org/10.1145/3180155.3180206
[53]
Michele Tufano, Fabio Palomba, Gabriele Bavota, Rocco Oliveto, Massimiliano Di Penta, Andrea De Lucia, and Denys Poshyvanyk. 2015. When and Why Your Code Starts to Smell Bad. In Proceedings of the 37th International Conference on Software Engineering (ICSE '15). ACM, New York, NY, USA, 13.
[54]
J van Gurp and J Bosch. 2002. Design erosion: problems and causes. Journal of Systems and Software 61, 2 (2002), 105--119.
[55]
S. Vidal, E. Guimaraes, W. Oizumi, A. Garcia, A. D. Pace, and C. Marcos. 2016. Identifying Architectural Problems through Prioritization of Code Smells. In SBCARS16. 41--50.
[56]
Lu Xiao, Yuanfang Cai, Rick Kazman, Ran Mo, and Qiong Feng. 2016. Identifying and Quantifying Architectural Debt. In Proceedings of the 38th International Conference on Software Engineering (ICSE '16). ACM, New York, NY, USA, 488--498. https://doi.org/10.1145/2884781.2884822
[57]
Zhenchang Xing and Eleni Stroulia. 2005. UMLDiff: An Algorithm for Object-oriented Design Differencing. In Proc. of ASE '05. 54--65. https://doi.org/10.1145/1101908.1101919
[58]
A. Yamashita and L. Moonen. 2013. Do developers care about code smells? An exploratory survey. In 2013 20th Working Conference on Reverse Engineering (WCRE). 242--251. https://doi.org/10.1109/WCRE.2013.6671299
[59]
A Yamashita and L Moonen. 2013. Exploring the impact of inter-smell relations on software maintainability: an empirical study. In Proceedings of the 35th International Conference on Software Engineering; San Francisco, USA. 682--691.
[60]
O. Zimmermann. 2015. Architectural Refactoring: A Task-Centric View on Software Evolution. IEEE Software 32, 02 (mar 2015), 26--29. https://doi.org/10.1109/MS.2015.37
[61]
Olaf Zimmermann. 2017. Architectural refactoring for the cloud: a decision-centric view on cloud migration. Computing 99, 2 (01 Feb 2017), 129--145. https://doi.org/10.1007/s00607-016-0520-y

Cited By

View all
  • (2025)Mining software repositories for software architecture — A systematic mapping studyInformation and Software Technology10.1016/j.infsof.2025.107677181(107677)Online publication date: May-2025
  • (2024)Defining and Evaluating Prudence and Recklessness of Enterprise Architecture DebtEnterprise Information Systems10.1007/978-3-031-64755-0_12(237-261)Online publication date: 26-Jul-2024
  • (2023)Impact of Architectural Smells on Software Performance: an Exploratory StudyProceedings of the 27th International Conference on Evaluation and Assessment in Software Engineering10.1145/3593434.3593442(22-31)Online publication date: 14-Jun-2023
  • Show More Cited By

Index Terms

  1. When Are Smells Indicators of Architectural Refactoring Opportunities: A Study of 50 Software Projects

    Recommendations

    Comments

    Information & Contributors

    Information

    Published In

    cover image ACM Conferences
    ICPC '20: Proceedings of the 28th International Conference on Program Comprehension
    July 2020
    481 pages
    ISBN:9781450379588
    DOI:10.1145/3387904
    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 ACM 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: 12 September 2020

    Permissions

    Request permissions for this article.

    Check for updates

    Qualifiers

    • Research-article
    • Research
    • Refereed limited

    Conference

    ICPC '20
    Sponsor:

    Upcoming Conference

    ICSE 2025

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • Downloads (Last 12 months)128
    • Downloads (Last 6 weeks)14
    Reflects downloads up to 02 Mar 2025

    Other Metrics

    Citations

    Cited By

    View all
    • (2025)Mining software repositories for software architecture — A systematic mapping studyInformation and Software Technology10.1016/j.infsof.2025.107677181(107677)Online publication date: May-2025
    • (2024)Defining and Evaluating Prudence and Recklessness of Enterprise Architecture DebtEnterprise Information Systems10.1007/978-3-031-64755-0_12(237-261)Online publication date: 26-Jul-2024
    • (2023)Impact of Architectural Smells on Software Performance: an Exploratory StudyProceedings of the 27th International Conference on Evaluation and Assessment in Software Engineering10.1145/3593434.3593442(22-31)Online publication date: 14-Jun-2023
    • (2023)An Empirical Study of Refactoring Rhythms and Tactics in the Software Development ProcessIEEE Transactions on Software Engineering10.1109/TSE.2023.332677549:12(5103-5119)Online publication date: 1-Dec-2023
    • (2023)Don’t Forget the Exception! : Considering Robustness Changes to Identify Design Problems2023 IEEE/ACM 20th International Conference on Mining Software Repositories (MSR)10.1109/MSR59073.2023.00064(417-429)Online publication date: May-2023
    • (2022)Industry experiences with large-scale refactoringProceedings of the 30th ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering10.1145/3540250.3558954(1544-1554)Online publication date: 7-Nov-2022
    • (2022)Untangling the Knot: Enabling Architecture Evolution with Search-Based Refactoring2022 IEEE 19th International Conference on Software Architecture (ICSA)10.1109/ICSA53651.2022.00018(101-111)Online publication date: Mar-2022
    • (2022)Developers’ perception matters: machine learning to detect developer-sensitive smellsEmpirical Software Engineering10.1007/s10664-022-10234-227:7Online publication date: 12-Oct-2022
    • (2022)Impacts, causes, and solutions of architectural smells in microservices: An industrial investigationSoftware: Practice and Experience10.1002/spe.313852:12(2574-2597)Online publication date: 18-Aug-2022
    • (2021)AC²: towards understanding architectural changes in Python projectsProceedings of the 29th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering10.1145/3468264.3473120(1555-1559)Online publication date: 20-Aug-2021
    • Show More Cited By

    View Options

    View options

    PDF

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader

    Login options

    Figures

    Tables

    Media

    Share

    Share

    Share this Publication link

    Share on social media