skip to main content
10.1145/3210459.3210466acmotherconferencesArticle/Chapter ViewAbstractPublication PageseaseConference Proceedingsconference-collections
research-article

Can you tell me if it smells?: A study on how developers discuss code smells and anti-patterns in Stack Overflow

Published: 28 June 2018 Publication History

Abstract

This paper investigates how developers discuss code smells and anti-patterns over Stack Overflow to understand better their perceptions and understanding of these two concepts. Understanding developers' perceptions of these issues are important in order to inform and align future research efforts and direct tools vendors in the area of code smells and anti-patterns. In addition, such insights could lead the creation of solutions to code smells and anti-patterns that are better fit to the realities developers face in practice. We applied both quantitative and qualitative techniques to analyse discussions containing terms associated with code smells and anti-patterns. Our findings show that developers widely use Stack Overflow to ask for general assessments of code smells or anti-patterns, instead of asking for particular refactoring solutions. An interesting finding is that developers very often ask their peers 'to smell their code' (i.e., ask whether their own code 'smells' or not), and thus, utilize Stack Overflow as an informal, crowd-based code smell/anti-pattern detector. We conjecture that the crowd-based detection approach considers contextual factors, and thus, tends to be more trusted by developers over automated detection tools. We also found that developers often discuss the downsides of implementing specific design patterns, and 'flag' them as potential anti-patterns to be avoided. Conversely, we found discussions on why some anti-patterns previously considered harmful should not be flagged as anti-patterns. Our results suggest that there is a need for: 1) more context-based evaluations of code smells and anti-patterns, and 2) better guidelines for making trade-offs when applying design patterns or eliminating smells/anti-patterns in industry.

References

