Se ha denunciado esta presentación.
Utilizamos tu perfil de LinkedIn y tus datos de actividad para personalizar los anuncios y mostrarte publicidad más relevante. Puedes cambiar tus preferencias de publicidad en cualquier momento.

Refactoring and code smells

551 visualizaciones

Publicado el

Slides of the talk I gave at SwanseaCon 2016 (

Publicado en: Software
  • Sé el primero en comentar

Refactoring and code smells

  1. 1. Refactoring & Code Smells A step by step journey towards cleaner code Halima Koundi Software Craftsman Apprentice @hkoundi |
  2. 2. Code Smells “A code smell is a surface indication that usually corresponds to a deeper problem in the system.” M. Fowler
  3. 3. Code Smells The Bloaters Data Clumps Primitive Obsession Long Methods Large Classes Long Parameters List
  4. 4. Code Smells Object Orientation abusers Temporary Fields Switch Statement Refused Bequest Alternative Classes with Different interfaces
  5. 5. Code Smells Change Preventers Parallel Inheritance Hierarchies Divergent Change Shotgun Surgery
  6. 6. Code Smells The Couplers Feature Envy Inappropriate Intimacy Message Chains Middle Man
  7. 7. Code Smells The Dispensables Comments Dead Code Duplicate Code Data Class Lazy Class Speculative Generality
  8. 8. Refactoring Demo We are going to see how to - Deal with long parameters list - Split long methods - Refactor a switch statement
  9. 9. Refactoring Why should you care? When and when not? Two main reasons: - Decrease the cost of change - Make the code easier to understand When to refactor? - TDD: Red, Green, Refactor - To make room for change - When you fix a bug - As you do a code review
  10. 10. Resources: ➔ Code smells blog post by Ana Nogal ➔ Complex refactoring in simple steps Screencast by Matthew Butt
  11. 11. Thank you @hkoundi