36th IEEE International Conference on Software Maintenance and Evolution
September 27-October 3, Journal First Track
Code smells and refactoring: A tertiary review of
challenges and observations
Guilherme Lacerda, Fábio Petrillo, Marcelo Pimenta, and Yann Gaël Guéhéneuc
Brazil Brazil Canada Canada
Published: JSS, 167 (2020)
Preprint: https://arxiv.org/abs/2004.10777
Introduction
and Background
Introduction and Background
▪ Refactoring and Smells
▪ Several secondary studies have been published on code smells and refactoring
▪ Tertiary Systematic Literature Review
▪ Surveys, secondary systematic literature reviews, and systematic mappings
▪ 40 secondary studies selected
▪ Challenges and Observations
Research Questions
RQ1: What refactoring-related topics have been investigated in secondary studies?
RQ2: What smells-related topics have been investigated in secondary studies?
RQ3: Which tools have been mentioned for code smell detection and refactoring support?
RQ4: Which RQs have been studied on code smells and refactoring? What are the highest
cited secondary studies?
RQ5: What are the annual trends of types, quality, and the number of primary studies
reviewed by the secondary studies?
Study Design
Study Design
Definition of
Goal and RQs
(3.1)
Identification of
Relevant Papers
and Search String
(3.2)
Selection
Criteria
(3.3)
Apply Quality
Assessment
(3.4)
Data Extraction
and Execution
(3.5, 3.6)
Lacerda, G., 2019. Online Repository for Tertiary Systematic Review about Code Smells and Refactoring (Package Replication).
https://bit.ly/2WRD1N2
Search databases
ACM (30), IEEE (65),
Scopus (58), Science
Direct (130), Springer
(89), Google Scholar
(33), AIS (40), Wiley (22)
467
1st selection of
studies
Using selection
criteria (title,
abstract, keywords)
59
Duplicated papers
and 2nd selection
of studies
Using selection criteria
(full text analysis)
33 Snowballing
40 Total of selected
studies
Study Design
Top-10
(Example)
Findings
RQ1
What refactoring-related topics have been
investigated in secondary studies?
RQ1 Summary
▪ Topics
▪ Opportunities, techniques, refactoring tools, refactoring in other contexts, and others
▪ Challenges
▪ Relationship between smells and refactoring is not a one to one
▪ Encourage researchers to improve the results most commonly used in practice
▪ Observations
▪ Extraction techniques are the most mentioned
▪ Number of techniques explored is still small (between 20 and 27 of 72)
▪ Quality metrics-oriented approach, precondition-oriented approach, and clustering-oriented
approach are most cited approaches
▪ Some refactoring, when applied, negatively affect the quality
RQ2
What smells-related topics have been
investigated in secondary studies?
RQ2 Summary
▪ Challenges
▪ Smells naming standardization is necessary
▪ Co-occurence of smells
▪ Explore and improve methods of defining, specify, and capture the smell context
▪ Observations
▪ Blob and Duplicated code/clones are most mentioned design and code smell, respectively
▪ God Class/Large Class has been the most investigated smell (Technical Debt)
▪ metrics-oriented approach and strategies/rules are most cited approaches to detection
▪ Topics
▪ Smells detection, code smell description, support tools for smell detection, and others
RQ3
Which tools have been mentioned for code
smell detection and refactoring support?
RQ3 Summary
▪ Challenges
▪ To develop tools that support more than one programming languages
▪ To expand the studies and experiments, improving the accuracy of the smell detection tools
and refactoring support
▪ Limitations and lack of maturity of tools
▪ Observations
▪ Several aspects characterize tools (license, supported languages, degree of automation, and
others)
▪ Java is the platform/programming language most used
▪ Large number of smell detection tools, detecting only a tiny amount of smells
▪ Number of refactoring tools is small
▪ CCFinder and Jdeodorant are the most cited tools
RQ4
Which RQs have been studied on code smells and
refactoring? What are the highest
cited secondary studies?
Top 5 selected studies
▪ Sorted by the number of citations by year
▪ Sorted by the number of citations of Google Scholar
RQ4 Summary
▪ Challenges
▪ Need for studies that contain more sophisticated RQs
▪ Studies covering RQs about Casuality and Design, describing situations of efficacy and
efficiency about methods, practices, and tools
▪ Observations
▪ 181 RQs in the 40 selected secondary studies
▪ One study is the most comprehensive work, with 13 RQs
▪ Some studies did not follow a defined protocol
▪ Scope of the study is related to the scope of the RQ
RQ5
What are the annual trends of types, quality, and
the number of primary studies reviewed by the
secondary studies?
Summary
Distribution of studies types cited
Type of referenced projects
Number of primary studies referenced per year
RQ5 Summary
▪ Challenges
▪ Lack of validation by experts on tool analysis
▪ Lack of benchmarks to support improvements of techniques and tools for both smells
and refactorings
▪ Observations
▪ Growth of secondary studies in recent years
▪ Vast majority of studies are SLR (65%), and 75% of studies are published in journals
Relationship between
code smells and refactoring
Smells and Refactoring connected by Quality
Primitive Refactorings
(renames, extracts, etc)
Composite Refactorings
(Replace conditional with, etc)
Approaches to Opportunities
(metrics, strategies/rules, search, etc )
Support Tools
Refactorings
Simple Smells
(magic numbers, long parameter list, etc)
Composite Smells
(God Class/Large Class, Blobs, etc)
Approaches to Detect
(metrics, strategies/rules, etc )
Support Tools
Code Smells
Internal Quality Attributes
Cohesion, Coupling, Size...
External Quality Attributes
Maintainability, Testability, Functionality...
Quality
Technical Debt
Management, Prioritizing, Mitigate...
Quality, Smells, and Refactoring
Implications
and Open Issues
Implications
▪ Practitioners
▪ Refactoring practice should be a daily habit
▪ Developers know the values of refactoring but are often prevented from applying them
▪ Code smells priorization, impact of quality attributes
▪ Instructors
▪ Include these topics in various courses
▪ Practices: Coding dojos, code review sessions, testing, and pair programming
▪ Researchers
▪ Impact of code smells and refactoring
▪ Industry-academic collaboration
Open Issues
Contributions
and Future Work
Contributions and Future Work
▪ Contributions
▪ We cross-reference the most frequent code smells with their detection approaches, detection
tools, suggested refactoring, and refactoring tools
▪ We report the relationships of the top 10 code smells with their refactoring and their impact
on quality
▪ We present the implications of this study from the perspective of practitioners, researchers, and
instructors
▪ We report on 13 open issues about code smells and refactoring
▪ Future works
▪ Practices and tools to mitigate the code smell and evaluate the impact on quality
▪ Goal of refactoring used by practitioners and their effect on quality
▪ Development/improvement of refactoring tools to monitor refactoring and its gains
36th IEEE International Conference on Software Maintenance and Evolution
September 27-October 3, Journal First Track
Code smells and refactoring: A tertiary review of
challenges and observations
Guilherme Lacerda, Fábio Petrillo, Marcelo Pimenta, and Yann Gaël Guéhéneuc
Thank You!
Brazil Brazil Canada Canada

