Skip to main content
Log in

An empirical investigation on the relationship between design and architecture smells

  • Published:
Empirical Software Engineering Aims and scope Submit manuscript

Abstract

Context:

Architecture of a software system represents the key design decisions and therefore its quality plays an important role to keep the software maintainable. Code smells are indicators of quality issues in a software system and are classified based on their granularity, scope, and impact. Despite a plethora of existing work on smells, a detailed exploration of architecture smells, their characteristics, and their relationships with smells in other granularities is missing.

Objective:

The paper aims to study architecture smells characteristics, investigate correlation, collocation, and causation relationships between architecture and design smells.

Method:

We implement smell detection support for seven architecture smells. We mine 3 073 open-source repositories containing more than 118 million lines of C# code and empirically investigate the relationships between seven architecture and 19 design smells.

Results:

We find that smell density does not depend on repository size. Cumulatively, architecture smells are highly correlated with design smells. Our collocation analysis finds that the majority of design and architecture smell pairs do not exhibit collocation. Finally, our causality analysis reveals that design smells cause architecture smells.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9
Fig. 10
Fig. 11

Similar content being viewed by others

Notes

  1. https://github.com/DotNetOpenAuth/DotNetOpenAuth

  2. In cases where there is no previous work recommending specific threshold values, we chose a value based on our experience in analyzing source code and after experimenting with various threshold values and manually analyzing the resultant set of detected smells.

  3. https://lattix.com/

  4. https://www.hello2morrow.com/products/sotograph/sotoarc

  5. https://structure101.com/

  6. https://www.ndepend.com/

  7. https://www.jarchitect.com

  8. https://www.ndepend.com/docs/code-metrics#LCOM

  9. https://github.com/DotNetOpenAuth/DotNetOpenAuth

  10. https://github.com/icsharpcode/NRefactory

  11. https://github.com/icsharpcode/NRefactory

  12. https://github.com/ravendb/ravendb

  13. https://github.com/umbraco/Umbraco-CMS

  14. http://www.ndepend.com/

  15. https://www.sonarqube.org/

  16. https://www.designite-tools.com

