SlideShare una empresa de Scribd logo
1 de 44
Descargar para leer sin conexión
Ola.	
  
@nigelfds	
  


   github.com/nigelfds	
  
(Talk	
  +	
  Examples)	
  ~	
  1hour	
  

(Talk	
  –	
  Examples)	
  ~	
  30mins	
  
Refactoring?	
  
a	
  change	
  made	
  to	
  the	
  internal	
  
structure	
  of	
  soFware	
  to	
  make	
  it	
  
easier	
  to	
  understand	
  and	
  cheaper	
  
to	
  modify	
  without	
  
changing	
  its	
  
observable	
  behavior	
  


                    -­‐	
  MarLn	
  Fowler	
  
 Don't	
  touch	
  anything	
  that	
  doesn't	
  
                have	
  coverage.	
  




Otherwise,	
  you're	
  not	
  refactoring;	
  
    you're	
  just	
  changing	
  shit.	
  
a	
  change	
  made	
  to	
  the	
  internal	
  
structure	
  of	
  soFware	
  to	
  make	
  it	
  

easier	
  to	
  
understand	
  and	
  
cheaper	
  to	
  
modify	
  without	
  changing	
  
its	
  observable	
  behavior	
  

                     -­‐	
  MarLn	
  Fowler	
  
SomeLmes	
  	
  
it	
  just	
  feels	
  
       right.	
  
Step	
  1:	
  
Measure	
  the	
  
 toxicity.	
  
Smells	
  in	
  the	
  code	
  
CyclomaLc	
  Complexity	
  




5	
  to	
  7	
  is	
  decent	
  for	
  
most	
  ruby	
  code	
  
Saikuro	
  
Assignments,	
  Branches,	
  Calls	
  	
  
           with	
  Flog	
  




Watch	
  for	
  scores	
  
greater	
  than	
  40	
  
Flog	
  
DuplicaLon	
  with	
  Flay	
  




Watch	
  for	
  scores	
  
greater	
  than	
  30	
  
Flay	
  
Control	
  Couples	
  and	
  more	
  	
  
                   with	
  Reek	
  




Simulated	
  Polymorphism	
  
Feature	
  Envy	
  
ULlity	
  Methods	
  
LinLng	
  with	
  Dust/Nitpick	
  




Branch	
  Checks	
  
Common	
  smells	
  	
  
   in	
  Ruby	
  	
  
PrimiLve	
  Obsession	
  
Feature	
  Envy	
  

class Cart
  def price
    @item.price + @item.tax
  end
end
Meta-­‐programming	
  




 Keep	
  it	
  simple.	
  	
  
 Keep	
  it	
  declaraLve	
  
Toxicity	
  is	
  more	
  than	
  code	
  smells	
  
“The	
  real	
  problem	
  I	
  have	
  with	
  the	
  CK	
  suite	
  and	
  similar	
  
metrics	
  is	
  that	
  they	
  only	
  measure	
  a	
  single	
  module	
  (or	
  class	
  in	
  
this	
  case).	
  	
  
I	
  claim	
  that	
  the	
  quality	
  of	
  the	
  design	
  of	
  a	
  system	
  is	
  not	
  
something	
  that	
  can	
  be	
  determined	
  by	
  looking	
  at	
  individual	
  
classes.	
  	
  
It	
  is	
  conceivable	
  that	
  every	
  class	
  in	
  a	
  system	
  could	
  be	
  
considered	
  reasonable	
  by	
  whatever	
  single-­‐class	
  metrics	
  are	
  
being	
  used,	
  but	
  the	
  overall	
  design	
  is	
  considered	
  bad.”	
  
Ewan	
  Tempero:	
  A	
  Research	
  Agenda	
  



                                                             hDp://www.cs.auckland.ac.nz/~ewan/	
  
Duplicity	
  vs	
  Coupling	
  
DEPENDENCY	
  
Tangles	
  
Step	
  2:	
  Make	
  it	
  visible	
  
Treemaps	
  (Max	
  CC)	
  




hbp://mbostock.github.com/protovis/	
  
Treemaps	
  
Dependency	
  matrix	
  
Step	
  3:	
  Agree	
  on	
  the	
  fix	
  
Step	
  4:	
  	
  	
  
Go	
  fix	
  it	
  
“I	
  do	
  believe	
  that	
  complexity	
  is	
  the	
  enemy.	
  
UnKl	
  we	
  beDer	
  understand	
  complexity,	
  our	
  
chances	
  of	
  building	
  beDer	
  IT	
  systems	
  is	
  
limited.	
  The	
  first	
  thing	
  we	
  must	
  understand	
  
about	
  complexity	
  is	
  that	
  not	
  all	
  complexity	
  is	
  
equal.	
  And	
  the	
  complexity	
  on	
  which	
  most	
  
people	
  focus	
  is	
  probably	
  the	
  least	
  complex	
  
complexity	
  of	
  all.”	
  
