SlideShare uma empresa Scribd logo
1 de 33
Baixar para ler offline
How Do I Refactor This?
An Empirical Study on
Refactoring Trends and
Topics in Stack Overflow
Anthony Peruma · Steven Simmons ·
Eman AlOmar · Christian Newman ·
Mohamed Mkaouer · Ali Ouni
I C S E J o u r n a l - F i r s t P a p e r
Software Refactoring
2
An essential part of software maintenance and evolution
Improves the internal quality of the system, and reduce its
technical debt
Research in refactoring is well-established
➢ Detection of refactoring opportunities & code recommendations
Refactoring research is
continually evolving
Are developers applying refactorings in the
same environments, on problems with the
same characteristics and context, as
researchers assume?
• Refactoring is no longer about correcting
code smells
• Industry projects are complex and require
more complicated solutions
• Prior studies interviewed developers
GOAL
4
Understand the trends and challenges
around developer discussions on software
refactoring concepts and activities
The most popular programming-specific question and answer forum
Over 19 million questions and one million users
Research Questions
6
RQ1: How have refactoring discussions on Stack Overflow
grown over the years?
RQ2: What do developers discuss in refactoring-based
Stack Overflow posts?
RQ3: Which topics are the most popular and difficult
among refactoring-related questions?
7
Study Methodology
Experiment design
8
Posts – Questions, Answers &
Accepted Answers
Tags – Associated with a question
Score – Higher the score the
better
View Count – Number of time
the post was viewed
Posts with the refactor tag
Posts having ‘refactor’ in the
title
Quantitative – database
queries and custom code
Qualitative – manually
analyzing a statistically
significant sample
Anatomy of a post
9
tags
score
title
body
views
QUESTION
ANSWER
score
accepted answer
A mixed-methods approach
10
Summary of collected data
11
12
Empirical Results
How have refactoring discussions on
Stack Overflow grown over the years?
1. How have refactoring posts grown throughout
the years?
2. What is the distribution of questions and answers
among developers?
3. What are the tags that are associated with
refactoring questions?
RQ 1
13
RQ 1.1: How have refactoring posts grown throughout the
years?
Approach:
• Extract all questions that had the term ‘refactor’ in either the title or tag
• Extract all answers (i.e., accepted and non-accepted) associated with the
questions
Findings:
• 9,489 questions, from which, 828 did not have an associated answer
• Median time between a question and its first answer is 0.27 hours
• While the number of questions and accepted answers have increased yearly,
the volume by which they increased has been falling
14
RQ 1.2: What is the distribution of questions and answers
among developers?
Approach:
• Utilize the OwnerUserId field to identify the creator of a post
Findings:
• 7,795 distinct users are responsible for creating all refactoring questions
• Most developers asking questions, tend to only ask questions and not answer
questions
• Most developers would ask only one refactoring question
15
RQ 1.3: What are the tags that are associated with
refactoring questions?
Approach:
• Extract all distinct tags from all refactoring posts
• Manual review of the tags
Findings:
• 3,053 distinct tags
• Top five tags are related to programming
languages (or web frameworks) – Java, C#,
JavaScript, Ruby on Rails, and Ruby
• Constant rise in JavaScript questions
16
17
RQ 1 Summary
How have refactoring discussions on Stack Overflow
grown over the years?
• Stack Overflow is a popular venue for refactoring discussions between developers
• Refactoring questions usually receive a response in a short period of time
• There is a rise in questions around dynamically typed languages such as JavaScript
• Most tags are on algorithm and programming concepts, followed by frameworks
What do developers discuss in
refactoring-based Stack Overflow posts?
1. What are the frequent terms utilized by developers
in refactoring discussions?
2. To what extent do traditional refactoring
opportunities, known in existing literature, match
with the challenges faced by developers in Stack
Overflow posts?
3. What are the topics around software refactoring
that are being asked by developers?
RQ 2
18
RQ 2.1: What are the frequent terms utilized by developers
in refactoring discussions?
Approach:
• Extract the top keywords as bigrams from question posts
• Existence of terms correspond to refactoring operations
Findings:
• IDE ‘visual studio’ plays an important part in refactoring
discussions – the IDE supports multiple languages
• ‘refactoring tool’ shows the importance and reliance of tools
and IDEs in refactoring activities
• ‘legacy code’ highlights a common reason why developers
request support with refactoring
• Code extraction and moving are frequently discussed
19
RQ 2.2: To what extent do traditional refactoring opportunities, known in
existing literature, match with the challenges faced by developers in Stack
Overflow posts?
Approach:
• Occurrence of Self-Affirmed Refactoring terms in questions
Findings:
• Frequent mention of key internal quality attributes -- dependency, inheritance
• Use of terms such as ‘clean up’ or ‘redesign’ to discuss refactorings
• Non-functional attribute discussion around ‘readability’, ‘efficiency’, and
‘performance’
20
RQ 2.3: What are the topics around software refactoring that
are being asked by developers?
Approach:
• Topic modeling analysis using
latent Dirichlet allocation
• Includes text-preprocessing
• Use of topic coherence, perplexity
and visualization to determine the
optimum number of topics
• Manual analysis of a statistically
significant sample of questions
21
Findings:
RQ 2.3: What are the topics around software refactoring that
are being asked by developers?
22
Code
Optimization
Simplifying code
structures
Improve readability
and reusability
Reduce lengthy
switch-case
statements, loops,
and duplicate code
Tools and
IDEs
Perform complex
refactorings
Renaming software
artifacts
Architecture
and Design
Patterns
Accumulation of
code updates violate
design principles
Applying SOLID, DRY,
SRP, and KISS
principles
Unit Testing
Challenges with
evolving the test
suite alongside the
source code
Database
Business logic within
SQL scripts grow in
length and
complexity
Challenges with
readability, design
principles, and
system performance
23
RQ 2 Summary
What do developers discuss in refactoring-based
Stack Overflow posts?
• Refactoring discussions revolve around five topics – Code Optimization, Tools and
IDEs, Architecture and Design Patterns, Unit Testing, and Database
• Maintainability is a key concern
• Improving readability and reusability is of utmost concern
• Challenges in synchronizing refactoring changes across software engineering artifacts
Which topics are the most popular
and difficult among refactoring-
related questions?
RQ 3
24
Which topics are the most popular and difficult among
refactoring-related questions?
Approach:
• Measure popularity using a questions view count, favorite count, and score
• Measure difficulty: questions without answers, without accepted answers and
median time for an accepted answer
Findings:
• Questions on Tools/IDEs is the most popular, Database is the least popular
• Tools/IDE questions get more views than code optimization questions
• Questions on Tools/IDE are mostly unanswered than others
• Code Optimization questions are less challenging to answer 25
26
Discussion & Takeaways
Supporting the community
27
Research/Academic
Community
Developer
Community
Tool/IDE Vendor
Community
Research/Academic community
• Course curriculum to reflect real-world settings
• Adaptation of refactoring operations for multiple
programming language and artifact types
• Improve and extend the applicability of
readability quality metrics
• Expand the study and applicability of reusability
beyond source code
28
Tool/IDE vendor community
• Automatic synchronization between project
artifacts
• Enhanced rename refactoring functionality
• Enhance the user experience
29
Developer community
• Extend coding standards utilized in projects to
support naming standards for all project artifacts
• Integrating code quality tools into the build
process for the early detection of poor coding
practices
• Perform frequent and early peer-reviews on all
project artifacts
30
31
Conclusion
Conclusion
A quantitative and qualitative analysis of refactoring questions asked by
developers on Stack Overflow
Findings:
• Stack Overflow is a popular venue for developers to seek assistance with refactoring
• Growth in refactoring dynamically typed code such as Python and JavaScript
• Most questions are around optimizing source code to improve readability and reusability
• Refactoring is not limited to source code – database and unit testing artifact refactoring is common
• Tools are also a popular discussion topic among developers
32
Preprint: https://arxiv.org/abs/2110.12229
Thank You!
33
Anthony Peruma
h t t p : / / p e r u m a . m e
h t t p : / / s c a n l . o r g

