SlideShare uma empresa Scribd logo
1 de 39
Everything you Wanted to Know About Refactoring but were Afraid to Ask! By Gary Short Technical Evangelist Developer Express
Agenda What is Refactoring? Why Should I Refactor? How do I know that I have to refactor? How Should I Refactor? How can Tooling Help Me? Advanced Refactoring.
Why do I Need to Know this? Refactoring is a professional dev skill Therefore it’s a must have skill for you! Helps to keep technical debt under control Technical debt kills projects.
Introduction Gary Short Technical Evangelist for Developer Express Community Evangelist for... Well, me really!  Microsoft MVP C# Where do I hang out? http://www.garyshort.org (blog) http://www.twitter.com/garyshort http://www.sodthis.com (podcast).
How About you Guys?
What is Refactoring? Knowledge says refactoring is... the process of changing a computer program's internal structure  without modifying its external functional behavior  or existing functionality,  in order to improve  internal non-functional properties of the software,  for example to improve code readability,  to simplify code structure,  to change code to adhere to a given programming paradigm,  to improve maintainability,  or to improve extensibility.
Ooo, Hold on, How’d you do That? the process of changing a computer program's internal structure  without modifying its external functional behavior  or existing functionality,  Unit Testing is a software design and development method where the programmer gains confidence that individual units of source code are fit for use modern applications include the use of a test framework such as nUnit each test case is independent from the others: substitutes like method stubs, mock objects, fakes and test harnesses can be used to assist testing a module in isolation.
Quick Example Biggest Refactoring Eva!! ,[object Object]
The earthquake reminded the world that the San Francisco Bay region remains vulnerable
If a Richter magnitude 8.0 or greater earthquake centered near the Bridge, there would be a substantial risk of impending collapse
Retrofit starts 1997
Still ongoing today
Cost ~ half a billion dollars.,[object Object]
Financial Debt Isn’t All Bad
Technical Debt Isn’t all Bad Either
Refactoring Pays Back this Debt
Refactoring Pays Back this Debt
How Do I Know When To Refactor?
How Do I Know When To Refactor?
How Do I Know When To Refactor?
How Do I Know When To Refactor?
How Do I Know When To Refactor?
How Do I Know When To Refactor?
How Should I Refactor? Ask yourself the following questions Is my code readable?  Is my code abstract?  Anything more is rearranging the deck chairs on the Titanic It gives you a sense of doing something But ultimately it’s pointless. 
Refactoring for Readability #1
Refactoring for Readability #1
Refactoring for Readability #2
Refactoring for Readability #3
Refactoring for Readability #4
Refactoring for Readability #5
Refactoring to Make Abstract #1
Refactoring to Make Abstract #2
Refactoring to Make Abstract #2
Refactoring to Make Abstract #3
Can Tooling Help me? Yes, in the following ways Refactoring can be repetitive Repetitive tasks bore humans Resulting in mistakes Solutions can contain many projects Many classes with many projects can contain the same method calls This makes them hard to find and easy to miss Tools can suggest refactors that you might not know exist.
Tooling Demo
Refactoring to Patterns #1
Refactoring to Patterns #1
Refactoring to Patterns #2

Mais conteúdo relacionado

Semelhante a Everything you Wanted to Know About Refactoring

Software and all that comes with it
Software and all that comes with itSoftware and all that comes with it
Software and all that comes with itAlberto Brandolini
 
From 🤦 to 🐿️
From 🤦 to 🐿️From 🤦 to 🐿️
From 🤦 to 🐿️Ori Pekelman
 
From DevOps to NoOps how not to get Equifaxed Apidays
From DevOps to NoOps how not to get Equifaxed ApidaysFrom DevOps to NoOps how not to get Equifaxed Apidays
From DevOps to NoOps how not to get Equifaxed ApidaysOri Pekelman
 
Technical Debt for Product Managers by Square Sr PM
Technical Debt for Product Managers by Square Sr PMTechnical Debt for Product Managers by Square Sr PM
Technical Debt for Product Managers by Square Sr PMProduct School
 
How to justify technical debt mitigations in Software Engineering
How to justify technical debt mitigations in Software EngineeringHow to justify technical debt mitigations in Software Engineering
How to justify technical debt mitigations in Software EngineeringAndré Agostinho
 
Beyond Technical Debt: Unconventional techniques to uncover technical and soc...
Beyond Technical Debt: Unconventional techniques to uncover technical and soc...Beyond Technical Debt: Unconventional techniques to uncover technical and soc...
Beyond Technical Debt: Unconventional techniques to uncover technical and soc...Juraj Martinka
 
