Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
RADU VUNVULEA MCTS MCP BANK HOME AUTOMATION
MVP ENTERPRISE
AUTOMOTIVE PHARMA
LEAN AND AGILE E-COMMERCE
WEB iQuest
AZURE JA...
Add new functionality
Optimize performance
Simplify code
Improve code readibility
Reduce
duplication
Make code
clear
Improve
maintainability
Help to find
bugs
Help to
program faster
Fix design
Improve cod...
You do something
the first time
You do similar thing
again with regret
On the third time -
START refactoring
• Prepare code
• Understand the code
Adding new
functionality
• Error is a sign of refactoring
• Understand the code
Bug f...
“smells are certain
structures in the code that
suggest (scream for) the
possibility of refactoring”
Signs of a low quality code
Code is working, but something is fishy
Each time we need to make a change in 4 places
Nobody ...
• Fragile
• Rigid
• Complex
• Repetitive
Design Smell
• Reusability
• Changeability
• Extensibility
Design Quality
• Maint...
Rewrite Refactor
Edit and
Pray
Cover and
Modify
Composing Methods
Moving Features Between Objects
Organizing Data
Simplifying Conditional Expressions
Making Method Calls ...
Bloaters
Object-Orientation Abusers
Change Preventers
Dispensables
Couplers
Bloater
Obje
Cha
Disp
Couple
Large class
Primitive Obsession
Long Parameter List
Data Clumps
Bloater
Obje
Cha
Disp
Couple
Long method
Primitive Obsession
Long Parameter List
Data Clumps
Bloater
Obje
Cha
Disp
Couple
Long method
Large class
Long Parameter List
Data Clumps
Bloater
Obje
Cha
Disp
Couple
Long method
Large class
Primitive Obsession
Data Clumps
Bloater
Obje
Cha
Disp
Couple
Long method
Large class
Primitive Obsession
Long Parameter List
Bloater
Obje
Cha
Disp
Couple
Refused Bequest*
Bloater
Obje
Cha
Disp
Couple
Temporary Field
Refused Bequest*
Alternative Classes with Different
Interfaces
Bloater
Obje
Cha
Disp
Couple
Switch Statements
Refused Bequest*
Alternative Classes with Different
Interfaces
Bloater
Obje
Cha
Disp
Couple
Switch Statements
Temporary Field
Refused Bequest*
Bloater
Obje
Cha
Disp
Couple
Bloater
Obje
Cha
Disp
Couple
Divergent Change Bloater
Obje
Cha
Disp
Couple
Divergent Change
Parallel Inheritance Hierarchies
Bloater
Obje
Cha
Disp
Couple
Divergent Change
Shotgun Surgery
Bloater
Obje
Cha
Disp
Couple
Lazy Class*
Bloater
Obje
Cha
Disp
Couple
Duplicate Code
Lazy Class*
Data Class
Dead Code
Speculative Generality
Bloater
Obje
Cha
Disp
Couple
Comments
Lazy Class*
Data Class
Dead Code
Speculative Generality
Bloater
Obje
Cha
Disp
Couple
Comments
Duplicate Code
Lazy Class*
Dead Code
Speculative Generality
Bloater
Obje
Cha
Disp
Couple
Comments
Duplicate Code
Lazy Class*
Data Class
Speculative Generality
Bloater
Obje
Cha
Disp
Couple
Comments
Duplicate Code
Lazy Class*
Data Class
Dead Code
Bloater
Obje
Cha
Disp
Couple
*Feature Envy
*Inappropriate Intimacy
*Message Chains
*Middle Man (this should be presented)
*Incomplete Library Class
Blo...
Question
Answers
{
“name” : “Radu Vunvulea,
“blog” : “vunvulearadu.blogspot.com”,
“email” : ”vunvulear@outlook.com”,
“socialMedia” :
{
“twi...
Today: Enjoy the day
Tonight: Take a look on
https://sourcemaking.com/ refactoring
{
“name” : “Radu Vunvulea,
“blog” : “vunvulearadu.blogspot.com”,
“email” : ”vunvulear@outlook.com”,
“socialMedia” :
{
“twi...
Radu vunvulea   refactoring&code smells
Radu vunvulea   refactoring&code smells
Radu vunvulea   refactoring&code smells
Radu vunvulea   refactoring&code smells
Radu vunvulea   refactoring&code smells
Radu vunvulea   refactoring&code smells
Radu vunvulea   refactoring&code smells
Radu vunvulea   refactoring&code smells
Radu vunvulea   refactoring&code smells
Radu vunvulea   refactoring&code smells
Radu vunvulea   refactoring&code smells
Upcoming SlideShare
Loading in …5
×

Radu vunvulea refactoring&code smells

461 views

Published on

Base principals of Refactoring and Code Smells

Published in: Technology
  • Be the first to comment

Radu vunvulea refactoring&code smells

  1. 1. RADU VUNVULEA MCTS MCP BANK HOME AUTOMATION MVP ENTERPRISE AUTOMOTIVE PHARMA LEAN AND AGILE E-COMMERCE WEB iQuest AZURE JAVASCRIPT VUNVULEARADU.BLOGSPOT.COM MOBILE DOTNET @RaduVunvulea WCF WPF ENTHUSIASTIC
  2. 2. Add new functionality Optimize performance
  3. 3. Simplify code Improve code readibility
  4. 4. Reduce duplication Make code clear Improve maintainability Help to find bugs Help to program faster Fix design Improve code quality Code Smells
  5. 5. You do something the first time You do similar thing again with regret On the third time - START refactoring
  6. 6. • Prepare code • Understand the code Adding new functionality • Error is a sign of refactoring • Understand the code Bug fixing • Code reviewCode review When
  7. 7. “smells are certain structures in the code that suggest (scream for) the possibility of refactoring”
  8. 8. Signs of a low quality code Code is working, but something is fishy Each time we need to make a change in 4 places Nobody understand that code
  9. 9. • Fragile • Rigid • Complex • Repetitive Design Smell • Reusability • Changeability • Extensibility Design Quality • Maintainability • Reliability Product Quality
  10. 10. Rewrite Refactor
  11. 11. Edit and Pray Cover and Modify
  12. 12. Composing Methods Moving Features Between Objects Organizing Data Simplifying Conditional Expressions Making Method Calls Simpler Dealing with Generalization
  13. 13. Bloaters Object-Orientation Abusers Change Preventers Dispensables Couplers
  14. 14. Bloater Obje Cha Disp Couple
  15. 15. Large class Primitive Obsession Long Parameter List Data Clumps Bloater Obje Cha Disp Couple
  16. 16. Long method Primitive Obsession Long Parameter List Data Clumps Bloater Obje Cha Disp Couple
  17. 17. Long method Large class Long Parameter List Data Clumps Bloater Obje Cha Disp Couple
  18. 18. Long method Large class Primitive Obsession Data Clumps Bloater Obje Cha Disp Couple
  19. 19. Long method Large class Primitive Obsession Long Parameter List Bloater Obje Cha Disp Couple
  20. 20. Refused Bequest* Bloater Obje Cha Disp Couple
  21. 21. Temporary Field Refused Bequest* Alternative Classes with Different Interfaces Bloater Obje Cha Disp Couple
  22. 22. Switch Statements Refused Bequest* Alternative Classes with Different Interfaces Bloater Obje Cha Disp Couple
  23. 23. Switch Statements Temporary Field Refused Bequest* Bloater Obje Cha Disp Couple
  24. 24. Bloater Obje Cha Disp Couple
  25. 25. Divergent Change Bloater Obje Cha Disp Couple
  26. 26. Divergent Change Parallel Inheritance Hierarchies Bloater Obje Cha Disp Couple
  27. 27. Divergent Change Shotgun Surgery Bloater Obje Cha Disp Couple
  28. 28. Lazy Class* Bloater Obje Cha Disp Couple
  29. 29. Duplicate Code Lazy Class* Data Class Dead Code Speculative Generality Bloater Obje Cha Disp Couple
  30. 30. Comments Lazy Class* Data Class Dead Code Speculative Generality Bloater Obje Cha Disp Couple
  31. 31. Comments Duplicate Code Lazy Class* Dead Code Speculative Generality Bloater Obje Cha Disp Couple
  32. 32. Comments Duplicate Code Lazy Class* Data Class Speculative Generality Bloater Obje Cha Disp Couple
  33. 33. Comments Duplicate Code Lazy Class* Data Class Dead Code Bloater Obje Cha Disp Couple
  34. 34. *Feature Envy *Inappropriate Intimacy *Message Chains *Middle Man (this should be presented) *Incomplete Library Class Bloater Obje Cha Disp Couple
  35. 35. Question Answers
  36. 36. { “name” : “Radu Vunvulea, “blog” : “vunvulearadu.blogspot.com”, “email” : ”vunvulear@outlook.com”, “socialMedia” : { “twitter” : “@RaduVunvulea”, “fb” : “radu.vunvulea” } }
  37. 37. Today: Enjoy the day Tonight: Take a look on https://sourcemaking.com/ refactoring
  38. 38. { “name” : “Radu Vunvulea, “blog” : “vunvulearadu.blogspot.com”, “email” : ”vunvulear@outlook.com”, “socialMedia” : { “twitter” : “@RaduVunvulea”, “fb” : “radu.vunvulea” } }

×