SlideShare une entreprise Scribd logo
1  sur  20
Tópicos
● O que é refatoração?
● TDD
● Ciclo de refatoração
● Principais problemas
● Code Bad Smells
● Técnicas de refatoração
● Princípios
● Hands-on
O que é refatoração?
● “…is a disciplined technique for restructuring an existing
body of code, altering its internal structure without
changing its external behavior.” Fowler
Principais problemas
● Expressar intenção e finalidade
● Duplicação de código
● Gerenciamento de dependências
Code Bad Smells
“Pedaços de código que estão errados em algum
sentido e que são feios de ver!” Fowler (2009)
Técnicas de refatoração
OO Design Principles
● TDA: Tell, Don't ask!
● DRY: Don't repeat yourself
● LoD: Law of Demeter
● YAGNI: You aren't gonna need it
● KISS: Keep it simple, stupid
● SOLID
● GRASP: General Responsability Assignment Software
Principles
Tell Don't Ask
Don't repeat yourself
Every piece of knowledge must have a single, unambiguous,
authoritative representation within a system.
YAGNI (You Aren't Gonna Need It)
KISS (Keep it Simple, Stupid)
“Understanding responsibilities is key to object-oriented
design” Martin Fowler
Fontes
● Catalog of Refactorings: http://refactoring.com/catalog/
● SourceMaking: https://sourcemaking.com/refactoring
● TellDontAsk: http://martinfowler.com/bliki/TellDontAsk.html
● Dont Repeat Yourself: http://c2.com/cgi/wiki?DontRepeatYourself
● Law Of Demeter: http://c2.com/cgi/wiki/LawOfDemeter?LawOfDemeter
● Yagni: http://martinfowler.com/bliki/Yagni.html
● KISS: https://people.apache.org/~fhanik/kiss.html
● SOLID: http://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod
● GRASP: http://pt.slideshare.net/raheelarif54/grasp-confiz

Contenu connexe

Tendances

Code Retreat Venice (2016)
Code Retreat Venice (2016)Code Retreat Venice (2016)
Code Retreat Venice (2016)Peter Kofler
 
Stages Of Programming Skill, From Freshman To Senior
Stages Of Programming Skill, From Freshman To SeniorStages Of Programming Skill, From Freshman To Senior
Stages Of Programming Skill, From Freshman To Seniorpriestc
 
Resep jadi rockstar developer
Resep jadi rockstar developerResep jadi rockstar developer
Resep jadi rockstar developerrendra toro
 
Brief Introduction to Spectacular
Brief Introduction to SpectacularBrief Introduction to Spectacular
Brief Introduction to SpectacularMichael Dowling
 
Functional Programming with Groovy
Functional Programming with GroovyFunctional Programming with Groovy
Functional Programming with GroovyMario García
 
Joomla!Day 2013 India
Joomla!Day 2013 IndiaJoomla!Day 2013 India
Joomla!Day 2013 IndiaOfer Cohen
 
Tools to help you understand other people's code
Tools to help you understand other people's codeTools to help you understand other people's code
Tools to help you understand other people's codeDavid Paluy
 
How to become a python developer?
How to become a python developer?How to become a python developer?
How to become a python developer?Mohamed Magdy
 
Beter code for better tests
Beter code for better testsBeter code for better tests
Beter code for better testsGil Zilberfeld
 
Talking about craftsmanship with ensaimadas and katas
Talking about craftsmanship with ensaimadas and katasTalking about craftsmanship with ensaimadas and katas
Talking about craftsmanship with ensaimadas and katasRachel M. Carmena
 
Why TDD is Important for Everyone
Why TDD is Important for EveryoneWhy TDD is Important for Everyone
Why TDD is Important for EveryoneGil Zilberfeld
 
Talking about craftsmanship with "ensaimadas" and katas (May, 2018)
Talking about craftsmanship with "ensaimadas" and katas (May, 2018)Talking about craftsmanship with "ensaimadas" and katas (May, 2018)
Talking about craftsmanship with "ensaimadas" and katas (May, 2018)Rachel M. Carmena
 
Odalys cordero ubd
Odalys cordero ubdOdalys cordero ubd
Odalys cordero ubdschmidtpa
 
Creating A Unit Testing Strategy
Creating A Unit Testing StrategyCreating A Unit Testing Strategy
Creating A Unit Testing StrategyGil Zilberfeld
 

Tendances (16)

Code Retreat Venice (2016)
Code Retreat Venice (2016)Code Retreat Venice (2016)
Code Retreat Venice (2016)
 
Stages Of Programming Skill, From Freshman To Senior
Stages Of Programming Skill, From Freshman To SeniorStages Of Programming Skill, From Freshman To Senior
Stages Of Programming Skill, From Freshman To Senior
 
Code Dojo
Code DojoCode Dojo
Code Dojo
 
Resep jadi rockstar developer
Resep jadi rockstar developerResep jadi rockstar developer
Resep jadi rockstar developer
 
Brief Introduction to Spectacular
Brief Introduction to SpectacularBrief Introduction to Spectacular
Brief Introduction to Spectacular
 
Functional Programming with Groovy
Functional Programming with GroovyFunctional Programming with Groovy
Functional Programming with Groovy
 
Joomla!Day 2013 India
Joomla!Day 2013 IndiaJoomla!Day 2013 India
Joomla!Day 2013 India
 
Tools to help you understand other people's code
Tools to help you understand other people's codeTools to help you understand other people's code
Tools to help you understand other people's code
 
Coding Dojo
Coding DojoCoding Dojo
Coding Dojo
 
How to become a python developer?
How to become a python developer?How to become a python developer?
How to become a python developer?
 
Beter code for better tests
Beter code for better testsBeter code for better tests
Beter code for better tests
 
Talking about craftsmanship with ensaimadas and katas
Talking about craftsmanship with ensaimadas and katasTalking about craftsmanship with ensaimadas and katas
Talking about craftsmanship with ensaimadas and katas
 
Why TDD is Important for Everyone
Why TDD is Important for EveryoneWhy TDD is Important for Everyone
Why TDD is Important for Everyone
 
Talking about craftsmanship with "ensaimadas" and katas (May, 2018)
Talking about craftsmanship with "ensaimadas" and katas (May, 2018)Talking about craftsmanship with "ensaimadas" and katas (May, 2018)
Talking about craftsmanship with "ensaimadas" and katas (May, 2018)
 
Odalys cordero ubd
Odalys cordero ubdOdalys cordero ubd
Odalys cordero ubd
 
Creating A Unit Testing Strategy
Creating A Unit Testing StrategyCreating A Unit Testing Strategy
Creating A Unit Testing Strategy
 

En vedette

Human Connection: The Ultimate Digital Currency
Human Connection: The Ultimate Digital CurrencyHuman Connection: The Ultimate Digital Currency
Human Connection: The Ultimate Digital CurrencyIvan Cash
 
Theatrvmchemicvmashmol
TheatrvmchemicvmashmolTheatrvmchemicvmashmol
TheatrvmchemicvmashmolSergeyTeleguin
 
Quan tri cong_nghe
Quan tri cong_ngheQuan tri cong_nghe
Quan tri cong_nghePham Tigon
 
188589626 anonimo-sylva-philosophorum
188589626 anonimo-sylva-philosophorum188589626 anonimo-sylva-philosophorum
188589626 anonimo-sylva-philosophorumSergeyTeleguin
 
список публикаций
список публикацийсписок публикаций
список публикацийSergeyTeleguin
 
Baromètre des Professionnels 2016 - Odoxa pour Aviva
Baromètre des Professionnels 2016  - Odoxa pour AvivaBaromètre des Professionnels 2016  - Odoxa pour Aviva
Baromètre des Professionnels 2016 - Odoxa pour AvivaAbeille Assurances
 
ข้อสอบและเฉลย 7 วิชาสามัญ วิชาฟิสิกส์ ปีการศึกษา 2556 (1)
ข้อสอบและเฉลย 7 วิชาสามัญ วิชาฟิสิกส์ ปีการศึกษา 2556 (1)ข้อสอบและเฉลย 7 วิชาสามัญ วิชาฟิสิกส์ ปีการศึกษา 2556 (1)
ข้อสอบและเฉลย 7 วิชาสามัญ วิชาฟิสิกส์ ปีการศึกษา 2556 (1)Thanutchaporn Maneejansuk
 
Baromètre de l'économie sur le moral des Français - Odoxa
Baromètre de l'économie sur le moral des Français - Odoxa Baromètre de l'économie sur le moral des Français - Odoxa
Baromètre de l'économie sur le moral des Français - Odoxa Abeille Assurances
 

En vedette (19)

M
MM
M
 
Mm
MmMm
Mm
 
Cele
CeleCele
Cele
 
Flex
FlexFlex
Flex
 
Human Connection: The Ultimate Digital Currency
Human Connection: The Ultimate Digital CurrencyHuman Connection: The Ultimate Digital Currency
Human Connection: The Ultimate Digital Currency
 
Blog
BlogBlog
Blog
 
0e7fabf9f121894f4e012c9c24641eb7
0e7fabf9f121894f4e012c9c24641eb70e7fabf9f121894f4e012c9c24641eb7
0e7fabf9f121894f4e012c9c24641eb7
 
Theatrvmchemicvmashmol
TheatrvmchemicvmashmolTheatrvmchemicvmashmol
Theatrvmchemicvmashmol
 
Quan tri cong_nghe
Quan tri cong_ngheQuan tri cong_nghe
Quan tri cong_nghe
 
garden in alchemy
garden in alchemygarden in alchemy
garden in alchemy
 
188589626 anonimo-sylva-philosophorum
188589626 anonimo-sylva-philosophorum188589626 anonimo-sylva-philosophorum
188589626 anonimo-sylva-philosophorum
 
список публикаций
список публикацийсписок публикаций
список публикаций
 
Blog
BlogBlog
Blog
 
Baromètre des Professionnels 2016 - Odoxa pour Aviva
Baromètre des Professionnels 2016  - Odoxa pour AvivaBaromètre des Professionnels 2016  - Odoxa pour Aviva
Baromètre des Professionnels 2016 - Odoxa pour Aviva
 
ข้อสอบและเฉลย 7 วิชาสามัญ วิชาฟิสิกส์ ปีการศึกษา 2556 (1)
ข้อสอบและเฉลย 7 วิชาสามัญ วิชาฟิสิกส์ ปีการศึกษา 2556 (1)ข้อสอบและเฉลย 7 วิชาสามัญ วิชาฟิสิกส์ ปีการศึกษา 2556 (1)
ข้อสอบและเฉลย 7 วิชาสามัญ วิชาฟิสิกส์ ปีการศึกษา 2556 (1)
 
170273010 ใบงานที่-9-16
170273010 ใบงานที่-9-16170273010 ใบงานที่-9-16
170273010 ใบงานที่-9-16
 
Baromètre de l'économie sur le moral des Français - Odoxa
Baromètre de l'économie sur le moral des Français - Odoxa Baromètre de l'économie sur le moral des Français - Odoxa
Baromètre de l'économie sur le moral des Français - Odoxa
 
Ayat aktif & ayat pasif
Ayat aktif & ayat pasifAyat aktif & ayat pasif
Ayat aktif & ayat pasif
 
Kurikulum KBSR dan KSSR
Kurikulum KBSR dan KSSRKurikulum KBSR dan KSSR
Kurikulum KBSR dan KSSR
 

Similaire à Refactoring

WeActuallyBuildStuff - Extreme Programming Live
WeActuallyBuildStuff - Extreme Programming LiveWeActuallyBuildStuff - Extreme Programming Live
WeActuallyBuildStuff - Extreme Programming LiveJohannes Brodwall
 
BDD workshop for JavaScript developers
BDD workshop for JavaScript developersBDD workshop for JavaScript developers
BDD workshop for JavaScript developersCarlos Ble
 
Pair Programming (2014)
Pair Programming (2014)Pair Programming (2014)
Pair Programming (2014)Peter Kofler
 
Coderetreat - Practice to Master Your Crafts
Coderetreat - Practice to Master Your CraftsCoderetreat - Practice to Master Your Crafts
Coderetreat - Practice to Master Your CraftsLemi Orhan Ergin
 
TDD and more than 9000 tries to sell it to a customer
TDD and more than 9000 tries to sell it to a customerTDD and more than 9000 tries to sell it to a customer
TDD and more than 9000 tries to sell it to a customerAnuar Nurmakanov
 
Xconf 2014 - Contributing to Open Source
Xconf 2014 - Contributing to Open SourceXconf 2014 - Contributing to Open Source
Xconf 2014 - Contributing to Open SourceParas Narang
 
2013 09-11 java zone - extreme programming live
2013 09-11 java zone - extreme programming live2013 09-11 java zone - extreme programming live
2013 09-11 java zone - extreme programming liveJohannes Brodwall
 
Deliberate Practice (Agile Slovenia 2015)
Deliberate Practice (Agile Slovenia 2015)Deliberate Practice (Agile Slovenia 2015)
Deliberate Practice (Agile Slovenia 2015)Peter Kofler
 
Exploring design-alternatives-using-tdd
Exploring design-alternatives-using-tddExploring design-alternatives-using-tdd
Exploring design-alternatives-using-tddAlexandru Bolboaca
 
Agile Programming Live - AgilePrague2012
Agile Programming Live - AgilePrague2012Agile Programming Live - AgilePrague2012
Agile Programming Live - AgilePrague2012Johannes Brodwall
 
Getting Comfortable with BDD
Getting Comfortable with BDDGetting Comfortable with BDD
Getting Comfortable with BDDAlex Sharp
 
TDD - Christchurch APN May 2012
TDD - Christchurch APN May 2012TDD - Christchurch APN May 2012
TDD - Christchurch APN May 2012Alan Christensen
 
30% faster coder on-boarding when you have a code cookbook
30% faster coder on-boarding when you have a code cookbook30% faster coder on-boarding when you have a code cookbook
30% faster coder on-boarding when you have a code cookbookGabriel Paunescu 🤖
 
Scottish Ruby Conference 2014
Scottish Ruby Conference  2014Scottish Ruby Conference  2014
Scottish Ruby Conference 2014michaelag1971
 
Behavior Driven Education: A Story of Learning ROR
Behavior Driven Education: A Story of Learning RORBehavior Driven Education: A Story of Learning ROR
Behavior Driven Education: A Story of Learning RORSmartLogic
 
TDD as if You Meant It (2013)
TDD as if You Meant It (2013)TDD as if You Meant It (2013)
TDD as if You Meant It (2013)Peter Kofler
 
Is your code SOLID enough?
 Is your code SOLID enough? Is your code SOLID enough?
Is your code SOLID enough?SARCCOM
 

Similaire à Refactoring (20)

Make a better with clean code
Make a better with clean codeMake a better with clean code
Make a better with clean code
 
WeActuallyBuildStuff - Extreme Programming Live
WeActuallyBuildStuff - Extreme Programming LiveWeActuallyBuildStuff - Extreme Programming Live
WeActuallyBuildStuff - Extreme Programming Live
 
BDD workshop for JavaScript developers
BDD workshop for JavaScript developersBDD workshop for JavaScript developers
BDD workshop for JavaScript developers
 
Pair Programming (2014)
Pair Programming (2014)Pair Programming (2014)
Pair Programming (2014)
 
Coderetreat - Practice to Master Your Crafts
Coderetreat - Practice to Master Your CraftsCoderetreat - Practice to Master Your Crafts
Coderetreat - Practice to Master Your Crafts
 
TDD and more than 9000 tries to sell it to a customer
TDD and more than 9000 tries to sell it to a customerTDD and more than 9000 tries to sell it to a customer
TDD and more than 9000 tries to sell it to a customer
 
Code Review
Code ReviewCode Review
Code Review
 
Xconf 2014 - Contributing to Open Source
Xconf 2014 - Contributing to Open SourceXconf 2014 - Contributing to Open Source
Xconf 2014 - Contributing to Open Source
 
2013 09-11 java zone - extreme programming live
2013 09-11 java zone - extreme programming live2013 09-11 java zone - extreme programming live
2013 09-11 java zone - extreme programming live
 
Deliberate Practice (Agile Slovenia 2015)
Deliberate Practice (Agile Slovenia 2015)Deliberate Practice (Agile Slovenia 2015)
Deliberate Practice (Agile Slovenia 2015)
 
Xtreme Programming
Xtreme ProgrammingXtreme Programming
Xtreme Programming
 
Exploring design-alternatives-using-tdd
Exploring design-alternatives-using-tddExploring design-alternatives-using-tdd
Exploring design-alternatives-using-tdd
 
Agile Programming Live - AgilePrague2012
Agile Programming Live - AgilePrague2012Agile Programming Live - AgilePrague2012
Agile Programming Live - AgilePrague2012
 
Getting Comfortable with BDD
Getting Comfortable with BDDGetting Comfortable with BDD
Getting Comfortable with BDD
 
TDD - Christchurch APN May 2012
TDD - Christchurch APN May 2012TDD - Christchurch APN May 2012
TDD - Christchurch APN May 2012
 
30% faster coder on-boarding when you have a code cookbook
30% faster coder on-boarding when you have a code cookbook30% faster coder on-boarding when you have a code cookbook
30% faster coder on-boarding when you have a code cookbook
 
Scottish Ruby Conference 2014
Scottish Ruby Conference  2014Scottish Ruby Conference  2014
Scottish Ruby Conference 2014
 
Behavior Driven Education: A Story of Learning ROR
Behavior Driven Education: A Story of Learning RORBehavior Driven Education: A Story of Learning ROR
Behavior Driven Education: A Story of Learning ROR
 
TDD as if You Meant It (2013)
TDD as if You Meant It (2013)TDD as if You Meant It (2013)
TDD as if You Meant It (2013)
 
Is your code SOLID enough?
 Is your code SOLID enough? Is your code SOLID enough?
Is your code SOLID enough?
 

Dernier

Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...harshavardhanraghave
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerThousandEyes
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 

Dernier (20)

Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 

Refactoring

  • 1.
  • 2. Tópicos ● O que é refatoração? ● TDD ● Ciclo de refatoração ● Principais problemas ● Code Bad Smells ● Técnicas de refatoração ● Princípios ● Hands-on
  • 3. O que é refatoração? ● “…is a disciplined technique for restructuring an existing body of code, altering its internal structure without changing its external behavior.” Fowler
  • 4.
  • 5.
  • 6. Principais problemas ● Expressar intenção e finalidade ● Duplicação de código ● Gerenciamento de dependências
  • 7. Code Bad Smells “Pedaços de código que estão errados em algum sentido e que são feios de ver!” Fowler (2009)
  • 8.
  • 10.
  • 11. OO Design Principles ● TDA: Tell, Don't ask! ● DRY: Don't repeat yourself ● LoD: Law of Demeter ● YAGNI: You aren't gonna need it ● KISS: Keep it simple, stupid ● SOLID ● GRASP: General Responsability Assignment Software Principles
  • 13. Don't repeat yourself Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
  • 14.
  • 15. YAGNI (You Aren't Gonna Need It)
  • 16. KISS (Keep it Simple, Stupid)
  • 17.
  • 18. “Understanding responsibilities is key to object-oriented design” Martin Fowler
  • 19.
  • 20. Fontes ● Catalog of Refactorings: http://refactoring.com/catalog/ ● SourceMaking: https://sourcemaking.com/refactoring ● TellDontAsk: http://martinfowler.com/bliki/TellDontAsk.html ● Dont Repeat Yourself: http://c2.com/cgi/wiki?DontRepeatYourself ● Law Of Demeter: http://c2.com/cgi/wiki/LawOfDemeter?LawOfDemeter ● Yagni: http://martinfowler.com/bliki/Yagni.html ● KISS: https://people.apache.org/~fhanik/kiss.html ● SOLID: http://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod ● GRASP: http://pt.slideshare.net/raheelarif54/grasp-confiz