Refactoring 2TheMax (con ReSharper)
Refactoring 2TheMax (con ReSharper)Refactoring 2TheMax (con ReSharper)
Refactoring 2TheMax (con ReSharper)DotNetMarche
 
Agile Australia 2016 - Rescuing Legacy Software from Impending Doom
Agile Australia 2016 - Rescuing Legacy Software from Impending DoomAgile Australia 2016 - Rescuing Legacy Software from Impending Doom
Agile Australia 2016 - Rescuing Legacy Software from Impending DoomJacques De Vos
 
Refactoring, 2nd Edition
Refactoring, 2nd EditionRefactoring, 2nd Edition
Refactoring, 2nd Editionjexp
 
2018 01-29 - brewbox - refactoring. sempre, senza pietà
2018 01-29 - brewbox - refactoring. sempre, senza pietà2018 01-29 - brewbox - refactoring. sempre, senza pietà
2018 01-29 - brewbox - refactoring. sempre, senza pietàRoberto Albertini
 
Teaching Elephants to Dance (and Fly!): A Developer's Journey to Digital Tran...
Teaching Elephants to Dance (and Fly!): A Developer's Journey to Digital Tran...Teaching Elephants to Dance (and Fly!): A Developer's Journey to Digital Tran...
Teaching Elephants to Dance (and Fly!): A Developer's Journey to Digital Tran...Burr Sutter
 
How to deal with tech debt: Lessons learned from the best engineering teams
How to deal with tech debt: Lessons learned from the best engineering teamsHow to deal with tech debt: Lessons learned from the best engineering teams
How to deal with tech debt: Lessons learned from the best engineering teamsAlexandre Omeyer
 
Technical Debt - osbridge
Technical Debt - osbridgeTechnical Debt - osbridge
Technical Debt - osbridgeenaramore
 
Sandro Mancuso and David Green: London Software Craftsmanship Community: What...
Sandro Mancuso and David Green: London Software Craftsmanship Community: What...Sandro Mancuso and David Green: London Software Craftsmanship Community: What...
Sandro Mancuso and David Green: London Software Craftsmanship Community: What...Skills Matter
 
Agile Development Overview (with a bit about builds)
Agile Development Overview (with a bit about builds)Agile Development Overview (with a bit about builds)
Agile Development Overview (with a bit about builds)David Benjamin
 
TPS Lean and Agile - Brief History and Future
TPS Lean and Agile - Brief History and FutureTPS Lean and Agile - Brief History and Future
TPS Lean and Agile - Brief History and FutureKiro Harada
 
Improving the Usability of Refactoring Tools for Software Change Tasks
Improving the Usability of Refactoring Tools for Software Change TasksImproving the Usability of Refactoring Tools for Software Change Tasks
Improving the Usability of Refactoring Tools for Software Change TasksAnna Maria Eilertsen
 

Semelhante a Everything you Wanted to Know About Refactoring (20)

Software and all that comes with it
Software and all that comes with itSoftware and all that comes with it
Software and all that comes with it
 
From 🤦 to 🐿️
From 🤦 to 🐿️From 🤦 to 🐿️
From 🤦 to 🐿️
 
From DevOps to NoOps how not to get Equifaxed Apidays
From DevOps to NoOps how not to get Equifaxed ApidaysFrom DevOps to NoOps how not to get Equifaxed Apidays
From DevOps to NoOps how not to get Equifaxed Apidays
 
Technical Debt for Product Managers by Square Sr PM
Technical Debt for Product Managers by Square Sr PMTechnical Debt for Product Managers by Square Sr PM
Technical Debt for Product Managers by Square Sr PM
 
How to justify technical debt mitigations in Software Engineering
How to justify technical debt mitigations in Software EngineeringHow to justify technical debt mitigations in Software Engineering
How to justify technical debt mitigations in Software Engineering
 
Refactoring 2 The Max
Refactoring 2 The MaxRefactoring 2 The Max
Refactoring 2 The Max
 
Beyond Technical Debt: Unconventional techniques to uncover technical and soc...
Beyond Technical Debt: Unconventional techniques to uncover technical and soc...Beyond Technical Debt: Unconventional techniques to uncover technical and soc...
Beyond Technical Debt: Unconventional techniques to uncover technical and soc...
 
Refactoring 2TheMax (con ReSharper)
Refactoring 2TheMax (con ReSharper)Refactoring 2TheMax (con ReSharper)
Refactoring 2TheMax (con ReSharper)
 
Agile Australia 2016 - Rescuing Legacy Software from Impending Doom
Agile Australia 2016 - Rescuing Legacy Software from Impending DoomAgile Australia 2016 - Rescuing Legacy Software from Impending Doom
Agile Australia 2016 - Rescuing Legacy Software from Impending Doom
 
