SlideShare a Scribd company logo
Prioritization of Smelly Classes
Based on Bad Smells
Supervised By
Dr. Jitender Kumar Chhabra
Presented By
Anshul Rani
(31503121)
INTRODUCTION
CODE REFACTORING
Refactoring is the process of changing a software system in such a way that it does not alter
the external behaviour of the code yet improves its internal structure.
Advantages
a) Code readability improvement
b) Complexity Reduction
c) Creates a more expressive internal structure to improve maintainability
Motivation
a) Though Re-factoring is a old concept, developers are not utilizing it.
b) To capture and write down the symptoms which make sense to re-factoring.
“If it stinks change it” [1]
CODE SMELL
Code smells are indications of poor coding and design choices that can cause problems during
the later phase of software development. Code smells are considered as flags to the developer
that some parts of the design may be inappropriate. [1]
There are 22 types of smells identified in [1]. For example Duplicate Code, Feature envy,
Divergent Change, Shotgun Surgery etc.
[1] M. Fowler, K. Beck, J. Brant, W. Opdyke, and D. Roberts, “Refactoring Improving the Design of Existing Code”,
Addison-Wesley, 1999.
INTRODUCTION: CODE SMELL
PROBLEM DESCRIPTION
CODE SMELL
DETECTION [4,5,11] PRIORITIZATION
STATIC [6,12] DYNAMIC [3] INTER SMELL
RELATION
STATIC [2] DYNAMIC [7,8]
[3] Fabio Palomba, Gabriele Bavota and Rocco Oliveto “Mining Version Histories for Detecting Code Smells”,
Software Engineering, IEEE transactions on , vol 41, no 5, pp 462-489, 2015, IEEE.
[5] Min Zhang,Tracy Hall and Nathan Baddoo , ”Code Bad Smells: a review of current knowledge” Journal of
Software Maintenance and evolution, research and practice, Vol 23,pp-179–202 , 2011,Wiley Online Library.
[7] Pietrzak B and Walter B. “Exploring Bad Smells Dependencies”, In Zielinski K., Conference on Extreme Programming
and Agile, Vol. 130, pp. 353-364, 2006,Springer.
[12] Naoul Moha ,Yann-Gael Gueheneue and Anne-F. Lee, “ DÉCOR: A Method for the Specification and Detection of
Code and Design Smells ” IEEE Transactions on Software Engg. , Vol 36 ,pp-20-35,2010,IEEE
PROBLEM DESCRIPTION
[14] M. Abbes, F. Khomh, Y-G. Gueheneuc, and G. Antoniol, “An empirical study of impact of two antipatterns, blob and
spaghetti code, on program comprehension”, in 15th European Conference on Software Maintenance and Reengineering,
pp.181-190, 2011.
 Code Smells results into a poor system design, thus need to be corrected for which
refactoring is one of the possible solutions.[14]
 It is desirable to make an efficient approach of refactoring.
 Such approach that can smartly select that which classes actually need refactoring; and
can tell a sequence in which smelly classes should be refactored.
 It includes extra time, efforts and even sometimes implementation of one refactoring
mechanism may include several other refactorings to be implemented, therefore forming
refactoring chains [10].
[10] H. Hamza, S. Counsell, G. Loizou and T. Hall, “Code Smell Eradication and Associated Refactoring”, in proceedings
of the European Computing Conference (ECC), Malta, pp.102-107, September, 2008..
RELATED WORK
[9] R. Wongpiang and P. Muenchaisri, "Selecting Sequence of Refactoring Techniques Usage for Code Changing Using
Greed Algorithm", Electronics Information and Emergency Communication (ICEIEC) 4th International Conference, pp.
160-164, 2013, IEEE.
 To get Optimal maintainability, authors find out possible sequences of
refactoring maintainability. [9]
 In their study they suggested a Greedy algorithm to find out the optimal
refactoring sequence among all the possible sequences of the refactoring.
 Study primarily focuses on the possible refactorings of Long Method, Long Class
