Smell Patterns as Indicators of Design Degradation: Do Developers Agree?

Design degradation problems occur as a result of sub-optimal decisions that negatively impact internal software quality. These problems can affect isolated elements (e.g., a class) or multiple code elements (e.g., components). When neglected, design degradation increases maintenance costs. In this scenario, refactoring is paramount to keep internal software quality. However, the identification and removal of design degradation problems are not trivial tasks. For example, architectural documentation is an artifact that facilitates the identification of architectural problems, but often the documentation is unavailable or outdated. Hence, developers rely on the source code, mainly by identifying code smells. A code smell is a sub-optimal decision in the system implementation that can often be considered a counterpart of design degradation problems. Code smells allow developers to spot a design degradation problem and use them to reason about which refactoring operations need to be applied. Certain groups of code smells, called smell patterns, seem to indicate some specific design degradation problems. Intending to investigate the usefulness of smell patterns to help developers in the identification and removal of design degradation problems, we have conducted a quasi-experiment with 13 professional developers. Developers agree that smell patterns are indicators of design degradation problems, but their perceptions are influenced by factors such as the development platform (e.g., Android), type of functionality, and effort for refactoring the problem. Furthermore, they see as degradation problems only the sub-optimal decisions not intentionally taken. Among the smell patterns investigated, the patterns for Fat Interface, Concern Overload, and Scattered Concern were the most useful indicators of design degradation. We also observed that refactorings associated with code smells contribute to the (partial) removal of degradation problems. Our results led us to develop an automated tool to support developers during the identification and removal of some design degradation problems.

[1]  A. Arya Software Projects , 2020, Anyone Can Code.

[2]  Alessandro F. Garcia,et al.  Are Code Smell Co-occurrences Harmful to Internal Quality Attributes?: A Mixed-Method Study , 2020, SBES.

[3]  Alessandro F. Garcia,et al.  When Are Smells Indicators of Architectural Refactoring Opportunities: A Study of 50 Software Projects , 2020, ICPC.

[4]  Alessandro F. Garcia,et al.  On the Density and Diversity of Degradation Symptoms in Refactored Classes: A Multi-case Study , 2019, 2019 IEEE 30th International Symposium on Software Reliability Engineering (ISSRE).

[5]  Alessandro F. Garcia,et al.  On the Prioritization of Design-Relevant Smelly Elements: A Mixed-Method, Multi-Project Study , 2019, SBCARS '19.

[6]  Alessandro F. Garcia,et al.  On the identification of design problems in stinky code: experiences and tool support , 2018, Journal of the Brazilian Computer Society.

[7]  Carlos José Pereira de Lucena,et al.  Identifying Design Problems in the Source Code: A Grounded Theory , 2018, 2018 IEEE/ACM 40th International Conference on Software Engineering (ICSE).

[8]  Diomidis Spinellis,et al.  A survey on software smells , 2018, J. Syst. Softw..

[9]  Mauricio A. Saca Refactoring improving the design of existing code , 2017, 2017 IEEE 37th Central America and Panama Convention (CONCAPAN XXXVII).

[10]  A. D. Lucia,et al.  When and Why Your Code Starts to Smell Bad , 2017, 2015 IEEE/ACM 37th IEEE International Conference on Software Engineering.

[11]  Baldoino Fonseca dos Santos Neto,et al.  Understanding the impact of refactoring on smells: a longitudinal study of 23 software projects , 2017, ESEC/SIGSOFT FSE.

[12]  Davide Taibi,et al.  Are Architectural Smells Independent from Code Smells? An Empirical Study , 2017, J. Syst. Softw..

[13]  Baldoino Fonseca dos Santos Neto,et al.  Smells Are Sensitive to Developers! On the Efficiency of (Un)Guided Customized Detection , 2017, 2017 IEEE/ACM 25th International Conference on Program Comprehension (ICPC).

[14]  Alessandro F. Garcia,et al.  Code Anomalies Flock Together: Exploring Code Anomaly Agglomerations for Locating Design Problems , 2016, 2016 IEEE/ACM 38th International Conference on Software Engineering (ICSE).

[15]  Neil A. Ernst,et al.  Measure it? Manage it? Ignore it? software practitioners and technical debt , 2015, ESEC/SIGSOFT FSE.

