SlideShare une entreprise Scribd logo
1  sur  20
Working with
legacy code
GUNNAR PEIPMAN, ASP.NET/IIS MVP
About me
 Name: Gunnar Peipman
 Job: Chief Everything Officer
 Company: Peipman Consult Ltd
 Hobbies: Coding, reading, travelling, beers
 In family: boyfriend, step father and father
 Animals: white fluffy bunny
 Me & MS: ASP.NET/IIS MVP, blogger, speaker
 Community: ENETA (www.eneta.ee)
 http://weblogs.asp.net/gunnarpeipman/
 E-mail: me@gunnarpeipman.com
Agenda
 What is legacy code and where it comes from?
 How to fight back?
 Tools and techniques
 Examples
 Questions and answers
Essentials of legacy code
What is legacy code?
 The code we already released to users
 Code covered with no tests
 Messy code
LEGACY CODE
messyconfusing
bad dependencies
hard to read spaghetti
untestable
ugly
don‘t touch it
in production
undocumented
tricky
problematic
just works
Where legacy code comes from?
 Death march projects
 Unskilled developers
 Impossible dead-lines
 Bleeding-edge technologies
 Complex technologies
 Silver-bullet tools
 Digital slavery
Dynamics of legacy code
All problems happen every day with
small steps under our own eyes
War plan
How to fight back?
 Write readable code
 Write testable code
 Refactor
 Avoid hacks
 Look how others have solved similar problems
 Study different patterns
 Improve your coding skills
 If you find mess then clean it up
Process for single developers
Find mess
Investigate
RefactorRedesign
Validate
Process for teams
Code
review
Detect
problems
Agree on
solutions
Redesign
code
Validate
Winning the battle
Refactoring
 Refactoring - making changes that doesn’t
change code functionality
 Different tools provided by IDE-s
Patterns
 Design patterns
 Unit testing patterns
 Analysis patterns
 Enterprise applications architecture patterns
 Enterprise integration patterns
 SOA patterns
 Universal data models
Testing
 Unit tests
 Integration tests
 Stress tests
 Performance tests
 User Interface tests
 Database tests
 Acceptance tests
 Tracer bullet tests
Quality assurance
 Automated and manual testing
 Code reviews
 Paired programming
 Set up goals for developers
Examples
Thank you!
Q&A

Contenu connexe

Plus de Gunnar Peipman

Plus de Gunnar Peipman (9)

Multi-tenant web applications with ASP.NET Core
Multi-tenant web applications with ASP.NET CoreMulti-tenant web applications with ASP.NET Core
Multi-tenant web applications with ASP.NET Core
 
Brewing Eisbock with Raspberry PI and Windows 10 IoT
Brewing Eisbock with Raspberry PI and Windows 10 IoTBrewing Eisbock with Raspberry PI and Windows 10 IoT
Brewing Eisbock with Raspberry PI and Windows 10 IoT
 
Deep-Dive to Azure Search
Deep-Dive to Azure SearchDeep-Dive to Azure Search
Deep-Dive to Azure Search
 
Deep-Dive to Application Insights
Deep-Dive to Application Insights Deep-Dive to Application Insights
Deep-Dive to Application Insights
 
Porting ASP.NET applications to Windows Azure
Porting ASP.NET applications to Windows AzurePorting ASP.NET applications to Windows Azure
Porting ASP.NET applications to Windows Azure
 
ASP.NET MVC 4 Overview
ASP.NET MVC 4 OverviewASP.NET MVC 4 Overview
ASP.NET MVC 4 Overview
 
Building SharePoint Online applications using Napa Office 365 Development Tools
Building SharePoint Online applications using Napa Office 365 Development ToolsBuilding SharePoint Online applications using Napa Office 365 Development Tools
Building SharePoint Online applications using Napa Office 365 Development Tools
 
Optimizing public facing SharePoint sites
Optimizing public facing SharePoint sitesOptimizing public facing SharePoint sites
Optimizing public facing SharePoint sites
 
Architecting ASP.NET MVC Applications
Architecting ASP.NET MVC ApplicationsArchitecting ASP.NET MVC Applications
Architecting ASP.NET MVC Applications
 

Dernier

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Dernier (20)

ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Cyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdfCyberprint. Dark Pink Apt Group [EN].pdf
Cyberprint. Dark Pink Apt Group [EN].pdf
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
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
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 

Working with legacy code

  • 1. Working with legacy code GUNNAR PEIPMAN, ASP.NET/IIS MVP
  • 2. About me  Name: Gunnar Peipman  Job: Chief Everything Officer  Company: Peipman Consult Ltd  Hobbies: Coding, reading, travelling, beers  In family: boyfriend, step father and father  Animals: white fluffy bunny  Me & MS: ASP.NET/IIS MVP, blogger, speaker  Community: ENETA (www.eneta.ee)  http://weblogs.asp.net/gunnarpeipman/  E-mail: me@gunnarpeipman.com
  • 3. Agenda  What is legacy code and where it comes from?  How to fight back?  Tools and techniques  Examples  Questions and answers
  • 5. What is legacy code?  The code we already released to users  Code covered with no tests  Messy code
  • 6. LEGACY CODE messyconfusing bad dependencies hard to read spaghetti untestable ugly don‘t touch it in production undocumented tricky problematic just works
  • 7. Where legacy code comes from?  Death march projects  Unskilled developers  Impossible dead-lines  Bleeding-edge technologies  Complex technologies  Silver-bullet tools  Digital slavery
  • 8. Dynamics of legacy code All problems happen every day with small steps under our own eyes
  • 10. How to fight back?  Write readable code  Write testable code  Refactor  Avoid hacks  Look how others have solved similar problems  Study different patterns  Improve your coding skills  If you find mess then clean it up
  • 11. Process for single developers Find mess Investigate RefactorRedesign Validate
  • 12. Process for teams Code review Detect problems Agree on solutions Redesign code Validate
  • 14. Refactoring  Refactoring - making changes that doesn’t change code functionality  Different tools provided by IDE-s
  • 15. Patterns  Design patterns  Unit testing patterns  Analysis patterns  Enterprise applications architecture patterns  Enterprise integration patterns  SOA patterns  Universal data models
  • 16. Testing  Unit tests  Integration tests  Stress tests  Performance tests  User Interface tests  Database tests  Acceptance tests  Tracer bullet tests
  • 17. Quality assurance  Automated and manual testing  Code reviews  Paired programming  Set up goals for developers
  • 20. Q&A