and Feature Envy
RELATED WORK
[13] Aiko Yamashita , Leon Moonen,”Exploring the impact of inter smell relations on software Maintainability: An
Empirical Study”,Proc of the international Conf on Software engg , pp-682-691,2013, ACM.
[15] Steffen M. Olbrich, Daniela S.Cruzes, Dag I.K. Sjoberg, “Are all Code Smells Harmful ? A study of God Classes and
Brain Classes in the Evolution of three Open Source Systems”, 26th IEEE International Conference on Software
Maintenance,pp. 1-10, 2010.
 Yamashita et al. [13] suggested that not only code smells, but interaction between
code smells also affect maintenance.
 As all the code smells are not equally harmful, some of them are not at all effective
[15].
 Though refactoring indulges extra efforts and time, thus it is necessary to understand
the relationship between code smells, so that proper attention and time can be given to
appropriate smells.
 As of study results they found some inter dependencies between different code smells.
 They also concluded that these dependencies may vary in different scenarios.
RELATED WORK
[8] Angela Lonzano, Kim Mens and Jawia Portugal “Analyzing Code Evolution to Uncover Relation between Bad Smells”
International Confrence on Analysis, Evolution and Reengineering, pp.1-4, 2015.
[7] Pietrzak B and Walter B. “Exploring Bad Smells Dependencies”, In Zielinski K., Conference on Extreme
Programming and Agile, Vol. 130, pp. 353-364, 2006,Springer.
 Angela et al. discovered the co-relation among four different smells named God Class,
Long Method and Feature Envy [8].
 For this purpose they mined Change History of the software.
 Piterzak et al. Also found inter smell relations but using multiple aspects [7].
 Multiple aspects includes programmer intuition and experience, Metrics value, Dynamic
behavior of code and Change History mining too.
COUPLING/
COHESION
CODE SMELL
DETECTION PRIORITIZATION
STATIC DYNAMIC INTER RELATION
B/W CODE SMELL
STATIC DYNAMIC
CURRENT STATUS OF WORK
CHANGE
HISTORY
(MINE ONLY
SMELLY
CLASSES)
SOURCE CODE
SMELLY INSTANCES/CLASSES
DETECTION OF BAD SMELLS
DETECTIONPHASE
PRIORITIZE SMELLY CLASSES
IMPACT INDEX MEASUREMENT
PRIORITIZATIONPHASE
CURRENT STATUS OF WORK
APPLY REFRACTORING
REFACTORED CODE
CURRENT STATUS OF WORK
Detection Phase-
 We have used JDeodorant [18](Eclipse plug-in) for detection of smelly classes which mainly
detects five sorts of smells specifically feature envy, Duplicate code, Long Method, God
Class.
Prioritization Phase-
 Change history of smelly classes (found in first phase) is mined.
 Change reports are mined for identifying the interactions of smelly class with other classes
of system. Interaction of a class with other classes indicates coupling of the class with rest of
the system.
 Based on the impact, a prioritization list of classes is being constructed, smelly instance,
having more impact is considered more severe, so it is put first in prioritization list.
 Prioritization list tells the order in which refactoring should be performed.
 Thus by using prioritization list, we firstly refactor more severe smelly classes.
couplingspossible
withcoupledisitclassesofnumber
classaofindeximpact 
CURRENT STATUS OF WORK
0
10
20
30
40
50
60
70
80
90
100
1 2 3 4 5 6 7 8 9 10
CodeSmellsLeft(%)
No_of_Refactoring_Performed
Refactoring using Prioritization Random Refactoring
 We have evaluated our proposed approach
over a project named
HospitalAutomationWithJavaEE [19]
 Project has 49 classes and 58 commits
recorded for it
 Refactoring using prioritization left
only 21% code smells in the system
whereas random refactoring left 50%
code smells in the system (after 10 time
refactoring)
CONCLUSION
 Frequent changes in an object-oriented software system often result into a poor-quality and
less maintainable design
 The symptoms (known as Code Smells) causing that degradation, need to be corrected for
which refactoring is one of the possible solutions.
 It is not feasible to refactor/ restructure each and every smelly class due to various
constraints such as time and cost.
 It is desirable to make an efficient approach of refactoring.
 Proposed scheme aims to save time (and cost) of refactoring by carrying out selective
refactoring for high priority smelly classes.
 Prioritization is proposed to be done according to interaction level of each class with other
classes.
FUTURE WORK
 We are analyzing different code smells over various parameters like complexity,