[16]  Alessandro F. Garcia,et al.  On the relationship of code-anomaly agglomerations and architectural problems , 2015, Journal of Software Engineering Research and Development.

[17]  Yuanfang Cai,et al.  Hotspot Patterns: The Formal Definition and Automatic Detection of Architecture Smells , 2015, 2015 12th Working IEEE/IFIP Conference on Software Architecture.

[18]  Gabriele Bavota,et al.  Do They Really Smell Bad? A Study on Developers' Perception of Bad Code Smells , 2014, 2014 IEEE International Conference on Software Maintenance and Evolution.

[19]  Marouane Kessentini,et al.  On the Use of Machine Learning and Search-Based Software Engineering for Ill-Defined Fitness Function: A Case Study on Software Refactoring , 2014, SSBSE.

[20]  Aiko Fallas Yamashita,et al.  Do developers care about code smells? An exploratory survey , 2013, 2013 20th Working Conference on Reverse Engineering (WCRE).

[21]  Bill Curtis,et al.  Estimating the size, cost, and types of Technical Debt , 2012, 2012 Third International Workshop on Managing Technical Debt (MTD).

[22]  Nenad Medvidovic,et al.  Are automatically-detected code anomalies relevant to architectural modularity?: an exploratory analysis of evolving systems , 2012, AOSD.

[23]  Robert K. Yin,et al.  Qualitative Research from Start to Finish , 2010 .

[24]  Nenad Medvidovic,et al.  Toward a Catalogue of Architectural Bad Smells , 2009, QoSA.

[25]  Nenad Medvidovic,et al.  Identifying Architectural Bad Smells , 2009, 2009 13th European Conference on Software Maintenance and Reengineering.

[26]  Rudolf K. Keller,et al.  High-impact Refactoring Based on Architecture Violations , 2007, 11th European Conference on Software Maintenance and Reengineering (CSMR'07).

[27]  Alan MacCormack,et al.  Exploring the Structure of Complex Software Designs: An Empirical Study of Open Source and Proprietary Code , 2006, Manag. Sci..

[28]  Robert C. Martin,et al.  Agile Principles, Patterns, and Practices in C# (Robert C. Martin) , 2006 .

[29]  Stéphane Ducasse,et al.  Object-Oriented Metrics in Practice , 2005 .

[30]  Stephen R. Schach,et al.  Maintainability of the Linux kernel , 2002, IEE Proc. Softw..

[31]  Oliver Ciupke,et al.  Automatic detection of design problems in object-oriented reengineering , 1999, Proceedings of Technology of Object-Oriented Languages and Systems - TOOLS 30 (Cat. No.PR00278).

[32]  Ruth G. Shaw,et al.  Anova for Unbalanced Data: An Overview , 1993 .

[33]  Alexander L. Wolf,et al.  Acm Sigsoft Software Engineering Notes Vol 17 No 4 Foundations for the Study of Software Architecture , 2022 .

[34]  Baldoino Fonseca dos Santos Neto,et al.  Are you smelling it? Investigating how similar developers detect code smells , 2018, Inf. Softw. Technol..

[35]  Gabriele Bavota,et al.  Do they Really Smell Bad ? A Study on Developers ’ Perception of Code Bad Smells , 2014 .

[36]  Yann-Gaël Guéhéneuc,et al.  DECOR: A Method for the Specification and Detection of Code and Design Smells , 2010, IEEE Transactions on Software Engineering.

[37]  Randolph G. Bias,et al.  Research Methods for Human-Computer Interaction , 2010, J. Assoc. Inf. Sci. Technol..

[38]  Daniela E. Damian,et al.  Selecting Empirical Methods for Software Engineering Research , 2008, Guide to Advanced Empirical Software Engineering.

[39]  W. Shadish,et al.  Experimental and Quasi-Experimental Designs for Generalized Causal Inference , 2001 .

[40]  Paul Clements,et al.  Software architecture in practice , 1999, SEI series in software engineering.

[41]  Thomas J. Mowbray,et al.  AntiPatterns: Refactoring Software, Architectures, and Projects in Crisis , 1998 .

[42]  Paul Clements,et al.  Software Architecture in Practice: Addison-Wesley , 1998 .

[43]  Gries,et al.  The chi-square test for independence , 2022 .