[1]
M Abbes, F Khomh, Y-G Gueheneuc, and G Antoniol. 2011. An Empirical Study of the Impact of Two Antipatterns Blob and Spaghetti Code on Program Comprehension. In 15th European Conference on Software Maintenance and Reengineering. 181--190.
[2]
M Allamanis and C Sutton. 2013. Why, when, and what: Analyzing Stack Overflow questions by topic, type, and code. In 2013 10th Working Conference on Mining Software Repositories. 53--56.
[3]
K Bajaj, K Pattabiraman, and A Mesbah. 2014. Mining Questions Asked by Web Developers. In 11th Working Conference on Mining Software Repositories. ACM, New York, NY, USA, 112--121.
[4]
A Barua, S. W Thomas, and A. E Hassan. 2014. What Are Developers Talking About? An Analysis of Topics and Trends in Stack Overflow. Empirical Software Engineering 19, 3 (6 2014), 619--654.
[5]
G Bavota, A Qusef, R Oliveto, A De Lucia, and D Binkley. 2014. Are test smells really harmful? An empirical study. 20, 4 (may 2014), 1052--1094.
[6]
W. J Brown, R. C Malveau, H McCormick III, and T. J Mowbray. 1998. AntiPatterns: Refactoring Software, Architectures, and Projects in Crisis. John Wiley & Sons, Inc, New York, NY, USA.
[7]
E Choi, N Yoshida, R G Kula, and K Inoue. 2015. What do practitioners ask about code clone? a preliminary investigation of stack overflow. In 2015 IEEE 9th International Workshop on Software Clones. 49--50.
[8]
F. A. Fontana, J Dietrich, B Walter, A Yamashita, and M Zanoni. 2016. Anti-pattern and code smell false positives: Preliminary conceptualisation and classification. In 23rd International Conference on Software Analysis, Evolution, and Reengineering, Vol. 2016-Janua. 609--613.
[9]
M Fowler. 1999. Refactoring: Improving the Design of Existing Code. Addison-Wesley.
[10]
J Garcia, D Popescu, G Edwards, and N Medvidovic. 2009. Identifying architectural bad smells. In 13th European Conference on Software Maintenance and Reengineering. IEEE, 255--258.
[11]
T Hall, M Zhang, D Bowes, and Y Sun. 2014. Some Code Smells Have a Significant but Small Effect on Faults. ACM Transactions on Software Engineering and Methodology 23, 4 (9 2014), 33:1--33:39.
[12]
F Hermans, M Pinzger, and A van Deursen. 2014. Detecting and refactoring code smells in spreadsheet formulas. Empirical Software Engineering (2014), 1--27.
[13]
F Khomh, M Di. Penta, and Y-G Gueheneuc. 2009. An Exploratory Study of the Impact of Code Smells on Software Change-proneness. In 16th Working Conference on Reverse Engineering. IEEE.
[14]
M Lanza and R Marinescu. 2006. Object-oriented metrics in practice. Springer. 1--205 pages.
[15]
M Linares-Vásquez, G Bavota, M Di Penta, R Oliveto, and D Poshyvanyk. 2014. How Do API Changes Trigger Stack Overflow Discussions? A Study on the Android SDK. In 22nd International Conference on Program Comprehension. ACM, New York, NY, USA, 83--94.
[16]
Robert C Martin and M Micah. 2006. Agile Principles, Patterns, and Practices in C#. Prentice-Hall. 768 pages.
[17]
N Moha, Y.-G. Guéhéneuc, L Duchien, and Le Meur. 2010. DECOR: A Method for the Specification and Detection of Code and Design Smells. IEEE Transactions on Software Engineering 36, 1 (2010), 20--36.
[18]
S Nadi, S Krüger, M Mezini, and E Bodden. 2016. Jumping Through Hoops: Why Do Java Developers Struggle with Cryptography APIs?. In 38th International Conference on Software Engineering. ACM, New York, NY, USA, 935--946.
[19]
N Novielli, F Calefato, and F Lanubile. 2015. The Challenges of Sentiment Detection in the Social Programmer Ecosystem. In 7th International Workshop on Social Software Engineering (SSE 2015). ACM, New York, NY, USA, 33--40.
[20]
A Pal, S Chang, and J Konstan. 2012. Evolution of Experts in Question Answering Communities. In 6th International AAAI Conference on Weblogs and Social Media.
[21]
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 30th International Conference on Software Maintenance and Evolution. 101--110.
[22]
F Palomba, G Bavota, M D Penta, R Oliveto, D Poshyvanyk, and A De Lucia. 2015. Mining Version Histories for Detecting Code Smells. IEEE Transactions on Software Engineering 41, 5 (5 2015), 462--489.
[23]
G Pinto, F Castor, and Yu D Liu. 2014. Mining Questions About Software Energy Consumption. In 11th Working Conference on Mining Software Repositories (MSR 2014). ACM, New York, NY, USA, 22--31.
[24]
M Rebouças, G Pinto, F Ebert, W Torres, A Serebrenik, and F Castor. 2016. An Empirical Study on the Usage of the Swift Programming Language. In 23rd International Conference on Software Analysis, Evolution, and Reengineering, Vol. 1. 634--638.
[25]
C Rosen and E Shihab. 2016. What Are Mobile Developers Asking About? A Large Scale Study Using Stack Overflow. Empirical Software Engineering 21, 3 (6 2016), 1192--1223.
[26]
V S Sinha, S Mani, and M Gupta. 2013. Exploring activeness of users in QA forums. In 2013 10th Working Conference on Mining Software Repositories. 77--80.
[27]
D I.K. Sjoberg, A Yamashita, B C.D. Anda, A Mockus, and T Dyba. 2013. Quantifying the Effect of Code Smells on Maintenance Effort. IEEE Transactions on Software Engineering 39, 8 (8 2013), 1144--1156.
[28]
Z Soh, A Yamashita, F Khomh, and Y.-G. Gueheneuc. 2016. Do Code Smells Impact the Effort of Different Maintenance Programming Activities?. In 23rd International Conference on Software Analysis, Evolution, and Reengineering. IEEE, 393--402.
[29]
A Strauss and J Corbin. 1998. Basics of Qualitative Research: Techniques and Procedures for Developing Grounded Theory. SAGE Publications.
[30]
S Subramanian, L Inozemtseva, and R Holmes. 2014. Live API Documentation. In 36th International Conference on Software Engineering. ACM, New York, NY, USA, 643--652.
[31]
A Tahir, S Counsell, and S G MacDonell. 2016. An Empirical Study into the Relationship Between Class Features and Test Smells. In 2016 23rd Asia-Pacific Software Engineering Conference (APSEC). IEEE, 137--144.
[32]
A Tahir, A Yamashita, S Licorish, J Dietrich, and S Counsell. 2018. Supplementary material for "can you tell me if it smells? A study on how developers discuss code smells and anti-patterns in Stack Overflow". Dataset. (2018).
[33]
N Tsantalis and A Chatzigeorgiou. 2009. Identification of Move Method Refactoring Opportunities. IEEE Transactions on Software Engineering 35, 3 (5 2009), 347--367.
[34]
M Tufano, F Palomba, G Bavota, R Oliveto, M Di Penta, A De Lucia, and D Poshyvanyk. 2015. When and Why Your Code Starts to Smell Bad. In 37th International Conference on Software Engineering. IEEE, Piscataway, NJ, USA, 403--414.
[35]
S Wang, D Lo, and L Jiang. 2013. An empirical study on developer interactions in StackOverflow. In 28th Annual ACM Symposium on Applied Computing. ACM Press, New York, New York, USA, 1019.
[36]
A Yamashita. 2014. Assessing the capability of code smells to explain maintenance problems: an empirical study combining quantitative and qualitative data. Empirical Software Engineering 19, 4 (8 2014), 1111--1143.
[37]
A Yamashita and S Counsell. 2013. Code smells as system-level indicators of maintainability: An Empirical Study. Journal of Systems and Software (2013).
[38]
A Yamashita and L Moonen. 2013. Do developers care about code smells? An exploratory survey. In 20th Working Conference on Reverse Engineering. IEEE, 242--251.
[39]
M Zhang, T Hall, and N Baddoo. 2011. Code Bad Smells: a review of current knowledge. Journal of Software Maintenance and Evolution: Research and Practice 23, 3 (4 2011), 179--202.