Icsm20.ppt

  • 1.
    36th IEEE InternationalConference on Software Maintenance and Evolution September 27-October 3, Journal First Track Code smells and refactoring: A tertiary review of challenges and observations Guilherme Lacerda, Fábio Petrillo, Marcelo Pimenta, and Yann Gaël Guéhéneuc Brazil Brazil Canada Canada
  • 2.
    Published: JSS, 167(2020) Preprint: https://arxiv.org/abs/2004.10777
  • 3.
  • 4.
    Introduction and Background ▪Refactoring and Smells ▪ Several secondary studies have been published on code smells and refactoring ▪ Tertiary Systematic Literature Review ▪ Surveys, secondary systematic literature reviews, and systematic mappings ▪ 40 secondary studies selected ▪ Challenges and Observations
  • 5.
    Research Questions RQ1: Whatrefactoring-related topics have been investigated in secondary studies? RQ2: What smells-related topics have been investigated in secondary studies? RQ3: Which tools have been mentioned for code smell detection and refactoring support? RQ4: Which RQs have been studied on code smells and refactoring? What are the highest cited secondary studies? RQ5: What are the annual trends of types, quality, and the number of primary studies reviewed by the secondary studies?
  • 6.
  • 7.
    Study Design Definition of Goaland RQs (3.1) Identification of Relevant Papers and Search String (3.2) Selection Criteria (3.3) Apply Quality Assessment (3.4) Data Extraction and Execution (3.5, 3.6) Lacerda, G., 2019. Online Repository for Tertiary Systematic Review about Code Smells and Refactoring (Package Replication). https://bit.ly/2WRD1N2 Search databases ACM (30), IEEE (65), Scopus (58), Science Direct (130), Springer (89), Google Scholar (33), AIS (40), Wiley (22) 467 1st selection of studies Using selection criteria (title, abstract, keywords) 59 Duplicated papers and 2nd selection of studies Using selection criteria (full text analysis) 33 Snowballing 40 Total of selected studies
  • 8.
  • 9.
  • 10.
    RQ1 What refactoring-related topicshave been investigated in secondary studies?
  • 11.
    RQ1 Summary ▪ Topics ▪Opportunities, techniques, refactoring tools, refactoring in other contexts, and others ▪ Challenges ▪ Relationship between smells and refactoring is not a one to one ▪ Encourage researchers to improve the results most commonly used in practice ▪ Observations ▪ Extraction techniques are the most mentioned ▪ Number of techniques explored is still small (between 20 and 27 of 72) ▪ Quality metrics-oriented approach, precondition-oriented approach, and clustering-oriented approach are most cited approaches ▪ Some refactoring, when applied, negatively affect the quality
  • 12.
    RQ2 What smells-related topicshave been investigated in secondary studies?
  • 13.
    RQ2 Summary ▪ Challenges ▪Smells naming standardization is necessary ▪ Co-occurence of smells ▪ Explore and improve methods of defining, specify, and capture the smell context ▪ Observations ▪ Blob and Duplicated code/clones are most mentioned design and code smell, respectively ▪ God Class/Large Class has been the most investigated smell (Technical Debt) ▪ metrics-oriented approach and strategies/rules are most cited approaches to detection ▪ Topics ▪ Smells detection, code smell description, support tools for smell detection, and others
  • 14.
    RQ3 Which tools havebeen mentioned for code smell detection and refactoring support?
  • 15.
    RQ3 Summary ▪ Challenges ▪To develop tools that support more than one programming languages ▪ To expand the studies and experiments, improving the accuracy of the smell detection tools and refactoring support ▪ Limitations and lack of maturity of tools ▪ Observations ▪ Several aspects characterize tools (license, supported languages, degree of automation, and others) ▪ Java is the platform/programming language most used ▪ Large number of smell detection tools, detecting only a tiny amount of smells ▪ Number of refactoring tools is small ▪ CCFinder and Jdeodorant are the most cited tools
  • 16.
    RQ4 Which RQs havebeen studied on code smells and refactoring? What are the highest cited secondary studies?
  • 17.
    Top 5 selectedstudies ▪ Sorted by the number of citations by year ▪ Sorted by the number of citations of Google Scholar
  • 18.
    RQ4 Summary ▪ Challenges ▪Need for studies that contain more sophisticated RQs ▪ Studies covering RQs about Casuality and Design, describing situations of efficacy and efficiency about methods, practices, and tools ▪ Observations ▪ 181 RQs in the 40 selected secondary studies ▪ One study is the most comprehensive work, with 13 RQs ▪ Some studies did not follow a defined protocol ▪ Scope of the study is related to the scope of the RQ
  • 19.
    RQ5 What are theannual trends of types, quality, and the number of primary studies reviewed by the secondary studies?
  • 20.
    Summary Distribution of studiestypes cited Type of referenced projects Number of primary studies referenced per year
  • 21.
    RQ5 Summary ▪ Challenges ▪Lack of validation by experts on tool analysis ▪ Lack of benchmarks to support improvements of techniques and tools for both smells and refactorings ▪ Observations ▪ Growth of secondary studies in recent years ▪ Vast majority of studies are SLR (65%), and 75% of studies are published in journals
  • 22.
  • 23.
    Smells and Refactoringconnected by Quality Primitive Refactorings (renames, extracts, etc) Composite Refactorings (Replace conditional with, etc) Approaches to Opportunities (metrics, strategies/rules, search, etc ) Support Tools Refactorings Simple Smells (magic numbers, long parameter list, etc) Composite Smells (God Class/Large Class, Blobs, etc) Approaches to Detect (metrics, strategies/rules, etc ) Support Tools Code Smells Internal Quality Attributes Cohesion, Coupling, Size... External Quality Attributes Maintainability, Testability, Functionality... Quality Technical Debt Management, Prioritizing, Mitigate...
  • 24.
  • 25.
  • 26.
    Implications ▪ Practitioners ▪ Refactoringpractice should be a daily habit ▪ Developers know the values of refactoring but are often prevented from applying them ▪ Code smells priorization, impact of quality attributes ▪ Instructors ▪ Include these topics in various courses ▪ Practices: Coding dojos, code review sessions, testing, and pair programming ▪ Researchers ▪ Impact of code smells and refactoring ▪ Industry-academic collaboration
  • 27.
  • 28.
  • 29.
    Contributions and FutureWork ▪ Contributions ▪ We cross-reference the most frequent code smells with their detection approaches, detection tools, suggested refactoring, and refactoring tools ▪ We report the relationships of the top 10 code smells with their refactoring and their impact on quality ▪ We present the implications of this study from the perspective of practitioners, researchers, and instructors ▪ We report on 13 open issues about code smells and refactoring ▪ Future works ▪ Practices and tools to mitigate the code smell and evaluate the impact on quality ▪ Goal of refactoring used by practitioners and their effect on quality ▪ Development/improvement of refactoring tools to monitor refactoring and its gains
  • 30.
    36th IEEE InternationalConference on Software Maintenance and Evolution September 27-October 3, Journal First Track Code smells and refactoring: A tertiary review of challenges and observations Guilherme Lacerda, Fábio Petrillo, Marcelo Pimenta, and Yann Gaël Guéhéneuc Thank You! Brazil Brazil Canada Canada