References

  • Abbes M, Khomh F, Gueheneuc Y, Antoniol G (2011) An empirical study of the impact of two antipatterns, blob and spaghetti code, on program comprehension. In: 2011 15Th european conference on software maintenance and reengineering, pp 181–190. https://doi.org/10.1109/CSMR.2011.24

  • Arcelli Fontana F, Mäntylä MV, Zanoni M, Marino A (2016) Comparing and experimenting machine learning techniques for code smell detection. Empir Softw Eng 21(3):1143–1191

    Article  Google Scholar 

  • Bass L, Clements P, Kazman R (2012) Software Architecture in Practice, 3rd edn, Addison-Wesley Professional

  • Bavota G, De Lucia A, Di Penta M, Oliveto R, Palomba F (2015) An experimental investigation on the innate relationship between quality and refactoring. J Syst Softw 107:1–14

    Article  Google Scholar 

  • Behnamghader P, Le DM, Garcia J, Link D, Shahbazian A, Medvidovic N (2017) A large-scale study of architectural evolution in open-source software systems. Empir Softw Eng 22(3):1146–1193. https://doi.org/10.1007/s10664-016-9466-0

    Article  Google Scholar 

  • Besker T, Martini A, Bosch J (2018) Managing architectural technical debt: A unified model and systematic literature review. J Syst Softw 135:1–16. https://doi.org/10.1016/j.jss.2017.09.025. http://www.sciencedirect.com/science/article/pii/S0164121217302121

  • Bloch J (2008) Effective Java (2nd Edition) (The Java Series), 2 edn. Prentice Hall PTR

  • Booch G, Rumbaugh J, Jacobson I (1999) The unified modeling language user guide. Addison-wesley, Reading

  • Brown WJ, Malveau RC, McCormick HWS, Mowbray TJ (1998) Antipatterns: Refactoring Software, Architectures, and Projects in Crisis, 1 edn. Wiley, New York

  • Chidamber SR, Kemerer CF (1994) A metrics suite for object oriented design. IEEE Trans Softw Eng 20(6):476–493. https://doi.org/10.1109/32.295895

    Article  Google Scholar 

  • Couto C, Pires P, Valente MT, da Silva Bigonha R, Hora AC, Anquetil N (2013) Bugmaps-granger: A tool for causality analysis between source code metrics and bugs

  • Couto C, Pires P, Valente MT, Bigonha RS, Anquetil N (2014) Predicting software defects with causality tests. J Syst Softw 93:24–41. https://doi.org/10.1016/j.jss.2014.01.033. http://www.sciencedirect.com/science/article/pii/S0164121214000351

  • Cox D, Miller H (1965) The Theory of Stochastic Process, 1 edn. Chapman and Hall, London

  • Cramer H (1946) Mathematical Methods of Statistics, 1 edn. Princeton University Press

  • Cui D, Liu T, Cai Y, Zheng Q, Feng Q, Jin W, Guo J, Qu Y (2019) Investigating the impact of multiple dependency structures on software defects. In: Proceedings of the 41st International Conference on Software Engineering, ICSE ’19. IEEE Press, Piscataway, pp 584–595. https://doi.org/10.1109/ICSE.2019.00069

  • de Andrade HS, Almeida E, Crnkovic I (2014) Architectural bad smells in software product lines: an exploratory study. In: Proceedings of the WICSA 2014 Companion Volume, WICSA ’14 Companion. ACM, pp 12:1–12:6. https://doi.org/10.1145/2578128.2578237

  • Deursen Av, Moonen L, Bergh Avd, Kok G (2001) Refactoring test code. In: M. Marchesi (ed.) Proceedings of the 2nd International Conference on Extreme Programming and Flexible Processes (XP2001). University of Cagliari, pp 92–95

  • Ferreira KA, Bigonha MA, Bigonha RS, Mendes LF, Almeida HC (2012) Identifying thresholds for object-oriented software metrics. J Syst Softw 85(2):244–257. https://doi.org/10.1016/j.jss.2011.05.044. http://www.sciencedirect.com/science/article/pii/S0164121211001385. Special issue with selected papers from the 23rd Brazilian Symposium on Software Engineering

  • Filó TGS, Da Silva Bigonha MA (2015) A catalogue of thresholds for object-oriented software metrics

  • Fontana FA, Ferme V, Marino A, Walter B, Martenka P (2013) Investigating the impact of code smells on system’s quality: an empirical study on systems of different application domains. In: 2013 IEEE International conference on software maintenance (ICSM). IEEE, pp 260–269

  • Fontana FA, Ferme V, Zanoni M (2015) Towards assessing software architecture quality by exploiting code smell relations. In: Proceedings of the 2015 IEEE/ACM 2Nd International Workshop on Software Architecture and Metrics, SAM ’15. IEEE Computer Society, Washington, pp 1–7. https://doi.org/10.1109/SAM.2015.8

  • Fontana FA, Pigazzini I, Roveda R, Zanoni M (2016) Automatic detection of instability architectural smells. In: 2016 IEEE international conference on Software maintenance and evolution (ICSME). IEEE, pp 433–437

  • Fontana FA, Pigazzini I, Roveda R, Tamburri D, Zanoni M, Nitto ED (2017) Arcan: a tool for architectural smells detection. In: 2017 IEEE International conference on software architecture workshops (ICSAW). IEEE, pp 282–285

  • Fontana FA, Lenarduzzi V, Roveda R, Taibi D (2019) Are architectural smells independent from code smells? an empirical study. J Syst Softw 154:139–156. https://doi.org/10.1016/j.jss.2019.04.066. http://www.sciencedirect.com/science/article/pii/S0164121219301013

  • Fourati R, Bouassida N, Abdallah HB (2011) A Metric-Based Approach for Anti-pattern Detection in UML Designs. In: Computer and information science 2011. Springer, Berlin, pp 17–33

  • Fowler M (1999) Refactoring: Improving the Design of Existing Programs, 1 edn. Addison-Wesley Professional

  • Fuller WA (1976) Introduction to Statistical Time Series, 1 edn. Wiley, New York

  • Garcia J, Popescu D, Edwards G, Medvidovic N (2009) Toward a catalogue of architectural bad smells. In: Proceedings of the 5th International Conference on the Quality of Software Architectures: Architectures for Adaptive Software Systems, QoSA ’09. Springer, Berlin, pp 146–162. https://doi.org/10.1007/978-3-642-02351-4_10

  • Garcia J (2014) Technical report: Architectural Smell Definitions and Formalizations. http://csse.usc.edu/TECHRPTS/2014/reports/usc-csse-2014-500.pdf. [Online; accessed 16-June-2017]

  • Granger CWJ (1969) Investigating causal relations by econometric models and cross-spectral methods. Econometrica 37(3):424–438. http://www.jstor.org/stable/1912791

  • Guimaraes E, Garcia A, Cai Y (2014) Exploring blueprints on the prioritization of architecturally relevant code anomalies – a controlled experiment. In: 2014 IEEE 38Th annual computer software and applications conference, pp 344–353. https://doi.org/10.1109/COMPSAC.2014.57

  • Guimarães E, Vidal S, Garcia A, Diaz Pace JA, Marcos C (2018) Exploring architecture blueprints for prioritizing critical code anomalies: Experiences and tool support. Softw Pract Exper 48(5):1077–1106. https://doi.org/10.1002/spe.2563

  • Herbold S, Grabowski J, Waack S (2011) Calculation and optimization of thresholds for sets of software metrics. Empir Softw Eng 16:812–841

    Article  Google Scholar 

  • Hochstein L, Lindvall M (2003) Diagnosing architectural degeneration. In: 2003. Proceedings of 28Th annual NASA goddard software engineering workshop, pp 137–142

  • Kessentini W, Kessentini M, Sahraoui H, Bechikh S, Ouni A (2014) A cooperative parallel Search-Based software engineering approach for Code-Smells detection. IEEE Trans Softw Eng 40(9):841–861

    Article  Google Scholar 

  • Khomh F, Vaucher S, Guéhéneuc YG, Sahraoui H (2009) A bayesian approach for the detection of code and design smells. In: QSIC ’09: Proceedings of the 2009 Ninth International Conference on Quality Software, pp 305–314. IEEE Computer Society

  • Koschke R (2007) Duplication, Redundancy, and Similarity in Software, no. 06301 in Dagstuhl Seminar Proceedings. Internationales Begegnungs- und Forschungszentrum für Informatik (IBFI), Schloss Dagstuhl. http://drops.dagstuhl.de/opus/volltexte/2007/962 Koschke R, Merlo E, Walenstein A (eds)

  • Koziolek H, Domis D, Goldschmidt T, Vorst P (2013) Measuring architecture sustainability. IEEE Softw 30(6):54–62. https://doi.org/10.1109/MS.2013.101

    Article  Google Scholar 

  • Kruchten P, Nord RL, Ozkaya I (2012) Technical debt: From metaphor to theory and practice. IEEE Softw 29(6):18–21. https://doi.org/10.1109/MS.2012.167

    Article  Google Scholar 

  • Kwiatkowski D, Phillips PC, Schmidt P, Shin Y (1992) Testing the null hypothesis of stationarity against the alternative of a unit root: How sure are we that economic time series have a unit root? J Econ 54(1):159–178. https://doi.org/10.1016/0304-4076(92)90104-Y. http://www.sciencedirect.com/science/article/pii/030440769290104Y

  • Lanza M, Marinescu R, Ducasse S (2005) Object-Oriented Metrics in practice. Springer, Berlin

  • Le DM, Carrillo C, Capilla R, Medvidovic N (2016) Relating architectural decay and sustainability of software systems. In: 2016 13Th working IEEE/IFIP conference on software architecture (WICSA), pp 178–181. https://doi.org/10.1109/WICSA.2016.15

  • Le DM, Link D, Shahbazian A, Medvidovic N (2018) An empirical study of architectural decay in open-source software. In: 2018 IEEE International conference on software architecture (ICSA), pp 176–17609. https://doi.org/10.1109/ICSA.2018.00027

  • Li Z, Liang P, Avgeriou P (2015) Architectural technical debt identification based on architecture decisions and change scenarios. In: 2015 12Th working IEEE/IFIP conference on software architecture, pp 65–74. https://doi.org/10.1109/WICSA.2015.19

  • Lippert M, Roock S (2006) Refactoring in large software projects: performing complex restructurings successfully. Wiley, New York

  • Liu H, Ma Z, Shao W, Niu Z (2012) Schedule of bad smell detection and resolution: a new way to save effort. IEEE Trans Softw Eng 38(1):220–235. https://doi.org/10.1109/TSE.2011.9

    Article  Google Scholar 

  • Lozano A, Mens K, Portugal J (2015) Analyzing code evolution to uncover relations. In: 2015 IEEE 2Nd international workshop on patterns promotion and anti-patterns prevention (PPAP), pp 1–4. https://doi.org/10.1109/PPAP.2015.7076847

  • Lutellier T, Chollak D, Garcia J, Tan L, Rayside D, Medvidović N, Kroeger R (2018) Measuring the impact of code dependencies on software architecture recovery techniques. IEEE Trans Softw Eng 44(2):159–181. https://doi.org/10.1109/TSE.2017.2671865

    Article  Google Scholar 

  • Ma W, Chen L, Zhou Y, Xu B, Zhou X (2015) Are anti-patterns coupled? an empirical study. In: 2015 IEEE International conference on software quality, reliability and security, pp 242–251. https://doi.org/10.1109/QRS.2015.43

  • Macia I, Arcoverde R, Garcia A, Chavez C, von Staa A (2012a) On the relevance of code anomalies for identifying architecture degradation symptoms. In: 2012 16Th european conference on software maintenance and reengineering, pp 277–286

  • Macia I, Garcia J, Popescu D, Garcia A, Medvidovic N, von Staa A (2012b) Are automatically-detected code anomalies relevant to architectural modularity? In: the 11th annual international conference, pp 167–178 ACM Press

  • Mantyla M, Vanhanen J, Lassenius C (2003a) A taxonomy and an initial empirical study of bad smells in code. In: 2003. ICSM 2003. Proceedings of International conference on software maintenance, pp 381–384. https://doi.org/10.1109/ICSM.2003.1235447

  • Mantyla M, Vanhanen J, Lassenius C (2003b) A taxonomy and an initial empirical study of bad smells in code. In: 2003. ICSM 2003. Proceedings of International conference on software maintenance, pp 381–384. https://doi.org/10.1109/ICSM.2003.1235447

  • Marinescu R (2004) Detection strategies: Metrics-based rules for detecting design flaws. In: Proceedings of the 20th IEEE International Conference on Software Maintenance, ICSM ’04. IEEE Computer Society, pp 350–359

  • Martin RC (2002) Agile software development: principles, patterns, and practices. Prentice Hall

  • Martini A, Fontana FA, Biaggi A, Roveda R (2018) Identifying and prioritizing architectural debt through architectural smells: a case study in a large software company. In: 12Th european conference on software architecture (ECSA 2018). https://doi.org/10.1109/ICSA.2018.00027

  • Miller GA (1956) The magical number seven plus or minus two: some limits on our capacity for processing information. Psychol Rev 63(2):81–97

    Article  Google Scholar 

  • Mo R, Cai Y, Kazman R, Xiao L (2015) Hotspot patterns: The formal definition and automatic detection of architecture smells. In: WICSA. IEEE Computer Society, pp 51–60. https://doi.org/10.1109/WICSA.2015.12

  • Mo R, Cai Y, Kazman R, Xiao L, Feng Q (2019) Architecture anti-patterns: Automatically detectable violations of design principles. EEE Transactions on Software Engineering:1–1. https://doi.org/10.1109/TSE.2019.2910856

  • Moha N, Guėhėneuc Y, Duchien L, Meur AL (2010) DECOR: A Method for the specification and detection of code and design smells. IEEE Trans Softw Eng 36(1):20–36. https://doi.org/10.1109/TSE.2009.50

    Article  Google Scholar 

  • Munaiah N, Kroh S, Cabrey C, Nagappan M (2017) Curating github for engineered software projects. Empir Softw Eng 22(6):3219–3253. https://doi.org/10.1007/s10664-017-9512-6

    Article  Google Scholar 

  • Nam D, Lee YK, Medvidovic N (2018) Eva: a tool for visualizing software architectural evolution. In: 2018 IEEE/ACM 40Th international conference on software engineering: Companion (ICSE-companion), pp 53–56

  • Oizumi WN, Garcia AF, Colanzi TE, Ferreira M, Staa A (2014) When code-anomaly agglomerations represent architectural problems? an exploratory study. In: 2014 Brazilian symposium on software engineering, pp 91–100. https://doi.org/10.1109/SBES.2014.18

  • Oizumi WN, Garcia AF, Colanzi TE, Ferreira M, Staa AV (2015) On the relationship of code-anomaly agglomerations and architectural problems. J Softw Eng Res Dev 3(1):11. https://doi.org/10.1186/s40411-015-0025-y

    Article  Google Scholar 

  • Oizumi W, Garcia A, da Silva Sousa L, Cafeo B, Zhao Y (2016) Code anomalies flock together: Exploring code anomaly agglomerations for locating design problems. In: Proceedings of the 38th International Conference on Software Engineering, ICSE ’16. ACM, New York, pp 440–451. https://doi.org/10.1145/2884781.2884868

  • Palomba F, Bavota G, Di Penta M, Oliveto R, Poshyvanyk D, De Lucia A (2015) Mining version histories for detecting code smells. IEEE Trans Softw Eng 41(5):462–489

    Article  Google Scholar 

  • Palomba F, Bavota G, Penta MD, Oliveto R, Lucia AD, Poshyvanyk D (2013) Detecting bad smells in source code using change history information. In: 2013 28Th IEEE/ACM international conference on automated software engineering (ASE), pp 268–278. https://doi.org/10.1109/ASE.2013.6693086

  • Palomba F, Bavota G, Penta MD, Fasano F, Oliveto R, Lucia AD (2018) A large-scale empirical study on the lifecycle of code smell co-occurrences. Inf Softw Technol 99:1–10. https://doi.org/10.1016/j.infsof.2018.02.004

  • Pietrzak B, Walter B (2006) Leveraging code smell detection with inter-smell relations. In: Abrahamsson P, Marchesi M, Succi G (eds) Extreme programming and agile processes in software engineering. Springer, Berlin, pp 75–84

  • Samarthyam G, Suryanarayana G, Sharma T (2016) Refactoring for software architecture smells. In: Proceedings of the 1st International Workshop on Software Refactoring. ACM, pp 1–4. https://doi.org/10.1145/2975945.2975946

  • Sharma T, Fragkoulis M, Spinellis D (2016a) Does your configuration code smell?. In: Proceedings of the 13th International Workshop on Mining Software Repositories, MSR’16, pp 189–200. https://doi.org/10.1145/2901739.2901761

  • Sharma T, Mishra P, Tiwari R (2016b) Designite — a software design quality assessment tool. In: Proceedings of the First International Workshop on Bringing Architecture Design Thinking into Developers’ Daily Activities, BRIDGE ’16. ACM. https://doi.org/10.1145/2896935.2896938

  • Sharma T, Fragkoulis M, Spinellis D (2017) House of cards: Code smells in open-source c# repositories. In: 2017 ACM/IEEE International symposium on empirical software engineering and measurement (ESEM), pp 424–429. https://doi.org/10.1109/ESEM.2017.57

  • Sharma T (2018a) Designite - A Software Design Quality Assessment Tool. http://www.designite-tools.com. [Online; accessed 31-Mar-2018]

  • Sharma T, Spinellis D (2018b) A survey on software smells. J Syst Softw 138:158–173. https://doi.org/10.1016/j.jss.2017.12.034. http://www.sciencedirect.com/science/article/pii/S0164121217303114

  • Sharma T (2019a) A dataset of code smells. https://doi.org/10.5281/zenodo.2538646

  • Sharma T (2019b) Designite validation data. https://doi.org/10.5281/zenodo.2538655

  • Suryanarayana G, Samarthyam G, Sharma T (2014) Refactoring for Software Design Smells: Managing Technical Debt, 1 edn. Morgan Kaufmann

  • Tamburri D, Kazman R, Van Den Heuvel WJ (2019) Splicing community and software architecture smells in agile teams: an industrial study. In: Agile and lean: organizations, Products and Development. https://doi.org/10.24251/HICSS.2019.843

  • Tran JB, Godfrey MW, Lee EHS, Holt RC (2000) Architectural repair of open source software. In: Proceedings IWPC 2000. 8th International Workshop on Program Comprehension, pp 48–59. https://doi.org/10.1109/WPC.2000.852479

  • VanderWeele TJ, Shpitser I (2013) On the definition of a confounder. Ann Stat 41(1):196–220. https://doi.org/10.1214/12-aos1058

    Article  MathSciNet  Google Scholar 

  • Verdecchia R, Malavolta I, Lago P (2018) Architectural technical debt identification: The research landscape. In: Proceedings of the 2018 International Conference on Technical Debt, TechDebt ’18. ACM, New York, pp 11–20. https://doi.org/10.1145/3194164.3194176

  • Vidal S, Vazquez H, Díaz-pace JA, Marcos C, Garcia A, Oizumi W (2016a) JSpIRIT: A flexible tool for the analysis of code smells. In: Proceedings - International Conference of the Chilean Computer Science Society, SCCC. Universidad Nacional del Centro de la Provincia de Buenos Aires, Tandil, IEEE, pp 1–6

  • Vidal SA, Marcos C, Díaz-Pace JA (2016b) An approach to prioritize code smells for refactoring. Autom Softw Eng 23(3):501–532

    Article  Google Scholar 

  • Walter B, Fontana FA, Ferme V (2018) Code smells and their collocations: a large-scale experiment on open-source systems. J Syst Softw 144:1–21

    Article  Google Scholar 

  • Xiao L, Cai Y, Kazman R (2014) Titan: a toolset that connects software architecture with quality analysis. In: FSE 2014: Proceedings of the 22nd ACM SIGSOFT International Symposium on Foundations of Software Engineering. Drexel University, ACM, pp 763–766

  • Yamashita A, Moonen L (2013a) Exploring the impact of inter-smell relations on software maintainability: an empirical study. In: 2013 35Th international conference on software engineering (ICSE). https://doi.org/10.1109/ICSE.2013.6606614, pp 682–691

  • Yamashita A, Moonen L (2013b) To what extent can maintenance problems be predicted by code smell detection? – an empirical study. Inf Softw Technol 55(12):2223–2242

    Article  Google Scholar 

  • Yamashita A, Zanoni M, Fontana FA, Walter B (2015) Inter-smell relations in industrial and open source systems: a replication and comparative analysis. In: 2015 IEEE International conference on software maintenance and evolution (ICSME), pp 121–130

Download references

Acknowledgments

The authors would like to thank Panos Louridas and Vasiliki Efstathiou from the Athens University of Economics and Business for providing useful improvement suggestions. We also like to thank Rohit Tiwari and Amit Dogra for putting numerous hours validating Designite.

This work was partially funded by the seneca project, which is part of the Marie Skłodowska-Curie Innovative Training Networks (itn-eid). Grant agreement number 642954.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Tushar Sharma.

Additional information

Communicated by: Barbora Buhnova

Publisher’s note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Sharma, T., Singh, P. & Spinellis, D. An empirical investigation on the relationship between design and architecture smells. Empir Software Eng 25, 4020–4068 (2020). https://doi.org/10.1007/s10664-020-09847-2

Download citation

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s10664-020-09847-2

Keywords

Navigation