Roger	
  Sessions	
  



               hbp://simplearchitectures.blogspot.com/2009/03/cancer-­‐of-­‐complexity.html	
  
Gracias	
  

Más contenido relacionado

Similar a RubyConf Uruguay 2011

Scottish Ruby Conference 2014
Scottish Ruby Conference  2014Scottish Ruby Conference  2014
Scottish Ruby Conference 2014
michaelag1971
 

Similar a RubyConf Uruguay 2011 (20)

Six of the Best
Six of the BestSix of the Best
Six of the Best
 
Refactoring, 2nd Edition
Refactoring, 2nd EditionRefactoring, 2nd Edition
Refactoring, 2nd Edition
 
Ruby codebases in an entropic universe
Ruby codebases in an entropic universeRuby codebases in an entropic universe
Ruby codebases in an entropic universe
 
Clean Code
Clean CodeClean Code
Clean Code
 
SRECon Coherent Performance
SRECon Coherent PerformanceSRECon Coherent Performance
SRECon Coherent Performance
 
Clean code-v2.2
Clean code-v2.2Clean code-v2.2
Clean code-v2.2
 
TxJS 2011
TxJS 2011TxJS 2011
TxJS 2011
 
Clean Code .Net Cheetsheets
Clean Code .Net CheetsheetsClean Code .Net Cheetsheets
Clean Code .Net Cheetsheets
 
Principled And Clean Coding
Principled And Clean CodingPrincipled And Clean Coding
Principled And Clean Coding
 
Code Smells
Code SmellsCode Smells
Code Smells
 
Minimalism
MinimalismMinimalism
Minimalism
 
Falling off the shoulders of giants
Falling off the shoulders of giantsFalling off the shoulders of giants
Falling off the shoulders of giants
 
Ruby Metaprogramming - OSCON 2008
Ruby Metaprogramming - OSCON 2008Ruby Metaprogramming - OSCON 2008
Ruby Metaprogramming - OSCON 2008
 
Refactor to the Limit!
Refactor to the Limit!Refactor to the Limit!
Refactor to the Limit!
 
Infrastructure as code might be literally impossible / Joe Domato (packageclo...
Infrastructure as code might be literally impossible / Joe Domato (packageclo...Infrastructure as code might be literally impossible / Joe Domato (packageclo...
Infrastructure as code might be literally impossible / Joe Domato (packageclo...
 
Scottish Ruby Conference 2014
Scottish Ruby Conference  2014Scottish Ruby Conference  2014
Scottish Ruby Conference 2014
 
Code quality
Code quality Code quality
Code quality
 
Clean code
Clean codeClean code
Clean code
 
Clean code quotes - Citações e provocações
Clean code quotes - Citações e provocaçõesClean code quotes - Citações e provocações
Clean code quotes - Citações e provocações
 
Being Dangerous with Twig (Symfony Live Paris)
Being Dangerous with Twig (Symfony Live Paris)Being Dangerous with Twig (Symfony Live Paris)
Being Dangerous with Twig (Symfony Live Paris)
 

Más de Nigel Fernandes

Más de Nigel Fernandes (11)

Digital Transformation Summit - Melbourne 2019
Digital Transformation Summit - Melbourne 2019Digital Transformation Summit - Melbourne 2019
Digital Transformation Summit - Melbourne 2019
 
Ipqc Enterprise Architecture Summit - Melbourne 2019
Ipqc  Enterprise Architecture Summit - Melbourne 2019Ipqc  Enterprise Architecture Summit - Melbourne 2019
Ipqc Enterprise Architecture Summit - Melbourne 2019
 
Exploiting Serverless - DevOps Conference Sydney 2018
Exploiting Serverless - DevOps Conference Sydney 2018Exploiting Serverless - DevOps Conference Sydney 2018
Exploiting Serverless - DevOps Conference Sydney 2018
 
Microservices meetup
Microservices meetupMicroservices meetup
Microservices meetup
 
Seek test-invaders
Seek test-invadersSeek test-invaders
Seek test-invaders
 
My career lessons - for Monash Students at Battle of the Brains 215
My career lessons - for Monash Students at Battle of the Brains 215My career lessons - for Monash Students at Battle of the Brains 215
My career lessons - for Monash Students at Battle of the Brains 215
 
Lessons learnt the hard way.
Lessons learnt the hard way.Lessons learnt the hard way.
Lessons learnt the hard way.
 
Lean Programmer Anarchy
Lean Programmer Anarchy Lean Programmer Anarchy
Lean Programmer Anarchy
 
Towards a responsive business, the developer way
Towards a responsive business, the developer wayTowards a responsive business, the developer way
Towards a responsive business, the developer way
 
RubyConf Brazil 2011
RubyConf Brazil 2011RubyConf Brazil 2011
RubyConf Brazil 2011
 
Test Engineering
Test EngineeringTest Engineering
Test Engineering
 

Último

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Último (20)

Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
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
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
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...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 

RubyConf Uruguay 2011