Cited By

View all
  • (2024)Semantic Web Approaches in Stack OverflowInternational Journal on Semantic Web and Information Systems10.4018/IJSWIS.35861720:1(1-61)Online publication date: 9-Nov-2024
  • (2024)“The Law Doesn’t Work Like a Computer”: Exploring Software Licensing Issues Faced by Legal PractitionersProceedings of the ACM on Software Engineering10.1145/36437661:FSE(882-905)Online publication date: 12-Jul-2024
  • (2023)Identification of Code Properties that Support Code Smell Analysis2023 46th MIPRO ICT and Electronics Convention (MIPRO)10.23919/MIPRO57284.2023.10159875(1664-1669)Online publication date: 22-May-2023
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Other conferences
EASE '18: Proceedings of the 22nd International Conference on Evaluation and Assessment in Software Engineering 2018
June 2018
223 pages
ISBN:9781450364034
DOI:10.1145/3210459
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 the author(s) 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].

In-Cooperation

  • The University of Canterbury

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 28 June 2018

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. Code smells
  2. Stack Overflow
  3. anti-patterns
  4. empirical study
  5. mining software repositories

Qualifiers

  • Research-article
  • Research
  • Refereed limited

Conference

EASE'18

Acceptance Rates

Overall Acceptance Rate 71 of 232 submissions, 31%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)34
  • Downloads (Last 6 weeks)9
Reflects downloads up to 28 Feb 2025

Other Metrics

Citations

Cited By

View all
  • (2024)Semantic Web Approaches in Stack OverflowInternational Journal on Semantic Web and Information Systems10.4018/IJSWIS.35861720:1(1-61)Online publication date: 9-Nov-2024
  • (2024)“The Law Doesn’t Work Like a Computer”: Exploring Software Licensing Issues Faced by Legal PractitionersProceedings of the ACM on Software Engineering10.1145/36437661:FSE(882-905)Online publication date: 12-Jul-2024
  • (2023)Identification of Code Properties that Support Code Smell Analysis2023 46th MIPRO ICT and Electronics Convention (MIPRO)10.23919/MIPRO57284.2023.10159875(1664-1669)Online publication date: 22-May-2023
  • (2023)Hearing the voice of experts: Unveiling Stack Exchange communities’ knowledge of test smells2023 IEEE/ACM 16th International Conference on Cooperative and Human Aspects of Software Engineering (CHASE)10.1109/CHASE58964.2023.00017(80-91)Online publication date: May-2023
  • (2023)Characterizing architecture related posts and their usefulness in Stack OverflowJournal of Systems and Software10.1016/j.jss.2023.111608198(111608)Online publication date: Apr-2023
  • (2023)A study of update request comments in Stack Overflow answer postsJournal of Systems and Software10.1016/j.jss.2022.111590198(111590)Online publication date: Apr-2023
  • (2022)Code smell analysis in cloned Java variantsProceedings of the 26th ACM International Systems and Software Product Line Conference - Volume A10.1145/3546932.3547015(250-254)Online publication date: 12-Sep-2022
  • (2022)What Refactoring Topics Do Developers Discuss? A Large Scale Empirical Study Using Stack OverflowIEEE Access10.1109/ACCESS.2021.314003610(56362-56374)Online publication date: 2022
  • (2022)An empirical study on the challenges that developers encounter when developing Apache Spark applicationsJournal of Systems and Software10.1016/j.jss.2022.111488194:COnline publication date: 1-Dec-2022
  • (2022)An analysis of open source software licensing questions in Stack Exchange sitesJournal of Systems and Software10.1016/j.jss.2021.111113183(111113)Online publication date: Jan-2022
  • Show More Cited By

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media