Mais conteúdo relacionado

Semelhante a How Do I Refactor This? An Empirical Study on Refactoring Trends and Topics in Stack Overflow

Why We Refactor? Confessions of GitHub Contributors
Why We Refactor? Confessions of GitHub ContributorsWhy We Refactor? Confessions of GitHub Contributors
Why We Refactor? Confessions of GitHub ContributorsNikolaos Tsantalis
 
The recommendations system for source code components retrieval
The recommendations system for source code components retrievalThe recommendations system for source code components retrieval
The recommendations system for source code components retrievalAYESHA JAVED
 
Agileand saas davepatterson_armandofox_050813webinar
Agileand saas davepatterson_armandofox_050813webinarAgileand saas davepatterson_armandofox_050813webinar
Agileand saas davepatterson_armandofox_050813webinarRoberto Jr. Figueroa
 
Xen Project Contributor Training - Part 1 introduction v1.0
Xen Project Contributor Training - Part 1 introduction v1.0Xen Project Contributor Training - Part 1 introduction v1.0
Xen Project Contributor Training - Part 1 introduction v1.0The Linux Foundation
 
The Role of the Software Architect (short version)
The Role of the Software Architect (short version)The Role of the Software Architect (short version)
The Role of the Software Architect (short version)Hayim Makabee
 
