SlideShare a Scribd company logo
1 of 16
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

What's hot

Software design principles
Software design principlesSoftware design principles
Software design principles
Ritesh Singh
 
Refactoring for design smells
Refactoring for design smellsRefactoring for design smells
Refactoring for design smells
Ganesh Samarthyam
 
Software Quality Attributes
Software Quality AttributesSoftware Quality Attributes
Software Quality Attributes
Hayim Makabee
 

What's hot (20)

software quality
software qualitysoftware quality
software quality
 
Coding standards and guidelines
Coding standards and guidelinesCoding standards and guidelines
Coding standards and guidelines
 
Clean code
Clean codeClean code
Clean code
 
Refactoring
RefactoringRefactoring
Refactoring
 
Code review
Code reviewCode review
Code review
 
Code refactoring
Code refactoringCode refactoring
Code refactoring
 
Dot net assembly
Dot net assemblyDot net assembly
Dot net assembly
 
Software design principles
Software design principlesSoftware design principles
Software design principles
 
Refactoring for design smells
Refactoring for design smellsRefactoring for design smells
Refactoring for design smells
 
Software quality assurance
Software quality assuranceSoftware quality assurance
Software quality assurance
 
Refactoring Techniques
Refactoring TechniquesRefactoring Techniques
Refactoring Techniques
 
Software Quality Attributes
Software Quality AttributesSoftware Quality Attributes
Software Quality Attributes
 
Software architectural patterns - A Quick Understanding Guide
Software architectural patterns - A Quick Understanding GuideSoftware architectural patterns - A Quick Understanding Guide
Software architectural patterns - A Quick Understanding Guide
 
Java - Generic programming
Java - Generic programmingJava - Generic programming
Java - Generic programming
 
McCall Software Quality Model in Software Quality Assurance
McCall Software Quality Model in Software Quality Assurance McCall Software Quality Model in Software Quality Assurance
McCall Software Quality Model in Software Quality Assurance
 
SOLID Principles and Design Patterns
SOLID Principles and Design PatternsSOLID Principles and Design Patterns
SOLID Principles and Design Patterns
 
Architecture design in software engineering
Architecture design in software engineeringArchitecture design in software engineering
Architecture design in software engineering
 
Unified process Model
Unified process ModelUnified process Model
Unified process Model
 
Debugging
DebuggingDebugging
Debugging
 
Clean Code Principles
Clean Code PrinciplesClean Code Principles
Clean Code Principles
 

Viewers also liked

Do Code Smell Hamper Novice Programmers?
Do Code Smell Hamper Novice Programmers?Do Code Smell Hamper Novice Programmers?
Do Code Smell Hamper Novice Programmers?
Felienne Hermans
 
Code Smell Research: History and Future Directions
Code Smell Research: History and Future DirectionsCode Smell Research: History and Future Directions
Code Smell Research: History and Future Directions
Nikolaos Tsantalis
 

Viewers also liked (14)

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

Similar to Code Smell, Software Engineering

Gene Based Software Refactoring Location Identification and Rectification For...
Gene Based Software Refactoring Location Identification and Rectification For...Gene Based Software Refactoring Location Identification and Rectification For...
Gene Based Software Refactoring Location Identification and Rectification For...
IJCSIS Research Publications
 
Lopez
LopezLopez
Lopez
anesah
 
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...
GENERATING SOFTWARE PRODUCT LINE MODEL BY RESOLVING CODE SMELLS IN THE PRODUC...
ijseajournal
 
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...
GENERATING SOFTWARE PRODUCT LINE MODEL BY RESOLVING CODE SMELLS IN THE PRODUC...
ijseajournal
 
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...
Generating Software Product Line Model by Resolving Code Smells in the Produc...
ijseajournal
 

Similar to Code Smell, Software Engineering (20)

An empirical evaluation of impact of refactoring on internal and external mea...
An empirical evaluation of impact of refactoring on internal and external mea...An empirical evaluation of impact of refactoring on internal and external mea...
An empirical evaluation of impact of refactoring on internal and external mea...
 
Software Refactoring Under Uncertainty: A Robust Multi-Objective Approach
Software Refactoring Under Uncertainty:  A Robust Multi-Objective ApproachSoftware Refactoring Under Uncertainty:  A Robust Multi-Objective Approach
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 ...A Model To Compare The Degree Of Refactoring Opportunities Of Three Projects ...
A Model To Compare The Degree Of Refactoring Opportunities Of Three Projects ...
 
A MODEL TO COMPARE THE DEGREE OF REFACTORING OPPORTUNITIES OF THREE PROJECTS ...
A MODEL TO COMPARE THE DEGREE OF REFACTORING OPPORTUNITIES OF THREE PROJECTS ...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...
Gene Based Software Refactoring Location Identification and Rectification For...Gene Based Software Refactoring Location Identification and Rectification For...
Gene Based Software Refactoring Location Identification and Rectification For...
 
Effect of refactoring on software quality
Effect of refactoring on software qualityEffect of refactoring on software quality
Effect of refactoring on software quality
 
Multi step automated refactoring for code smell
Multi step automated refactoring for code smellMulti step automated refactoring for code smell
Multi step automated refactoring for code smell
 
Multi step automated refactoring for code smell
Multi step automated refactoring for code smellMulti step automated refactoring for code smell
Multi step automated refactoring for code smell
 
Software bug prediction
Software bug prediction Software bug prediction
Software bug prediction
 
Lopez
LopezLopez
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...
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...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...
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...
A Study on Code Smell Detection with Refactoring Tools in Object Oriented Lan...A Study on Code Smell Detection with Refactoring Tools in Object Oriented Lan...
A Study on Code Smell Detection with Refactoring Tools in Object Oriented Lan...
 
Synopsis minor project
Synopsis minor projectSynopsis minor project
Synopsis minor project
 
Synopsis ( Code Smells)
Synopsis ( Code Smells)Synopsis ( Code Smells)
Synopsis ( Code Smells)
 
Agile Methods And Quality A Survey
Agile Methods And Quality  A SurveyAgile Methods And Quality  A Survey
Agile Methods And Quality A Survey
 
AGILE METHODS AND QUALITY _ A SURVEY
AGILE METHODS AND QUALITY _ A SURVEYAGILE METHODS AND QUALITY _ A SURVEY
AGILE METHODS AND QUALITY _ A SURVEY
 
STRATEGIES TO REDUCE REWORK IN SOFTWARE DEVELOPMENT ON AN ORGANISATION IN MAU...
STRATEGIES TO REDUCE REWORK IN SOFTWARE DEVELOPMENT ON AN ORGANISATION IN MAU...STRATEGIES TO REDUCE REWORK IN SOFTWARE DEVELOPMENT ON AN ORGANISATION IN MAU...
STRATEGIES TO REDUCE REWORK IN SOFTWARE DEVELOPMENT ON AN ORGANISATION IN MAU...
 
Rankingtherefactoring techniques
Rankingtherefactoring techniquesRankingtherefactoring techniques
Rankingtherefactoring techniques
 

Recently uploaded

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Recently uploaded (20)

ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 

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