refactoring time, measurement factor etc.
 Along with that we are exploring inter-dependencies between different smells,
 Using these two aspects we will prioritize the code smells, and will provide an
ordering in which code smells should be removed.
[1] M. Fowler, K. Beck, J. Brant, W. Opdyke, and D. Roberts, “Refactoring Improving the Design of Existing Code”
Addison-Wesley, 1999
[2] F. A. Fontana, V. Feme, and M. Zanoni, “Towards a Prioritization of Code Debt : A Code Smell Intensity Index ”, In
Proc. Of IEEE 7th International workshop on Managing Technical Debt, 2015. pp 16-24, 2015, IEEE.
[3] Fabio Palomba, Gabriele Bavota and Rocco Oliveto “Mining Version Histories for Detecting Code Smells”,
Software Engineering, IEEE transactions on , vol 41, no 5, pp 462-489, 2015, IEEE.
[4] T. Mens and T. Tourwe, A Survey of Software Refactoring, IEEE Transactions on Software Engineering 30(2):
pp-126--139 ,2004, IEEE.
[5] Min Zhang,Tracy Hall and Nathan Baddoo , ”Code Bad Smells: a review of current knowledge” Journal of
Software Maintenance and evolution, research and practice, Vol 23,pp-179–202 , 2011,Wiley Online Library.
[6] A. Rao, K.Reddy, “Detecting Bad Smells in Object Oriented Design using Design Change Propagation Probability
matrix” In proc. of IMECS(International Multiconference of engineers and Computer Scientist),Vol 1, pp.19-21,
2008,IEEE.
[7] Pietrzak B and Walter B. “Exploring Bad Smells Dependencies”, In Zielinski K., Conference on Extreme
Programming and Agile, Vol. 130, pp. 353-364, 2006,Springer.
[8] Angela Lonzano, Kim Mens and Jawia Portugal “Analyzing Code Evolution to Uncover Relation between Bad
Smells” International Conference on Analysis, Evolution and Reengineering, pp.1-4, 2015.
[9] R. Wongpiang and P. Muenchaisri, "Selecting Sequence of Refactoring Techniques Usage for Code Changing
Using Greed Algorithm", Electronics Information and Emergency Communication (ICEIEC) 4th International
Conference pp. 160-164, 2013, IEEE.
[10] H. Hamza, S. Counsell, G. Loizou and T. Hall, “Code Smell Eradication and Associated Refactoring”, in
proceedings of the European Computing Conference (ECC), Malta, pp.102-107, September, 2008.
REFERENCES
[11] Raed Shatnawi, Wei Li, “The effectiveness of Software Metrics in Identifying Error Prone Classes in Post Release
Software Evolution Process”, in the Journal of System and Software , Vol 81 , pp (1868-1882),2008, Science Direct.
[12] Naoul Moha ,Yann-Gael Gueheneue and Anne-F. Lee, “ DÉCOR: A Method for the Specification and Detection of
Code and Design Smells ” IEEE Transactions on Software Engineering, Vol 36, pp-20-35, 2010, IEEE .
[13] Aiko Yamashita , Leon Moonen,”Exploring the Impact of Inter Smell Relations on Software Maintainability: An
Empirical Study”, In Proceedings of the International Conference on Software Engineering , pp-682-691,2013, ACM.
[14] M. Abbes, F. Khomh, Y-G. Gueheneuc, and G. Antoniol, “An Empirical Study of Impact of Two Antipatterns, Blob and
Spaghetti Code, on Program Comprehension”, in 15th European Conference on Software Maintenance and
Reengineering, pp.181-190, 2011.
[15] Steffen M. Olbrich, Daniela S.Cruzes, Dag I.K. Sjoberg, “Are all Code Smells Harmful ? A study of God Classes and
Brain Classes in the Evolution of three Open Source Systems”, 26th International Conference on Software
Maintenance, pp. 1-10, 2010, IEEE.
[16] A.Yamashita, “Assessing the Capability of Code Smells to Support Software Maintainability Assessment:
Empirical Inquiry and Methodological Approach”, Doctoral Thesis, University of Oslo, 2012.
[17] Aiko Yamashita, Marco Zanoni, Francesca Arcelli Fontana and Bartosz Walter, “Inter-Smell Relations in Industrial
and Open Source Systems: A Replication and Comparative Analysis”, International Conference on Software
Maintenance and Evolution, Bremen Germany, pp- 121-130, 2015.
[18] Marios Fakaefs, Nikolaos Tsantalis and Alexander Chatzigeorgiou, “JDeodorant: Identification and removal of
Feature Envy Bad Smells”, IEEE International Conference on Soft Materials, pp.519-520, 2007.
[19] https://github.com/ilkgunel/HospitalAutomationWithJavaEE.
[20] Anshu Parashar, Jitender kumar Chhabra, “Measuring Change- Readiness of Classes by Mining Change-History
”, ACM SIGSOFT Software Engineering Notes, Vol 39, Issue 6, pp.1-60, 2014.
REFERENCES