Code refactoring
Code refactoringCode refactoring
Code refactoringLalit Kale
 
Improve Product Design with High Quality Requirements
Improve Product Design with High Quality RequirementsImprove Product Design with High Quality Requirements
Improve Product Design with High Quality RequirementsElizabeth Steiner
 
What Do Developers Discuss about Code Comments?
What Do Developers Discuss about Code Comments?What Do Developers Discuss about Code Comments?
What Do Developers Discuss about Code Comments?Pooja Rani
 
Impact of Developer Reputa1on on Code Review Outcomes in OSS Projects: An Emp...
Impact of Developer Reputa1on on Code Review Outcomes in OSS Projects: An Emp...Impact of Developer Reputa1on on Code Review Outcomes in OSS Projects: An Emp...
Impact of Developer Reputa1on on Code Review Outcomes in OSS Projects: An Emp...JeffCarver32
 
124 - Impact of Developer Reputation on Code Review Outcomes in OSS Projects:...
124 - Impact of Developer Reputation on Code Review Outcomes in OSS Projects:...124 - Impact of Developer Reputation on Code Review Outcomes in OSS Projects:...
124 - Impact of Developer Reputation on Code Review Outcomes in OSS Projects:...ESEM 2014
 
Understanding and Executing on API Developer Experience
Understanding and Executing on API Developer ExperienceUnderstanding and Executing on API Developer Experience
Understanding and Executing on API Developer ExperienceKeshav Vasudevan
 
Understanding and Executing on API Developer Experience
Understanding and Executing on API Developer ExperienceUnderstanding and Executing on API Developer Experience
Understanding and Executing on API Developer ExperienceSmartBear
 
e-Business - SE trends
e-Business - SE trendse-Business - SE trends
e-Business - SE trendsVladimir Kotov
 
Quality, Cost, and Governance of Open Source Software
Quality, Cost, and Governance of Open Source SoftwareQuality, Cost, and Governance of Open Source Software
Quality, Cost, and Governance of Open Source SoftwareGirl Geek Dinners Milano
 
Capability Building for Cyber Defense: Software Walk through and Screening
Capability Building for Cyber Defense: Software Walk through and Screening Capability Building for Cyber Defense: Software Walk through and Screening
Capability Building for Cyber Defense: Software Walk through and Screening Maven Logix
 

Semelhante a How Do I Refactor This? An Empirical Study on Refactoring Trends and Topics in Stack Overflow (20)

Why We Refactor? Confessions of GitHub Contributors
Why We Refactor? Confessions of GitHub ContributorsWhy We Refactor? Confessions of GitHub Contributors
Why We Refactor? Confessions of GitHub Contributors
 
The recommendations system for source code components retrieval
The recommendations system for source code components retrievalThe recommendations system for source code components retrieval
The recommendations system for source code components retrieval
 
Agileand saas davepatterson_armandofox_050813webinar
Agileand saas davepatterson_armandofox_050813webinarAgileand saas davepatterson_armandofox_050813webinar
Agileand saas davepatterson_armandofox_050813webinar
 