Technical debt
Technical debtTechnical debt
Technical debt
 
Refactoring, 2nd Edition
Refactoring, 2nd EditionRefactoring, 2nd Edition
Refactoring, 2nd Edition
 
2018 01-29 - brewbox - refactoring. sempre, senza pietà
2018 01-29 - brewbox - refactoring. sempre, senza pietà2018 01-29 - brewbox - refactoring. sempre, senza pietà
2018 01-29 - brewbox - refactoring. sempre, senza pietà
 
Teaching Elephants to Dance (and Fly!): A Developer's Journey to Digital Tran...
Teaching Elephants to Dance (and Fly!): A Developer's Journey to Digital Tran...Teaching Elephants to Dance (and Fly!): A Developer's Journey to Digital Tran...
Teaching Elephants to Dance (and Fly!): A Developer's Journey to Digital Tran...
 
How to deal with tech debt: Lessons learned from the best engineering teams
How to deal with tech debt: Lessons learned from the best engineering teamsHow to deal with tech debt: Lessons learned from the best engineering teams
How to deal with tech debt: Lessons learned from the best engineering teams
 
Technical Debt - osbridge
Technical Debt - osbridgeTechnical Debt - osbridge
Technical Debt - osbridge
 
Sandro Mancuso and David Green: London Software Craftsmanship Community: What...
Sandro Mancuso and David Green: London Software Craftsmanship Community: What...Sandro Mancuso and David Green: London Software Craftsmanship Community: What...
Sandro Mancuso and David Green: London Software Craftsmanship Community: What...
 
Agile Development Overview (with a bit about builds)
Agile Development Overview (with a bit about builds)Agile Development Overview (with a bit about builds)
Agile Development Overview (with a bit about builds)
 
TPS Lean and Agile - Brief History and Future
TPS Lean and Agile - Brief History and FutureTPS Lean and Agile - Brief History and Future
TPS Lean and Agile - Brief History and Future
 
Improving the Usability of Refactoring Tools for Software Change Tasks
Improving the Usability of Refactoring Tools for Software Change TasksImproving the Usability of Refactoring Tools for Software Change Tasks
Improving the Usability of Refactoring Tools for Software Change Tasks
 
Technical Debt
Technical DebtTechnical Debt
Technical Debt
 

Mais de Gary Short

Raspberry Pi - Rocksolid Tour 2013
Raspberry Pi  - Rocksolid Tour 2013Raspberry Pi  - Rocksolid Tour 2013
Raspberry Pi - Rocksolid Tour 2013Gary Short
 
Not Everything is an Object - Rocksolid Tour 2013
Not Everything is an Object  - Rocksolid Tour 2013Not Everything is an Object  - Rocksolid Tour 2013
Not Everything is an Object - Rocksolid Tour 2013Gary Short
 
Marginal Gains - Rocksolid Tour 2013
Marginal Gains  - Rocksolid Tour 2013Marginal Gains  - Rocksolid Tour 2013
Marginal Gains - Rocksolid Tour 2013Gary Short
 
.Net Collection Classes Deep Dive - Rocksolid Tour 2013
.Net Collection Classes Deep Dive  - Rocksolid Tour 2013.Net Collection Classes Deep Dive  - Rocksolid Tour 2013
.Net Collection Classes Deep Dive - Rocksolid Tour 2013Gary Short
 
Building an Internet Radio on the RaspberryPI
Building an Internet Radio on the RaspberryPIBuilding an Internet Radio on the RaspberryPI
Building an Internet Radio on the RaspberryPIGary Short
 
Not Everything Is An Object
Not Everything Is An ObjectNot Everything Is An Object
Not Everything Is An ObjectGary Short
 
Technical Debt
Technical DebtTechnical Debt
Technical DebtGary Short
 

Mais de Gary Short (7)

Raspberry Pi - Rocksolid Tour 2013
Raspberry Pi  - Rocksolid Tour 2013Raspberry Pi  - Rocksolid Tour 2013
Raspberry Pi - Rocksolid Tour 2013
 
Not Everything is an Object - Rocksolid Tour 2013
Not Everything is an Object  - Rocksolid Tour 2013Not Everything is an Object  - Rocksolid Tour 2013
Not Everything is an Object - Rocksolid Tour 2013
 
Marginal Gains - Rocksolid Tour 2013
Marginal Gains  - Rocksolid Tour 2013Marginal Gains  - Rocksolid Tour 2013
Marginal Gains - Rocksolid Tour 2013
 