More Related Content

PPTX
Iterative model
PPTX
Code smell overview
PDF
3. ch 2-process model
PDF
Code Smells and Its type (With Example)
DOCX
Software engineering Questions and Answers
PPTX
PROTOTYPE MODEL
PPTX
Models of SDLC (Software Development Life Cycle / Program Development Life Cy...
PPT
Spiral model presentation
Iterative model
Code smell overview
3. ch 2-process model
Code Smells and Its type (With Example)
Software engineering Questions and Answers
PROTOTYPE MODEL
Models of SDLC (Software Development Life Cycle / Program Development Life Cy...
Spiral model presentation

What's hot (20)

PPT
Refactoring Tips by Martin Fowler
PPT
Rad model
PPTX
Software Engineering
PPTX
Spiral model
PPT
Analysis concepts and principles
PPT
Test Levels & Techniques
PPTX
Refactoring and code smells
PPT
Lecture 12 requirements modeling - (system analysis)
PDF
System Modelling
PPTX
Software development process models
PPTX
PPT
Software design
PPTX
Software Evolution
PPTX
System modeling
PPTX
Requirements modeling
PPT
extreme Programming
PPT
Software estimation
PPTX
System testing
Refactoring Tips by Martin Fowler
Rad model
Software Engineering
Spiral model
Analysis concepts and principles
Test Levels & Techniques
Refactoring and code smells
Lecture 12 requirements modeling - (system analysis)
System Modelling
Software development process models
Software design
Software Evolution
System modeling
Requirements modeling
extreme Programming
Software estimation
System testing
Ad

Viewers also liked (14)

PDF
A Textual-based Technique for Smell Detection
PDF
PhD Symposium 2014
PDF
Smells Like Teen Spirit: Improving Bug Prediction Performance using the Inten...
PDF
Linux day 2016 Partanna: qualità del software - vincenzo buglino
PPT
A Catalogue of Code Smell Visualizations
PDF
When and Why Your Code Starts to Smell Bad
PPTX
Do Code Smell Hamper Novice Programmers?
PDF
Bad Code Smells
PPTX
Code Smell Research: History and Future Directions
PDF
When and Why Your Code Starts to Smell Bad
PDF
Detecting Bad Smells in Source Code using Change History Information
PDF
Does your configuration code smell?
PDF
PDF
Ruby用の静的コード解析ツールざくっと紹介 by SideCI #omotesandorb
A Textual-based Technique for Smell Detection
PhD Symposium 2014
Smells Like Teen Spirit: Improving Bug Prediction Performance using the Inten...
Linux day 2016 Partanna: qualità del software - vincenzo buglino
A Catalogue of Code Smell Visualizations
When and Why Your Code Starts to Smell Bad
Do Code Smell Hamper Novice Programmers?
Bad Code Smells
Code Smell Research: History and Future Directions
When and Why Your Code Starts to Smell Bad
Detecting Bad Smells in Source Code using Change History Information
Does your configuration code smell?
Ruby用の静的コード解析ツールざくっと紹介 by SideCI #omotesandorb
Ad

Similar to Code Smell, Software Engineering (20)

PDF
An empirical evaluation of impact of refactoring on internal and external mea...
PDF
Software Refactoring Under Uncertainty: A Robust Multi-Objective Approach
PDF
A Model To Compare The Degree Of Refactoring Opportunities Of Three Projects ...
PDF
A MODEL TO COMPARE THE DEGREE OF REFACTORING OPPORTUNITIES OF THREE PROJECTS ...
PDF
Gene Based Software Refactoring Location Identification and Rectification For...
PDF
Effect of refactoring on software quality
PDF
Multi step automated refactoring for code smell
PDF
Multi step automated refactoring for code smell
PDF
Software bug prediction
PDF
Lopez
PDF
GENERATING SOFTWARE PRODUCT LINE MODEL BY RESOLVING CODE SMELLS IN THE PRODUC...
PDF
Generating Software Product Line Model by Resolving Code Smells in the Produc...
PDF
GENERATING SOFTWARE PRODUCT LINE MODEL BY RESOLVING CODE SMELLS IN THE PRODUC...
DOCX
A Study on Code Smell Detection with Refactoring Tools in Object Oriented Lan...
DOCX
Synopsis minor project
PDF
Synopsis ( Code Smells)
PDF
Agile Methods And Quality A Survey
PDF
AGILE METHODS AND QUALITY _ A SURVEY
PDF
STRATEGIES TO REDUCE REWORK IN SOFTWARE DEVELOPMENT ON AN ORGANISATION IN MAU...
PDF
Rankingtherefactoring techniques
An empirical evaluation of impact of refactoring on internal and external mea...
Software Refactoring Under Uncertainty: A Robust Multi-Objective Approach
A Model To Compare The Degree Of Refactoring Opportunities Of Three Projects ...
A MODEL TO COMPARE THE DEGREE OF REFACTORING OPPORTUNITIES OF THREE PROJECTS ...
Gene Based Software Refactoring Location Identification and Rectification For...
Effect of refactoring on software quality
Multi step automated refactoring for code smell
Multi step automated refactoring for code smell
Software bug prediction
Lopez
GENERATING SOFTWARE PRODUCT LINE MODEL BY RESOLVING CODE SMELLS IN THE PRODUC...
Generating Software Product Line Model by Resolving Code Smells in the Produc...
GENERATING SOFTWARE PRODUCT LINE MODEL BY RESOLVING CODE SMELLS IN THE PRODUC...
A Study on Code Smell Detection with Refactoring Tools in Object Oriented Lan...
Synopsis minor project
Synopsis ( Code Smells)
Agile Methods And Quality A Survey
AGILE METHODS AND QUALITY _ A SURVEY
STRATEGIES TO REDUCE REWORK IN SOFTWARE DEVELOPMENT ON AN ORGANISATION IN MAU...
Rankingtherefactoring techniques

Recently uploaded (20)

PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
Big Data Technologies - Introduction.pptx
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Machine learning based COVID-19 study performance prediction
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Modernizing your data center with Dell and AMD
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Electronic commerce courselecture one. Pdf
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
A Presentation on Artificial Intelligence
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
KodekX | Application Modernization Development
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Digital-Transformation-Roadmap-for-Companies.pptx
Big Data Technologies - Introduction.pptx
Review of recent advances in non-invasive hemoglobin estimation
Machine learning based COVID-19 study performance prediction
Spectral efficient network and resource selection model in 5G networks
Modernizing your data center with Dell and AMD
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Electronic commerce courselecture one. Pdf
Chapter 3 Spatial Domain Image Processing.pdf
20250228 LYD VKU AI Blended-Learning.pptx
NewMind AI Monthly Chronicles - July 2025
Reach Out and Touch Someone: Haptics and Empathic Computing
A Presentation on Artificial Intelligence
Understanding_Digital_Forensics_Presentation.pptx
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
KodekX | Application Modernization Development
The Rise and Fall of 3GPP – Time for a Sabbatical?

Code Smell, Software Engineering

  • 1. Prioritization of Smelly Classes Based on Bad Smells Supervised By Dr. Jitender Kumar Chhabra Presented By Anshul Rani (31503121)
  • 2. INTRODUCTION CODE REFACTORING Refactoring is the process of changing a software system in such a way that it does not alter the external behaviour of the code yet improves its internal structure. Advantages a) Code readability improvement b) Complexity Reduction c) Creates a more expressive internal structure to improve maintainability
  • 3. Motivation a) Though Re-factoring is a old concept, developers are not utilizing it. b) To capture and write down the symptoms which make sense to re-factoring. “If it stinks change it” [1] CODE SMELL Code smells are indications of poor coding and design choices that can cause problems during the later phase of software development. Code smells are considered as flags to the developer that some parts of the design may be inappropriate. [1] There are 22 types of smells identified in [1]. For example Duplicate Code, Feature envy, Divergent Change, Shotgun Surgery etc. [1] M. Fowler, K. Beck, J. Brant, W. Opdyke, and D. Roberts, “Refactoring Improving the Design of Existing Code”, Addison-Wesley, 1999. INTRODUCTION: CODE SMELL
  • 4. PROBLEM DESCRIPTION CODE SMELL DETECTION [4,5,11] PRIORITIZATION STATIC [6,12] DYNAMIC [3] INTER SMELL RELATION STATIC [2] DYNAMIC [7,8] [3] Fabio Palomba, Gabriele Bavota and Rocco Oliveto “Mining Version Histories for Detecting Code Smells”, Software Engineering, IEEE transactions on , vol 41, no 5, pp 462-489, 2015, IEEE. [5] Min Zhang,Tracy Hall and Nathan Baddoo , ”Code Bad Smells: a review of current knowledge” Journal of Software Maintenance and evolution, research and practice, Vol 23,pp-179–202 , 2011,Wiley Online Library. [7] Pietrzak B and Walter B. “Exploring Bad Smells Dependencies”, In Zielinski K., Conference on Extreme Programming and Agile, Vol. 130, pp. 353-364, 2006,Springer. [12] Naoul Moha ,Yann-Gael Gueheneue and Anne-F. Lee, “ DÉCOR: A Method for the Specification and Detection of Code and Design Smells ” IEEE Transactions on Software Engg. , Vol 36 ,pp-20-35,2010,IEEE
  • 5. PROBLEM DESCRIPTION [14] M. Abbes, F. Khomh, Y-G. Gueheneuc, and G. Antoniol, “An empirical study of impact of two antipatterns, blob and spaghetti code, on program comprehension”, in 15th European Conference on Software Maintenance and Reengineering, pp.181-190, 2011.  Code Smells results into a poor system design, thus need to be corrected for which refactoring is one of the possible solutions.[14]  It is desirable to make an efficient approach of refactoring.  Such approach that can smartly select that which classes actually need refactoring; and can tell a sequence in which smelly classes should be refactored.  It includes extra time, efforts and even sometimes implementation of one refactoring mechanism may include several other refactorings to be implemented, therefore forming refactoring chains [10]. [10] H. Hamza, S. Counsell, G. Loizou and T. Hall, “Code Smell Eradication and Associated Refactoring”, in proceedings of the European Computing Conference (ECC), Malta, pp.102-107, September, 2008..
  • 6. RELATED WORK [9] R. Wongpiang and P. Muenchaisri, "Selecting Sequence of Refactoring Techniques Usage for Code Changing Using Greed Algorithm", Electronics Information and Emergency Communication (ICEIEC) 4th International Conference, pp. 160-164, 2013, IEEE.  To get Optimal maintainability, authors find out possible sequences of refactoring maintainability. [9]  In their study they suggested a Greedy algorithm to find out the optimal refactoring sequence among all the possible sequences of the refactoring.  Study primarily focuses on the possible refactorings of Long Method, Long Class and Feature Envy
  • 7. RELATED WORK [13] Aiko Yamashita , Leon Moonen,”Exploring the impact of inter smell relations on software Maintainability: An Empirical Study”,Proc of the international Conf on Software engg , pp-682-691,2013, ACM. [15] Steffen M. Olbrich, Daniela S.Cruzes, Dag I.K. Sjoberg, “Are all Code Smells Harmful ? A study of God Classes and Brain Classes in the Evolution of three Open Source Systems”, 26th IEEE International Conference on Software Maintenance,pp. 1-10, 2010.  Yamashita et al. [13] suggested that not only code smells, but interaction between code smells also affect maintenance.  As all the code smells are not equally harmful, some of them are not at all effective [15].  Though refactoring indulges extra efforts and time, thus it is necessary to understand the relationship between code smells, so that proper attention and time can be given to appropriate smells.  As of study results they found some inter dependencies between different code smells.  They also concluded that these dependencies may vary in different scenarios.
  • 8. RELATED WORK [8] Angela Lonzano, Kim Mens and Jawia Portugal “Analyzing Code Evolution to Uncover Relation between Bad Smells” International Confrence on Analysis, Evolution and Reengineering, pp.1-4, 2015. [7] Pietrzak B and Walter B. “Exploring Bad Smells Dependencies”, In Zielinski K., Conference on Extreme Programming and Agile, Vol. 130, pp. 353-364, 2006,Springer.  Angela et al. discovered the co-relation among four different smells named God Class, Long Method and Feature Envy [8].  For this purpose they mined Change History of the software.  Piterzak et al. Also found inter smell relations but using multiple aspects [7].  Multiple aspects includes programmer intuition and experience, Metrics value, Dynamic behavior of code and Change History mining too.
  • 9. COUPLING/ COHESION CODE SMELL DETECTION PRIORITIZATION STATIC DYNAMIC INTER RELATION B/W CODE SMELL STATIC DYNAMIC CURRENT STATUS OF WORK
  • 10. CHANGE HISTORY (MINE ONLY SMELLY CLASSES) SOURCE CODE SMELLY INSTANCES/CLASSES DETECTION OF BAD SMELLS DETECTIONPHASE PRIORITIZE SMELLY CLASSES IMPACT INDEX MEASUREMENT PRIORITIZATIONPHASE CURRENT STATUS OF WORK APPLY REFRACTORING REFACTORED CODE
  • 11. CURRENT STATUS OF WORK Detection Phase-  We have used JDeodorant [18](Eclipse plug-in) for detection of smelly classes which mainly detects five sorts of smells specifically feature envy, Duplicate code, Long Method, God Class. Prioritization Phase-  Change history of smelly classes (found in first phase) is mined.  Change reports are mined for identifying the interactions of smelly class with other classes of system. Interaction of a class with other classes indicates coupling of the class with rest of the system.  Based on the impact, a prioritization list of classes is being constructed, smelly instance, having more impact is considered more severe, so it is put first in prioritization list.  Prioritization list tells the order in which refactoring should be performed.  Thus by using prioritization list, we firstly refactor more severe smelly classes. couplingspossible withcoupledisitclassesofnumber classaofindeximpact 
  • 12. CURRENT STATUS OF WORK 0 10 20 30 40 50 60 70 80 90 100 1 2 3 4 5 6 7 8 9 10 CodeSmellsLeft(%) No_of_Refactoring_Performed Refactoring using Prioritization Random Refactoring  We have evaluated our proposed approach over a project named HospitalAutomationWithJavaEE [19]  Project has 49 classes and 58 commits recorded for it  Refactoring using prioritization left only 21% code smells in the system whereas random refactoring left 50% code smells in the system (after 10 time refactoring)
  • 13. CONCLUSION  Frequent changes in an object-oriented software system often result into a poor-quality and less maintainable design  The symptoms (known as Code Smells) causing that degradation, need to be corrected for which refactoring is one of the possible solutions.  It is not feasible to refactor/ restructure each and every smelly class due to various constraints such as time and cost.  It is desirable to make an efficient approach of refactoring.  Proposed scheme aims to save time (and cost) of refactoring by carrying out selective refactoring for high priority smelly classes.  Prioritization is proposed to be done according to interaction level of each class with other classes.
  • 14. FUTURE WORK  We are analyzing different code smells over various parameters like complexity, refactoring time, measurement factor etc.  Along with that we are exploring inter-dependencies between different smells,  Using these two aspects we will prioritize the code smells, and will provide an ordering in which code smells should be removed.
  • 15. [1] M. Fowler, K. Beck, J. Brant, W. Opdyke, and D. Roberts, “Refactoring Improving the Design of Existing Code” Addison-Wesley, 1999 [2] F. A. Fontana, V. Feme, and M. Zanoni, “Towards a Prioritization of Code Debt : A Code Smell Intensity Index ”, In Proc. Of IEEE 7th International workshop on Managing Technical Debt, 2015. pp 16-24, 2015, IEEE. [3] Fabio Palomba, Gabriele Bavota and Rocco Oliveto “Mining Version Histories for Detecting Code Smells”, Software Engineering, IEEE transactions on , vol 41, no 5, pp 462-489, 2015, IEEE. [4] T. Mens and T. Tourwe, A Survey of Software Refactoring, IEEE Transactions on Software Engineering 30(2): pp-126--139 ,2004, IEEE. [5] Min Zhang,Tracy Hall and Nathan Baddoo , ”Code Bad Smells: a review of current knowledge” Journal of Software Maintenance and evolution, research and practice, Vol 23,pp-179–202 , 2011,Wiley Online Library. [6] A. Rao, K.Reddy, “Detecting Bad Smells in Object Oriented Design using Design Change Propagation Probability matrix” In proc. of IMECS(International Multiconference of engineers and Computer Scientist),Vol 1, pp.19-21, 2008,IEEE. [7] Pietrzak B and Walter B. “Exploring Bad Smells Dependencies”, In Zielinski K., Conference on Extreme Programming and Agile, Vol. 130, pp. 353-364, 2006,Springer. [8] Angela Lonzano, Kim Mens and Jawia Portugal “Analyzing Code Evolution to Uncover Relation between Bad Smells” International Conference on Analysis, Evolution and Reengineering, pp.1-4, 2015. [9] R. Wongpiang and P. Muenchaisri, "Selecting Sequence of Refactoring Techniques Usage for Code Changing Using Greed Algorithm", Electronics Information and Emergency Communication (ICEIEC) 4th International Conference pp. 160-164, 2013, IEEE. [10] H. Hamza, S. Counsell, G. Loizou and T. Hall, “Code Smell Eradication and Associated Refactoring”, in proceedings of the European Computing Conference (ECC), Malta, pp.102-107, September, 2008. REFERENCES
  • 16. [11] Raed Shatnawi, Wei Li, “The effectiveness of Software Metrics in Identifying Error Prone Classes in Post Release Software Evolution Process”, in the Journal of System and Software , Vol 81 , pp (1868-1882),2008, Science Direct. [12] Naoul Moha ,Yann-Gael Gueheneue and Anne-F. Lee, “ DÉCOR: A Method for the Specification and Detection of Code and Design Smells ” IEEE Transactions on Software Engineering, Vol 36, pp-20-35, 2010, IEEE . [13] Aiko Yamashita , Leon Moonen,”Exploring the Impact of Inter Smell Relations on Software Maintainability: An Empirical Study”, In Proceedings of the International Conference on Software Engineering , pp-682-691,2013, ACM. [14] M. Abbes, F. Khomh, Y-G. Gueheneuc, and G. Antoniol, “An Empirical Study of Impact of Two Antipatterns, Blob and Spaghetti Code, on Program Comprehension”, in 15th European Conference on Software Maintenance and Reengineering, pp.181-190, 2011. [15] Steffen M. Olbrich, Daniela S.Cruzes, Dag I.K. Sjoberg, “Are all Code Smells Harmful ? A study of God Classes and Brain Classes in the Evolution of three Open Source Systems”, 26th International Conference on Software Maintenance, pp. 1-10, 2010, IEEE. [16] A.Yamashita, “Assessing the Capability of Code Smells to Support Software Maintainability Assessment: Empirical Inquiry and Methodological Approach”, Doctoral Thesis, University of Oslo, 2012. [17] Aiko Yamashita, Marco Zanoni, Francesca Arcelli Fontana and Bartosz Walter, “Inter-Smell Relations in Industrial and Open Source Systems: A Replication and Comparative Analysis”, International Conference on Software Maintenance and Evolution, Bremen Germany, pp- 121-130, 2015. [18] Marios Fakaefs, Nikolaos Tsantalis and Alexander Chatzigeorgiou, “JDeodorant: Identification and removal of Feature Envy Bad Smells”, IEEE International Conference on Soft Materials, pp.519-520, 2007. [19] https://github.com/ilkgunel/HospitalAutomationWithJavaEE. [20] Anshu Parashar, Jitender kumar Chhabra, “Measuring Change- Readiness of Classes by Mining Change-History ”, ACM SIGSOFT Software Engineering Notes, Vol 39, Issue 6, pp.1-60, 2014. REFERENCES