Xen Project Contributor Training - Part 1 introduction v1.0
Xen Project Contributor Training - Part 1 introduction v1.0Xen Project Contributor Training - Part 1 introduction v1.0
Xen Project Contributor Training - Part 1 introduction v1.0
 
The Role of the Software Architect (short version)
The Role of the Software Architect (short version)The Role of the Software Architect (short version)
The Role of the Software Architect (short version)
 
Scope of software engineering
Scope of software engineeringScope of software engineering
Scope of software engineering
 
Code Inspection
Code InspectionCode Inspection
Code Inspection
 
Code refactoring
Code refactoringCode refactoring
Code refactoring
 
Improve Product Design with High Quality Requirements
Improve Product Design with High Quality RequirementsImprove Product Design with High Quality Requirements
Improve Product Design with High Quality Requirements
 
What Do Developers Discuss about Code Comments?
What Do Developers Discuss about Code Comments?What Do Developers Discuss about Code Comments?
What Do Developers Discuss about Code Comments?
 
Impact of Developer Reputa1on on Code Review Outcomes in OSS Projects: An Emp...
Impact of Developer Reputa1on on Code Review Outcomes in OSS Projects: An Emp...Impact of Developer Reputa1on on Code Review Outcomes in OSS Projects: An Emp...
Impact of Developer Reputa1on on Code Review Outcomes in OSS Projects: An Emp...
 
124 - Impact of Developer Reputation on Code Review Outcomes in OSS Projects:...
124 - Impact of Developer Reputation on Code Review Outcomes in OSS Projects:...124 - Impact of Developer Reputation on Code Review Outcomes in OSS Projects:...
124 - Impact of Developer Reputation on Code Review Outcomes in OSS Projects:...
 
Understanding and Executing on API Developer Experience
Understanding and Executing on API Developer ExperienceUnderstanding and Executing on API Developer Experience
Understanding and Executing on API Developer Experience
 
Understanding and Executing on API Developer Experience
Understanding and Executing on API Developer ExperienceUnderstanding and Executing on API Developer Experience
Understanding and Executing on API Developer Experience
 
e-Business - SE trends
e-Business - SE trendse-Business - SE trends
e-Business - SE trends
 
Quality, Cost, and Governance of Open Source Software
Quality, Cost, and Governance of Open Source SoftwareQuality, Cost, and Governance of Open Source Software
Quality, Cost, and Governance of Open Source Software
 
Capability Building for Cyber Defense: Software Walk through and Screening
Capability Building for Cyber Defense: Software Walk through and Screening Capability Building for Cyber Defense: Software Walk through and Screening
Capability Building for Cyber Defense: Software Walk through and Screening
 
Manual Software testing - software development life cycle
Manual Software testing - software development life cycleManual Software testing - software development life cycle
Manual Software testing - software development life cycle
 
The Role of the Architect
The Role of the ArchitectThe Role of the Architect
The Role of the Architect
 
Chapter 5 software process
Chapter 5 software processChapter 5 software process
Chapter 5 software process
 

Mais de University of Hawai‘i at Mānoa

Rename Chains: An Exploratory Study on the Occurrence and Characteristics of ...
Rename Chains: An Exploratory Study on the Occurrence and Characteristics of ...Rename Chains: An Exploratory Study on the Occurrence and Characteristics of ...
Rename Chains: An Exploratory Study on the Occurrence and Characteristics of ...University of Hawai‘i at Mānoa
 
Supporting the Maintenance of Identifier Names: A Holistic Approach to High-Q...
Supporting the Maintenance of Identifier Names: A Holistic Approach to High-Q...Supporting the Maintenance of Identifier Names: A Holistic Approach to High-Q...
Supporting the Maintenance of Identifier Names: A Holistic Approach to High-Q...University of Hawai‘i at Mānoa
 
Preparing for the Academic Job Market: Experience and Tips from a Recent F...
Preparing for the  Academic Job Market:  Experience and Tips from  a Recent F...Preparing for the  Academic Job Market:  Experience and Tips from  a Recent F...
Preparing for the Academic Job Market: Experience and Tips from a Recent F...University of Hawai‘i at Mānoa
 