.Net Collection Classes Deep Dive - Rocksolid Tour 2013
.Net Collection Classes Deep Dive  - Rocksolid Tour 2013.Net Collection Classes Deep Dive  - Rocksolid Tour 2013
.Net Collection Classes Deep Dive - Rocksolid Tour 2013
 
Building an Internet Radio on the RaspberryPI
Building an Internet Radio on the RaspberryPIBuilding an Internet Radio on the RaspberryPI
Building an Internet Radio on the RaspberryPI
 
Not Everything Is An Object
Not Everything Is An ObjectNot Everything Is An Object
Not Everything Is An Object
 
Technical Debt
Technical DebtTechnical Debt
Technical Debt
 

Último

Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditSkynet Technologies
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 

Último (20)

Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance Audit
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 

Everything you Wanted to Know About Refactoring

  • 1. Everything you Wanted to Know About Refactoring but were Afraid to Ask! By Gary Short Technical Evangelist Developer Express
  • 2. Agenda What is Refactoring? Why Should I Refactor? How do I know that I have to refactor? How Should I Refactor? How can Tooling Help Me? Advanced Refactoring.
  • 3. Why do I Need to Know this? Refactoring is a professional dev skill Therefore it’s a must have skill for you! Helps to keep technical debt under control Technical debt kills projects.
  • 4. Introduction Gary Short Technical Evangelist for Developer Express Community Evangelist for... Well, me really!  Microsoft MVP C# Where do I hang out? http://www.garyshort.org (blog) http://www.twitter.com/garyshort http://www.sodthis.com (podcast).
  • 6. What is Refactoring? Knowledge says refactoring is... the process of changing a computer program's internal structure without modifying its external functional behavior or existing functionality, in order to improve internal non-functional properties of the software, for example to improve code readability, to simplify code structure, to change code to adhere to a given programming paradigm, to improve maintainability, or to improve extensibility.
  • 7. Ooo, Hold on, How’d you do That? the process of changing a computer program's internal structure without modifying its external functional behavior or existing functionality, Unit Testing is a software design and development method where the programmer gains confidence that individual units of source code are fit for use modern applications include the use of a test framework such as nUnit each test case is independent from the others: substitutes like method stubs, mock objects, fakes and test harnesses can be used to assist testing a module in isolation.
  • 8.
  • 9. The earthquake reminded the world that the San Francisco Bay region remains vulnerable
  • 10. If a Richter magnitude 8.0 or greater earthquake centered near the Bridge, there would be a substantial risk of impending collapse
  • 13.
  • 15. Technical Debt Isn’t all Bad Either
  • 18. How Do I Know When To Refactor?
  • 19. How Do I Know When To Refactor?
  • 20. How Do I Know When To Refactor?
  • 21. How Do I Know When To Refactor?
  • 22. How Do I Know When To Refactor?
  • 23. How Do I Know When To Refactor?
  • 24. How Should I Refactor? Ask yourself the following questions Is my code readable? Is my code abstract? Anything more is rearranging the deck chairs on the Titanic It gives you a sense of doing something But ultimately it’s pointless. 
  • 31. Refactoring to Make Abstract #1
  • 32. Refactoring to Make Abstract #2
  • 33. Refactoring to Make Abstract #2
  • 34. Refactoring to Make Abstract #3
  • 35. Can Tooling Help me? Yes, in the following ways Refactoring can be repetitive Repetitive tasks bore humans Resulting in mistakes Solutions can contain many projects Many classes with many projects can contain the same method calls This makes them hard to find and easy to miss Tools can suggest refactors that you might not know exist.
  • 41. Summary Refactoring is changing the structure, but not the functionality of your application Refactoring is done to pay back the “Technical Debt” Refactor by asking is your code Readable Abstract Invest in some tooling.
  • 42. Further Reading Fowler, Martin (1999). Refactoring. Improving the Design of Existing Code. Addison-Wesley. ISBN 0-201-48567-2.  Wake, William C. (2003). Refactoring Workbook. Addison-Wesley. ISBN 0-321-10929-5.  Feathers, Michael C (2004). Working Effectively with Legacy Code. Prentice Hall. ISBN 0-13-117705-2.  Kerievsky, Joshua (2004). Refactoring To Patterns. Addison-Wesley. ISBN 0-321-21335-1.  Arsenovski, Danijel (2008). Professional Refactoring in Visual Basic. Wrox. ISBN 0-47-017979-1. 
  • 43. Questions http://www.garyshort.org http://www.twitter.com/garyshort http://www.sodthis.com gary@garyshort.org

Notas do Editor

  1. Constructor Chaining
  2. Compose Method
  3. If / case statement to polymorphism