Refactoring Debt: Myth or Reality? An Exploratory Study on the Relationship B...
Refactoring Debt: Myth or Reality? An Exploratory Study on the Relationship B...Refactoring Debt: Myth or Reality? An Exploratory Study on the Relationship B...
Refactoring Debt: Myth or Reality? An Exploratory Study on the Relationship B...University of Hawai‘i at Mānoa
 
Refactoring Debt: Myth or Reality? An Exploratory Study on the Relationship B...
Refactoring Debt: Myth or Reality? An Exploratory Study on the Relationship B...Refactoring Debt: Myth or Reality? An Exploratory Study on the Relationship B...
Refactoring Debt: Myth or Reality? An Exploratory Study on the Relationship B...University of Hawai‘i at Mānoa
 
Understanding Digits in Identifier Names: An Exploratory Study
Understanding Digits in Identifier Names: An Exploratory StudyUnderstanding Digits in Identifier Names: An Exploratory Study
Understanding Digits in Identifier Names: An Exploratory StudyUniversity of Hawai‘i at Mānoa
 
Using Grammar Patterns to Interpret Test Method Name Evolution
Using Grammar Patterns to Interpret Test Method Name EvolutionUsing Grammar Patterns to Interpret Test Method Name Evolution
Using Grammar Patterns to Interpret Test Method Name EvolutionUniversity of Hawai‘i at Mānoa
 
On the Distribution of "Simple Stupid Bugs" in Unit Test Files: An Explorator...
On the Distribution of "Simple Stupid Bugs" in Unit Test Files: An Explorator...On the Distribution of "Simple Stupid Bugs" in Unit Test Files: An Explorator...
On the Distribution of "Simple Stupid Bugs" in Unit Test Files: An Explorator...University of Hawai‘i at Mānoa
 
Contextualizing Rename Decisions using Refactorings and Commit Messages
Contextualizing Rename Decisions using Refactorings and Commit MessagesContextualizing Rename Decisions using Refactorings and Commit Messages
Contextualizing Rename Decisions using Refactorings and Commit MessagesUniversity of Hawai‘i at Mānoa
 
An Exploratory Study on the Refactoring of Unit Test Files in Android Applica...
An Exploratory Study on the Refactoring of Unit Test Files in Android Applica...An Exploratory Study on the Refactoring of Unit Test Files in Android Applica...
An Exploratory Study on the Refactoring of Unit Test Files in Android Applica...University of Hawai‘i at Mānoa
 
On the Distribution of Test Smells in Open Source Android Applications: An Ex...
On the Distribution of Test Smells in Open Source Android Applications: An Ex...On the Distribution of Test Smells in Open Source Android Applications: An Ex...
On the Distribution of Test Smells in Open Source Android Applications: An Ex...University of Hawai‘i at Mānoa
 
Permission Issues in Open-Source Android Apps: An Exploratory Study
Permission Issues in Open-Source Android Apps: An Exploratory StudyPermission Issues in Open-Source Android Apps: An Exploratory Study
Permission Issues in Open-Source Android Apps: An Exploratory StudyUniversity of Hawai‘i at Mānoa
 

Mais de University of Hawai‘i at Mānoa (20)

Rename Chains: An Exploratory Study on the Occurrence and Characteristics of ...
Rename Chains: An Exploratory Study on the Occurrence and Characteristics of ...Rename Chains: An Exploratory Study on the Occurrence and Characteristics of ...
Rename Chains: An Exploratory Study on the Occurrence and Characteristics of ...
 
A Primer on High-Quality Identifier Naming [ASE 2022]
A Primer on High-Quality Identifier Naming [ASE 2022]A Primer on High-Quality Identifier Naming [ASE 2022]
A Primer on High-Quality Identifier Naming [ASE 2022]
 
Supporting the Maintenance of Identifier Names: A Holistic Approach to High-Q...
Supporting the Maintenance of Identifier Names: A Holistic Approach to High-Q...Supporting the Maintenance of Identifier Names: A Holistic Approach to High-Q...
Supporting the Maintenance of Identifier Names: A Holistic Approach to High-Q...
 
Preparing for the Academic Job Market: Experience and Tips from a Recent F...
Preparing for the  Academic Job Market:  Experience and Tips from  a Recent F...Preparing for the  Academic Job Market:  Experience and Tips from  a Recent F...
Preparing for the Academic Job Market: Experience and Tips from a Recent F...
 
Refactoring Debt: Myth or Reality? An Exploratory Study on the Relationship B...
Refactoring Debt: Myth or Reality? An Exploratory Study on the Relationship B...Refactoring Debt: Myth or Reality? An Exploratory Study on the Relationship B...
Refactoring Debt: Myth or Reality? An Exploratory Study on the Relationship B...
 
A Primer on High-Quality Identifier Naming
A Primer on High-Quality Identifier NamingA Primer on High-Quality Identifier Naming
A Primer on High-Quality Identifier Naming
 
Test Anti-Patterns: From Definition to Detection
Test Anti-Patterns: From Definition to DetectionTest Anti-Patterns: From Definition to Detection
Test Anti-Patterns: From Definition to Detection
 
Refactoring Debt: Myth or Reality? An Exploratory Study on the Relationship B...
Refactoring Debt: Myth or Reality? An Exploratory Study on the Relationship B...Refactoring Debt: Myth or Reality? An Exploratory Study on the Relationship B...
Refactoring Debt: Myth or Reality? An Exploratory Study on the Relationship B...
 
Understanding Digits in Identifier Names: An Exploratory Study
Understanding Digits in Identifier Names: An Exploratory StudyUnderstanding Digits in Identifier Names: An Exploratory Study
Understanding Digits in Identifier Names: An Exploratory Study
 
IDEAL: An Open-Source Identifier Name Appraisal Tool
IDEAL: An Open-Source Identifier Name Appraisal ToolIDEAL: An Open-Source Identifier Name Appraisal Tool
IDEAL: An Open-Source Identifier Name Appraisal Tool
 
Using Grammar Patterns to Interpret Test Method Name Evolution
Using Grammar Patterns to Interpret Test Method Name EvolutionUsing Grammar Patterns to Interpret Test Method Name Evolution
Using Grammar Patterns to Interpret Test Method Name Evolution
 
On the Distribution of "Simple Stupid Bugs" in Unit Test Files: An Explorator...
On the Distribution of "Simple Stupid Bugs" in Unit Test Files: An Explorator...On the Distribution of "Simple Stupid Bugs" in Unit Test Files: An Explorator...
On the Distribution of "Simple Stupid Bugs" in Unit Test Files: An Explorator...
 
Contextualizing Rename Decisions using Refactorings and Commit Messages
Contextualizing Rename Decisions using Refactorings and Commit MessagesContextualizing Rename Decisions using Refactorings and Commit Messages
Contextualizing Rename Decisions using Refactorings and Commit Messages
 
An Exploratory Study on the Refactoring of Unit Test Files in Android Applica...
An Exploratory Study on the Refactoring of Unit Test Files in Android Applica...An Exploratory Study on the Refactoring of Unit Test Files in Android Applica...
An Exploratory Study on the Refactoring of Unit Test Files in Android Applica...
 
On the Distribution of Test Smells in Open Source Android Applications: An Ex...
On the Distribution of Test Smells in Open Source Android Applications: An Ex...On the Distribution of Test Smells in Open Source Android Applications: An Ex...
On the Distribution of Test Smells in Open Source Android Applications: An Ex...
 
A Preliminary Study of Android Refactorings
A Preliminary Study of Android RefactoringsA Preliminary Study of Android Refactorings
A Preliminary Study of Android Refactorings
 
Permission Issues in Open-Source Android Apps: An Exploratory Study
Permission Issues in Open-Source Android Apps: An Exploratory StudyPermission Issues in Open-Source Android Apps: An Exploratory Study
Permission Issues in Open-Source Android Apps: An Exploratory Study
 
A Career In IT
A Career In ITA Career In IT
A Career In IT
 
Web Content Management - Introduction
Web Content Management - IntroductionWeb Content Management - Introduction
Web Content Management - Introduction
 
Introduction to SignalR
Introduction to SignalRIntroduction to SignalR
Introduction to SignalR
 

Último

AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplatePresentation.STUDIO
 
ManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide DeckManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide DeckManageIQ
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024Mind IT Systems
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456KiaraTiradoMicha
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrandmasabamasaba
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesVictorSzoltysek
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrainmasabamasaba
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is insideshinachiaurasa2
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...Jittipong Loespradit
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfonteinmasabamasaba
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...Shane Coughlan
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 

Último (20)

AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
ManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide DeckManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide Deck
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456LEVEL 5   - SESSION 1 2023 (1).pptx - PDF 123456
LEVEL 5 - SESSION 1 2023 (1).pptx - PDF 123456
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 

How Do I Refactor This? An Empirical Study on Refactoring Trends and Topics in Stack Overflow

  • 1. How Do I Refactor This? An Empirical Study on Refactoring Trends and Topics in Stack Overflow Anthony Peruma · Steven Simmons · Eman AlOmar · Christian Newman · Mohamed Mkaouer · Ali Ouni I C S E J o u r n a l - F i r s t P a p e r
  • 2. Software Refactoring 2 An essential part of software maintenance and evolution Improves the internal quality of the system, and reduce its technical debt Research in refactoring is well-established ➢ Detection of refactoring opportunities & code recommendations
  • 3. Refactoring research is continually evolving Are developers applying refactorings in the same environments, on problems with the same characteristics and context, as researchers assume? • Refactoring is no longer about correcting code smells • Industry projects are complex and require more complicated solutions • Prior studies interviewed developers
  • 4. GOAL 4 Understand the trends and challenges around developer discussions on software refactoring concepts and activities
  • 5. The most popular programming-specific question and answer forum Over 19 million questions and one million users
  • 6. Research Questions 6 RQ1: How have refactoring discussions on Stack Overflow grown over the years? RQ2: What do developers discuss in refactoring-based Stack Overflow posts? RQ3: Which topics are the most popular and difficult among refactoring-related questions?
  • 8. Experiment design 8 Posts – Questions, Answers & Accepted Answers Tags – Associated with a question Score – Higher the score the better View Count – Number of time the post was viewed Posts with the refactor tag Posts having ‘refactor’ in the title Quantitative – database queries and custom code Qualitative – manually analyzing a statistically significant sample
  • 9. Anatomy of a post 9 tags score title body views QUESTION ANSWER score accepted answer
  • 13. How have refactoring discussions on Stack Overflow grown over the years? 1. How have refactoring posts grown throughout the years? 2. What is the distribution of questions and answers among developers? 3. What are the tags that are associated with refactoring questions? RQ 1 13
  • 14. RQ 1.1: How have refactoring posts grown throughout the years? Approach: • Extract all questions that had the term ‘refactor’ in either the title or tag • Extract all answers (i.e., accepted and non-accepted) associated with the questions Findings: • 9,489 questions, from which, 828 did not have an associated answer • Median time between a question and its first answer is 0.27 hours • While the number of questions and accepted answers have increased yearly, the volume by which they increased has been falling 14
  • 15. RQ 1.2: What is the distribution of questions and answers among developers? Approach: • Utilize the OwnerUserId field to identify the creator of a post Findings: • 7,795 distinct users are responsible for creating all refactoring questions • Most developers asking questions, tend to only ask questions and not answer questions • Most developers would ask only one refactoring question 15
  • 16. RQ 1.3: What are the tags that are associated with refactoring questions? Approach: • Extract all distinct tags from all refactoring posts • Manual review of the tags Findings: • 3,053 distinct tags • Top five tags are related to programming languages (or web frameworks) – Java, C#, JavaScript, Ruby on Rails, and Ruby • Constant rise in JavaScript questions 16
  • 17. 17 RQ 1 Summary How have refactoring discussions on Stack Overflow grown over the years? • Stack Overflow is a popular venue for refactoring discussions between developers • Refactoring questions usually receive a response in a short period of time • There is a rise in questions around dynamically typed languages such as JavaScript • Most tags are on algorithm and programming concepts, followed by frameworks
  • 18. What do developers discuss in refactoring-based Stack Overflow posts? 1. What are the frequent terms utilized by developers in refactoring discussions? 2. To what extent do traditional refactoring opportunities, known in existing literature, match with the challenges faced by developers in Stack Overflow posts? 3. What are the topics around software refactoring that are being asked by developers? RQ 2 18
  • 19. RQ 2.1: What are the frequent terms utilized by developers in refactoring discussions? Approach: • Extract the top keywords as bigrams from question posts • Existence of terms correspond to refactoring operations Findings: • IDE ‘visual studio’ plays an important part in refactoring discussions – the IDE supports multiple languages • ‘refactoring tool’ shows the importance and reliance of tools and IDEs in refactoring activities • ‘legacy code’ highlights a common reason why developers request support with refactoring • Code extraction and moving are frequently discussed 19
  • 20. RQ 2.2: To what extent do traditional refactoring opportunities, known in existing literature, match with the challenges faced by developers in Stack Overflow posts? Approach: • Occurrence of Self-Affirmed Refactoring terms in questions Findings: • Frequent mention of key internal quality attributes -- dependency, inheritance • Use of terms such as ‘clean up’ or ‘redesign’ to discuss refactorings • Non-functional attribute discussion around ‘readability’, ‘efficiency’, and ‘performance’ 20
  • 21. RQ 2.3: What are the topics around software refactoring that are being asked by developers? Approach: • Topic modeling analysis using latent Dirichlet allocation • Includes text-preprocessing • Use of topic coherence, perplexity and visualization to determine the optimum number of topics • Manual analysis of a statistically significant sample of questions 21 Findings:
  • 22. RQ 2.3: What are the topics around software refactoring that are being asked by developers? 22 Code Optimization Simplifying code structures Improve readability and reusability Reduce lengthy switch-case statements, loops, and duplicate code Tools and IDEs Perform complex refactorings Renaming software artifacts Architecture and Design Patterns Accumulation of code updates violate design principles Applying SOLID, DRY, SRP, and KISS principles Unit Testing Challenges with evolving the test suite alongside the source code Database Business logic within SQL scripts grow in length and complexity Challenges with readability, design principles, and system performance
  • 23. 23 RQ 2 Summary What do developers discuss in refactoring-based Stack Overflow posts? • Refactoring discussions revolve around five topics – Code Optimization, Tools and IDEs, Architecture and Design Patterns, Unit Testing, and Database • Maintainability is a key concern • Improving readability and reusability is of utmost concern • Challenges in synchronizing refactoring changes across software engineering artifacts
  • 24. Which topics are the most popular and difficult among refactoring- related questions? RQ 3 24
  • 25. Which topics are the most popular and difficult among refactoring-related questions? Approach: • Measure popularity using a questions view count, favorite count, and score • Measure difficulty: questions without answers, without accepted answers and median time for an accepted answer Findings: • Questions on Tools/IDEs is the most popular, Database is the least popular • Tools/IDE questions get more views than code optimization questions • Questions on Tools/IDE are mostly unanswered than others • Code Optimization questions are less challenging to answer 25
  • 28. Research/Academic community • Course curriculum to reflect real-world settings • Adaptation of refactoring operations for multiple programming language and artifact types • Improve and extend the applicability of readability quality metrics • Expand the study and applicability of reusability beyond source code 28
  • 29. Tool/IDE vendor community • Automatic synchronization between project artifacts • Enhanced rename refactoring functionality • Enhance the user experience 29
  • 30. Developer community • Extend coding standards utilized in projects to support naming standards for all project artifacts • Integrating code quality tools into the build process for the early detection of poor coding practices • Perform frequent and early peer-reviews on all project artifacts 30
  • 32. Conclusion A quantitative and qualitative analysis of refactoring questions asked by developers on Stack Overflow Findings: • Stack Overflow is a popular venue for developers to seek assistance with refactoring • Growth in refactoring dynamically typed code such as Python and JavaScript • Most questions are around optimizing source code to improve readability and reusability • Refactoring is not limited to source code – database and unit testing artifact refactoring is common • Tools are also a popular discussion topic among developers 32 Preprint: https://arxiv.org/abs/2110.12229
  • 33. Thank You! 33 Anthony Peruma h t t p : / / p e r u m a . m e h t t p : / / s c a n l . o r g