SlideShare uma empresa Scribd logo
1 de 106
MUD TIRES: GETTING
TRACTION IN LEGACY CODE
                                     o r y_  f oy
  Cory Foy                       @ c                i ve s .c om
  Senior Consultant                   e tob  je c t
  Net Objectives          y.f o y@n                 f oy .c om
                      cor             lo g. cor y
                        ht    p:/ b
                            t /

                                      http://www.flickr.com/photos/or4n6e/4827075541
http://www.flickr.com/photos/countylemonade/5417832718
WHAT IS LEGACY CODE?
WHAT IS LEGACY CODE?

• Code   we’ve gotten from somewhere else
WHAT IS LEGACY CODE?

• Code   we’ve gotten from somewhere else

• Code   we have to change, but don’t understand
WHAT IS LEGACY CODE?

• Code   we’ve gotten from somewhere else

• Code   we have to change, but don’t understand

• Demoralizing   Code (Big Ball of Mud)
WHAT IS LEGACY CODE?

• Code   we’ve gotten from somewhere else

• Code   we have to change, but don’t understand

• Demoralizing   Code (Big Ball of Mud)

• Code   without automated unit tests
WHAT IS LEGACY CODE?

• Code   we’ve gotten from somewhere else

• Code   we have to change, but don’t understand

• Demoralizing   Code (Big Ball of Mud)

• Code   without automated unit tests

• Any   code older than about 2 hours
http://www.flickr.com/photos/futureshape/2614476028
Preparing
 to Add
Behavior
Adding
            Behavior

Preparing
 to Add
Behavior
Adding
            Behavior

Preparing
                       Removing
 to Add
                       Duplication
Behavior
Cleaning
            Technical
              Debt




             Adding
            Behavior

Preparing
                        Removing
 to Add
                        Duplication
Behavior
Cleaning
            Technical
              Debt




             Adding
            Behavior

Preparing
                        Removing
 to Add
                        Duplication
Behavior
Cleaning
                       Technical
                         Debt




                        Adding
                       Behavior

    Preparing
                                   Removing
     to Add
                                   Duplication
    Behavior


 r e f ac t o r i ng
P
Cleaning
                      Technical
                        Debt




                       Adding
                      Behavior

 Preparing
                                     Removing
  to Add
                                     Duplication
 Behavior

           o r i ng               Re f ac t
Pre f ac t                                    o r i ng
R e mo d e li ng   Cleaning
                              Technical
                                Debt




                               Adding
                              Behavior

 Preparing
                                             Removing
  to Add
                                             Duplication
 Behavior

           o r i ng                       Re f ac t
Pre f ac t                                            o r i ng
R e mo d e li ng   Cleaning
                              Technical
                                Debt



                                          Coding
                               Adding
                              Behavior

 Preparing
                                                      Removing
  to Add
                                                      Duplication
 Behavior

           o r i ng                                Re f ac t
Pre f ac t                                                     o r i ng
http://www.flickr.com/photos/marcwathieu/4074508950
Tools

   Strategies

        Approaches




                 http://www.flickr.com/photos/marcwathieu/4074508950
http://www.flickr.com/photos/pitel/1406292257
http://www.flickr.com/photos/pitel/1406292257
http://www.flickr.com/photos/pitel/1406292257
http://www.flickr.com/photos/pitel/1406292257
http://www.flickr.com/photos/pitel/1406292257
http://www.flickr.com/photos/pitel/1406292257
http://www.flickr.com/photos/pitel/1406292257
http://www.flickr.com/photos/pitel/1406292257
ra te g ie s
St                                 Naked CRC

  Acceptance Test-Driven Development

                    Test-Driven Development

      Refactoring                        Tell the Story

                      Pair Programming


Sensing Variables                Characterization Tests
ra te g ie s
St                                 Naked CRC

  Acceptance Test-Driven Development

                    Test-Driven Development

      Refactoring                        Tell the Story

                      Pair Programming


Sensing Variables                Characterization Tests
ra te g ie s
St
   Making Changes
  Acceptance Test-Driven Development
  Test-Driven Development
  Refactoring
                           Gaining Understanding
                           Tell the Story
Increasing Confidence       Naked CRC
Pair Programming
Characterization Tests
Sensing Variables
Tell the Story
      Naked CRC

http://www.flickr.com/photos/ransomtech/5811447011
Tell the Story
Naked CRC
Increasing Confidence




  Sensing Variables
Characterization Tests
 Pair Programming

                         http://www.flickr.com/photos/west_point/5863829218
Sensing Variables




http://www.artima.com/weblogs/viewpost.jsp?thread=170799
Sensing Variables




http://www.artima.com/weblogs/viewpost.jsp?thread=170799
Sensing Variables




http://www.artima.com/weblogs/viewpost.jsp?thread=170799
Characterization Tests




http://www.artima.com/weblogs/viewpost.jsp?thread=170799
Characterization Tests




http://www.artima.com/weblogs/viewpost.jsp?thread=170799
Characterization Tests




http://www.artima.com/weblogs/viewpost.jsp?thread=170799
You need to                                         ATDD
                                                        TDD
                                                     Refactoring




                                                    Chang
http://www.flickr.com/photos/slavin_fpo/3728404776
R e mo d e li ng   Cleaning
                              Technical
                                Debt



                                          Coding
                               Adding
                              Behavior

 Preparing
                                                      Removing
  to Add
                                                      Duplication
 Behavior

           o r i ng                                Re f ac t
Pre f ac t                                                     o r i ng
R e mo d e li ng   Cleaning                ATDD
                              Technical
                                Debt



                                          Coding
                               Adding
                              Behavior

 Preparing
                                                      Removing
  to Add
                                                      Duplication
 Behavior

           o r i ng                                Re f ac t
Pre f ac t                                                     o r i ng
R e mo d e li ng   Cleaning                ATDD
                              Technical                TDD
                                Debt



                                          Coding
                               Adding
                              Behavior

 Preparing
                                                      Removing
  to Add
                                                      Duplication
 Behavior

           o r i ng                                Re f ac t
Pre f ac t                                                     o r i ng
R e mo d e li ng   Cleaning               ATDD
                              Technical               TDD
                                Debt
                                                   Refactoring


                                          Coding
                               Adding
                              Behavior

 Preparing
                                                      Removing
  to Add
                                                      Duplication
 Behavior

           o r i ng                                Re f ac t
Pre f ac t                                                     o r i ng
Example: Acceptance TDD
 Basic Employee Compensation
 Each week, hourly employees are paid
   • A standard wage per hour for the first 40 hours worked
   • 1.5 times their wage for each hour after the first 40 hours
   • 2 times their wage for each hour worked on Sundays and holidays
Example: Acceptance TDD
 Basic Employee Compensation
 Each week, hourly employees are paid
   • A standard wage per hour for the first 40 hours worked
   • 1.5 times their wage for each hour after the first 40 hours
   • 2 times their wage for each hour worked on Sundays and holidays


        Payroll.Fixtures.WeeklyCompensation
            Standard Hol/Sun                   Wage         Pay()
               Hours   Hours
                    40               0          20
                    45               0          20
                    48               8          20
Example: Acceptance TDD
 Basic Employee Compensation
 Each week, hourly employees are paid
   • A standard wage per hour for the first 40 hours worked
   • 1.5 times their wage for each hour after the first 40 hours
   • 2 times their wage for each hour worked on Sundays and holidays


        Payroll.Fixtures.WeeklyCompensation
            Standard Hol/Sun                   Wage         Pay()
               Hours   Hours
                    40               0          20        $800
                    45               0          20        $950
                    48               8          20 $1520
http://www.fitnesse.org
http://www.fitnesse.org
http://www.fitnesse.org
http://www.fitnesse.org
A test is not a unit test if:
- It talks to the database
- It communicates across the network
- It touches the file system
- It can't run at the same time as any of your other
unit tests
- You have to do special things to your environment
(such as editing config files) to run it.
http://vinkamat.com/2011/tdd-unit-testing-and-benefits/
Red




http://vinkamat.com/2011/tdd-unit-testing-and-benefits/
Red



Green




http://vinkamat.com/2011/tdd-unit-testing-and-benefits/
Red



Green




Refactor

http://vinkamat.com/2011/tdd-unit-testing-and-benefits/
(Refactoring is a) disciplined technique for
restructuring an existing body of code, altering
its internal structure without changing its
external behavior
Feather’s Approach
 ATDD Approach
   Edit and Pray




                     http://www.flickr.com/photos/phluke/62175794
Feather’s Approach
Feather’s Approach
Identify
Change
 Points
Feather’s Approach
Identify
Change
 Points




Find Test
  Points
Feather’s Approach
Identify
Change
 Points




Find Test
  Points




    Break
 Dependencie
      s
Feather’s Approach
Identify
Change                Write
 Points               Tests




Find Test
  Points




    Break
 Dependencie
      s
Feather’s Approach
Identify
Change                Write
 Points               Tests




Find Test
  Points           Make
                  Changes



    Break
 Dependencie
      s
Feather’s Approach
Identify
Change                Write
 Points               Tests




Find Test
  Points           Make
                  Changes



    Break
 Dependencie        Refactor
      s
ATDD Approach
Write     ATDD Approach
Acceptance
   Tests
Write                        ATDD Approach
Acceptance
   Tests          Write
             Characterization
                  Tests
Write                           ATDD Approach
Acceptance
   Tests             Write
                Characterization
                     Tests




    Implement
     Behavior
Write                              ATDD Approach
Acceptance
   Tests             Write
                Characterization
                     Tests




    Implement
     Behavior
                   Get All Tests to
                        Pass
Write                              ATDD Approach
Acceptance
   Tests             Write
                Characterization
                     Tests


                                        Celebrate!



    Implement
     Behavior
                   Get All Tests to
                        Pass
Write                              ATDD Approach
Acceptance
   Tests             Write
                Characterization
                     Tests


                                        Celebrate!



    Implement
     Behavior
                   Get All Tests to
                        Pass
Write                              ATDD Approach
Acceptance
   Tests             Write
                Characterization
                     Tests


                                        Celebrate!



    Implement
     Behavior
                   Get All Tests to
                        Pass
Write                              ATDD Approach
Acceptance
   Tests             Write
                Characterization
                     Tests


                                        Celebrate!



    Implement
     Behavior
                   Get All Tests to
                        Pass
e fe re n ce s
R




Cory Foy
foyc@coryfoy.com
@cory_foy
cory.foy@netobjectives.com   http://www.flickr.com/photos/or4n6e/4827075541

Mais conteúdo relacionado

Semelhante a Mud Tires: Getting Traction in Legacy Code

Testing Rich Domain Models
Testing Rich Domain ModelsTesting Rich Domain Models
Testing Rich Domain ModelsChris Richardson
 
20110507 Implementing Continuous Deployment
20110507 Implementing Continuous Deployment20110507 Implementing Continuous Deployment
20110507 Implementing Continuous DeploymentXebiaLabs
 
IdealECP presentation for Novo Nordisk
IdealECP presentation for Novo NordiskIdealECP presentation for Novo Nordisk
IdealECP presentation for Novo Nordiskcbiddle2
 
Exploiting Tools for Faster, More Acceptable Process Improvement Initiatives
Exploiting Tools for Faster, More Acceptable Process Improvement InitiativesExploiting Tools for Faster, More Acceptable Process Improvement Initiatives
Exploiting Tools for Faster, More Acceptable Process Improvement InitiativesMahesh Singh
 
Deploying Functional Qualification at STMicroelectronics
Deploying Functional Qualification at STMicroelectronicsDeploying Functional Qualification at STMicroelectronics
Deploying Functional Qualification at STMicroelectronicsDVClub
 
Approximate Semantic Matching of Heterogeneous Events
Approximate Semantic Matching of Heterogeneous EventsApproximate Semantic Matching of Heterogeneous Events
Approximate Semantic Matching of Heterogeneous EventsEdward Curry
 
Fact2009 How To Operationalize Your Strategies
Fact2009 How To Operationalize Your StrategiesFact2009 How To Operationalize Your Strategies
Fact2009 How To Operationalize Your Strategiessyosko
 
SharePoint 2010 overview
SharePoint 2010 overviewSharePoint 2010 overview
SharePoint 2010 overviewSentri
 
Regulatory Considerations for use of Cloud Computing and SaaS Environments
Regulatory Considerations for use of Cloud Computing and SaaS EnvironmentsRegulatory Considerations for use of Cloud Computing and SaaS Environments
Regulatory Considerations for use of Cloud Computing and SaaS EnvironmentsInstitute of Validation Technology
 
Forchu Teck Technology Collaboration Profile
Forchu Teck Technology Collaboration ProfileForchu Teck Technology Collaboration Profile
Forchu Teck Technology Collaboration ProfileCharles Forchu
 
Incident Management in the Age of DevOps and SRE
Incident Management in the Age of DevOps and SRE Incident Management in the Age of DevOps and SRE
Incident Management in the Age of DevOps and SRE Rundeck
 
Team Developpement with Mercurial - april 2011
Team Developpement with Mercurial - april 2011Team Developpement with Mercurial - april 2011
Team Developpement with Mercurial - april 2011Logilab
 
Top things to consider when building your outsourcing strategy
Top things to consider when building your outsourcing strategyTop things to consider when building your outsourcing strategy
Top things to consider when building your outsourcing strategyraulzamorano
 
Pulse 2013: DevOps Review and Roadmap
Pulse 2013: DevOps Review and RoadmapPulse 2013: DevOps Review and Roadmap
Pulse 2013: DevOps Review and RoadmapDaniel Berg
 
Learn the facts about replication in mainframe storage webinar
Learn the facts about replication in mainframe storage webinarLearn the facts about replication in mainframe storage webinar
Learn the facts about replication in mainframe storage webinarHitachi Vantara
 
100% R and More: Plus What's New in Revolution R Enterprise 6.0
100% R and More: Plus What's New in Revolution R Enterprise 6.0100% R and More: Plus What's New in Revolution R Enterprise 6.0
100% R and More: Plus What's New in Revolution R Enterprise 6.0Revolution Analytics
 

Semelhante a Mud Tires: Getting Traction in Legacy Code (20)

Testing Rich Domain Models
Testing Rich Domain ModelsTesting Rich Domain Models
Testing Rich Domain Models
 
20110507 Implementing Continuous Deployment
20110507 Implementing Continuous Deployment20110507 Implementing Continuous Deployment
20110507 Implementing Continuous Deployment
 
Sipoc
SipocSipoc
Sipoc
 
IdealECP presentation for Novo Nordisk
IdealECP presentation for Novo NordiskIdealECP presentation for Novo Nordisk
IdealECP presentation for Novo Nordisk
 
Exploiting Tools for Faster, More Acceptable Process Improvement Initiatives
Exploiting Tools for Faster, More Acceptable Process Improvement InitiativesExploiting Tools for Faster, More Acceptable Process Improvement Initiatives
Exploiting Tools for Faster, More Acceptable Process Improvement Initiatives
 
Benjamin q4 2008_bristol
Benjamin q4 2008_bristolBenjamin q4 2008_bristol
Benjamin q4 2008_bristol
 
Deploying Functional Qualification at STMicroelectronics
Deploying Functional Qualification at STMicroelectronicsDeploying Functional Qualification at STMicroelectronics
Deploying Functional Qualification at STMicroelectronics
 
Approximate Semantic Matching of Heterogeneous Events
Approximate Semantic Matching of Heterogeneous EventsApproximate Semantic Matching of Heterogeneous Events
Approximate Semantic Matching of Heterogeneous Events
 
Fact2009 How To Operationalize Your Strategies
Fact2009 How To Operationalize Your StrategiesFact2009 How To Operationalize Your Strategies
Fact2009 How To Operationalize Your Strategies
 
SharePoint 2010 overview
SharePoint 2010 overviewSharePoint 2010 overview
SharePoint 2010 overview
 
Uneecops Company Profile
Uneecops Company ProfileUneecops Company Profile
Uneecops Company Profile
 
Regulatory Considerations for use of Cloud Computing and SaaS Environments
Regulatory Considerations for use of Cloud Computing and SaaS EnvironmentsRegulatory Considerations for use of Cloud Computing and SaaS Environments
Regulatory Considerations for use of Cloud Computing and SaaS Environments
 
Forchu Teck Technology Collaboration Profile
Forchu Teck Technology Collaboration ProfileForchu Teck Technology Collaboration Profile
Forchu Teck Technology Collaboration Profile
 
Incident Management in the Age of DevOps and SRE
Incident Management in the Age of DevOps and SRE Incident Management in the Age of DevOps and SRE
Incident Management in the Age of DevOps and SRE
 
Team Developpement with Mercurial - april 2011
Team Developpement with Mercurial - april 2011Team Developpement with Mercurial - april 2011
Team Developpement with Mercurial - april 2011
 
How not to be a victim (of other peoples’ mistakes)
How not to be a victim (of other peoples’ mistakes)How not to be a victim (of other peoples’ mistakes)
How not to be a victim (of other peoples’ mistakes)
 
Top things to consider when building your outsourcing strategy
Top things to consider when building your outsourcing strategyTop things to consider when building your outsourcing strategy
Top things to consider when building your outsourcing strategy
 
Pulse 2013: DevOps Review and Roadmap
Pulse 2013: DevOps Review and RoadmapPulse 2013: DevOps Review and Roadmap
Pulse 2013: DevOps Review and Roadmap
 
Learn the facts about replication in mainframe storage webinar
Learn the facts about replication in mainframe storage webinarLearn the facts about replication in mainframe storage webinar
Learn the facts about replication in mainframe storage webinar
 
100% R and More: Plus What's New in Revolution R Enterprise 6.0
100% R and More: Plus What's New in Revolution R Enterprise 6.0100% R and More: Plus What's New in Revolution R Enterprise 6.0
100% R and More: Plus What's New in Revolution R Enterprise 6.0
 

Mais de Cory Foy

Defending Commoditization: Mapping Gameplays and Strategies to Stay Ahead in ...
Defending Commoditization: Mapping Gameplays and Strategies to Stay Ahead in ...Defending Commoditization: Mapping Gameplays and Strategies to Stay Ahead in ...
Defending Commoditization: Mapping Gameplays and Strategies to Stay Ahead in ...Cory Foy
 
Stratgic Play - Doing the Right Thing at the Right Time
Stratgic Play - Doing the Right Thing at the Right TimeStratgic Play - Doing the Right Thing at the Right Time
Stratgic Play - Doing the Right Thing at the Right TimeCory Foy
 
Continuous Deployment and Testing Workshop from Better Software West
Continuous Deployment and Testing Workshop from Better Software WestContinuous Deployment and Testing Workshop from Better Software West
Continuous Deployment and Testing Workshop from Better Software WestCory Foy
 
Choosing Between Scrum and Kanban - TriAgile 2015
Choosing Between Scrum and Kanban - TriAgile 2015Choosing Between Scrum and Kanban - TriAgile 2015
Choosing Between Scrum and Kanban - TriAgile 2015Cory Foy
 
Code Katas
Code KatasCode Katas
Code KatasCory Foy
 
Distributed Agility
Distributed AgilityDistributed Agility
Distributed AgilityCory Foy
 
Scaling Agility
Scaling AgilityScaling Agility
Scaling AgilityCory Foy
 
Kanban for DevOps
Kanban for DevOpsKanban for DevOps
Kanban for DevOpsCory Foy
 
Ruby and OO for Beginners
Ruby and OO for BeginnersRuby and OO for Beginners
Ruby and OO for BeginnersCory Foy
 
Agile Roots: The Agile Mindset - Agility Across the Organization
Agile Roots: The Agile Mindset - Agility Across the OrganizationAgile Roots: The Agile Mindset - Agility Across the Organization
Agile Roots: The Agile Mindset - Agility Across the OrganizationCory Foy
 
Triangle.rb - How Secure is Your Rails Site, Anyway?
Triangle.rb - How Secure is Your Rails Site, Anyway?Triangle.rb - How Secure is Your Rails Site, Anyway?
Triangle.rb - How Secure is Your Rails Site, Anyway?Cory Foy
 
Scrum vs Kanban - Implementing Agility at Scale
Scrum vs Kanban - Implementing Agility at ScaleScrum vs Kanban - Implementing Agility at Scale
Scrum vs Kanban - Implementing Agility at ScaleCory Foy
 
SQE Boston - When Code Cries
SQE Boston - When Code CriesSQE Boston - When Code Cries
SQE Boston - When Code CriesCory Foy
 
GOTO Berlin - When Code Cries
GOTO Berlin - When Code CriesGOTO Berlin - When Code Cries
GOTO Berlin - When Code CriesCory Foy
 
Rails as a Pattern Language
Rails as a Pattern LanguageRails as a Pattern Language
Rails as a Pattern LanguageCory Foy
 
Patterns in Rails
Patterns in RailsPatterns in Rails
Patterns in RailsCory Foy
 
Agile Demystified
Agile DemystifiedAgile Demystified
Agile DemystifiedCory Foy
 
When Code Cries
When Code CriesWhen Code Cries
When Code CriesCory Foy
 
Ruby for C# Developers
Ruby for C# DevelopersRuby for C# Developers
Ruby for C# DevelopersCory Foy
 
Getting Unstuck: Working with Legacy Code and Data
Getting Unstuck: Working with Legacy Code and DataGetting Unstuck: Working with Legacy Code and Data
Getting Unstuck: Working with Legacy Code and DataCory Foy
 

Mais de Cory Foy (20)

Defending Commoditization: Mapping Gameplays and Strategies to Stay Ahead in ...
Defending Commoditization: Mapping Gameplays and Strategies to Stay Ahead in ...Defending Commoditization: Mapping Gameplays and Strategies to Stay Ahead in ...
Defending Commoditization: Mapping Gameplays and Strategies to Stay Ahead in ...
 
Stratgic Play - Doing the Right Thing at the Right Time
Stratgic Play - Doing the Right Thing at the Right TimeStratgic Play - Doing the Right Thing at the Right Time
Stratgic Play - Doing the Right Thing at the Right Time
 
Continuous Deployment and Testing Workshop from Better Software West
Continuous Deployment and Testing Workshop from Better Software WestContinuous Deployment and Testing Workshop from Better Software West
Continuous Deployment and Testing Workshop from Better Software West
 
Choosing Between Scrum and Kanban - TriAgile 2015
Choosing Between Scrum and Kanban - TriAgile 2015Choosing Between Scrum and Kanban - TriAgile 2015
Choosing Between Scrum and Kanban - TriAgile 2015
 
Code Katas
Code KatasCode Katas
Code Katas
 
Distributed Agility
Distributed AgilityDistributed Agility
Distributed Agility
 
Scaling Agility
Scaling AgilityScaling Agility
Scaling Agility
 
Kanban for DevOps
Kanban for DevOpsKanban for DevOps
Kanban for DevOps
 
Ruby and OO for Beginners
Ruby and OO for BeginnersRuby and OO for Beginners
Ruby and OO for Beginners
 
Agile Roots: The Agile Mindset - Agility Across the Organization
Agile Roots: The Agile Mindset - Agility Across the OrganizationAgile Roots: The Agile Mindset - Agility Across the Organization
Agile Roots: The Agile Mindset - Agility Across the Organization
 
Triangle.rb - How Secure is Your Rails Site, Anyway?
Triangle.rb - How Secure is Your Rails Site, Anyway?Triangle.rb - How Secure is Your Rails Site, Anyway?
Triangle.rb - How Secure is Your Rails Site, Anyway?
 
Scrum vs Kanban - Implementing Agility at Scale
Scrum vs Kanban - Implementing Agility at ScaleScrum vs Kanban - Implementing Agility at Scale
Scrum vs Kanban - Implementing Agility at Scale
 
SQE Boston - When Code Cries
SQE Boston - When Code CriesSQE Boston - When Code Cries
SQE Boston - When Code Cries
 
GOTO Berlin - When Code Cries
GOTO Berlin - When Code CriesGOTO Berlin - When Code Cries
GOTO Berlin - When Code Cries
 
Rails as a Pattern Language
Rails as a Pattern LanguageRails as a Pattern Language
Rails as a Pattern Language
 
Patterns in Rails
Patterns in RailsPatterns in Rails
Patterns in Rails
 
Agile Demystified
Agile DemystifiedAgile Demystified
Agile Demystified
 
When Code Cries
When Code CriesWhen Code Cries
When Code Cries
 
Ruby for C# Developers
Ruby for C# DevelopersRuby for C# Developers
Ruby for C# Developers
 
Getting Unstuck: Working with Legacy Code and Data
Getting Unstuck: Working with Legacy Code and DataGetting Unstuck: Working with Legacy Code and Data
Getting Unstuck: Working with Legacy Code and Data
 

Último

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 Processorsdebabhi2
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
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.pdfsudhanshuwaghmare1
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
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 organizationRadu Cotescu
 
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?Antenna Manufacturer Coco
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
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 CVKhem
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
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 BusinessPixlogix Infotech
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
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...Enterprise Knowledge
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 

Último (20)

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
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
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
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
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
 
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?
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
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
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
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
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
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...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 

Mud Tires: Getting Traction in Legacy Code

Notas do Editor

  1. \n
  2. What is legacy code? (Get answers from audience)\n
  3. But the key attribute between all of these is that we have to...\n
  4. But the key attribute between all of these is that we have to...\n
  5. But the key attribute between all of these is that we have to...\n
  6. But the key attribute between all of these is that we have to...\n
  7. But the key attribute between all of these is that we have to...\n
  8. Have to preserve behavior. If we aren’t preserving behavior, we are just rewriting, and can follow the rules of writing new, clean code. Or we can just delete it (negative KLOC metrics, anyone?). But eventually we have to do something with it\n
  9. The four main things are these. Event driven (making a change because of new behavior) vs investment driven (cleaning tech debt)\n
  10. The four main things are these. Event driven (making a change because of new behavior) vs investment driven (cleaning tech debt)\n
  11. The four main things are these. Event driven (making a change because of new behavior) vs investment driven (cleaning tech debt)\n
  12. The four main things are these. Event driven (making a change because of new behavior) vs investment driven (cleaning tech debt)\n
  13. The four main things are these. Event driven (making a change because of new behavior) vs investment driven (cleaning tech debt)\n
  14. The four main things are these. Event driven (making a change because of new behavior) vs investment driven (cleaning tech debt)\n
  15. We can label them like this. Refactoring has gotten a bad name - if we are making big changes, we are remodeling, not refactoring. No matter which thing we are choosing, we have to follow the guiding principle of legacy code\n
  16. We can label them like this. Refactoring has gotten a bad name - if we are making big changes, we are remodeling, not refactoring. No matter which thing we are choosing, we have to follow the guiding principle of legacy code\n
  17. We can label them like this. Refactoring has gotten a bad name - if we are making big changes, we are remodeling, not refactoring. No matter which thing we are choosing, we have to follow the guiding principle of legacy code\n
  18. We can label them like this. Refactoring has gotten a bad name - if we are making big changes, we are remodeling, not refactoring. No matter which thing we are choosing, we have to follow the guiding principle of legacy code\n
  19. Which is to keep the system running at all times. To do this, we have to treat everything as a series of small changes, or refactorings, to get us to where we want to go\n
  20. To do *that* we need three things.\n
  21. To do *that* we need three things.\n
  22. To do *that* we need three things.\n
  23. Resharper, Cucumber, FitNesse, TeamCity, NUnit/JUnit/PHPUnit. Demo the tools\n
  24. Resharper, Cucumber, FitNesse, TeamCity, NUnit/JUnit/PHPUnit. Demo the tools\n
  25. Resharper, Cucumber, FitNesse, TeamCity, NUnit/JUnit/PHPUnit. Demo the tools\n
  26. Resharper, Cucumber, FitNesse, TeamCity, NUnit/JUnit/PHPUnit. Demo the tools\n
  27. Resharper, Cucumber, FitNesse, TeamCity, NUnit/JUnit/PHPUnit. Demo the tools\n
  28. Resharper, Cucumber, FitNesse, TeamCity, NUnit/JUnit/PHPUnit. Demo the tools\n
  29. Resharper, Cucumber, FitNesse, TeamCity, NUnit/JUnit/PHPUnit. Demo the tools\n
  30. Resharper, Cucumber, FitNesse, TeamCity, NUnit/JUnit/PHPUnit. Demo the tools\n
  31. Resharper. The heavyweight of refactoring tools for .NET. \n
  32. Resharper. The heavyweight of refactoring tools for .NET. \n
  33. Resharper. The heavyweight of refactoring tools for .NET. \n
  34. TeamCity - for Continuously insuring the code is buildable\n
  35. NUnit and unit testing tools for writing automated unit tests (and TD.NET for running in VS)\n
  36. Cucumber for communicating with the non-technical members\n
  37. FitNesse is another way of communicating with non-technical users. Tools are great, but not by themselves. You need strategies for using them.\n
  38. There are lots and lots of strategies available\n
  39. There are lots and lots of strategies available\n
  40. There are lots and lots of strategies available\n
  41. There are lots and lots of strategies available\n
  42. There are lots and lots of strategies available\n
  43. There are lots and lots of strategies available\n
  44. There are lots and lots of strategies available\n
  45. There are lots and lots of strategies available\n
  46. There are lots and lots of strategies available\n
  47. There are lots and lots of strategies available\n
  48. But we can categorize them into three broad areas - Gaining Understanding, Increasing Confidence and Making Changes\n
  49. But we can categorize them into three broad areas - Gaining Understanding, Increasing Confidence and Making Changes\n
  50. But we can categorize them into three broad areas - Gaining Understanding, Increasing Confidence and Making Changes\n
  51. But we can categorize them into three broad areas - Gaining Understanding, Increasing Confidence and Making Changes\n
  52. But we can categorize them into three broad areas - Gaining Understanding, Increasing Confidence and Making Changes\n
  53. But we can categorize them into three broad areas - Gaining Understanding, Increasing Confidence and Making Changes\n
  54. But we can categorize them into three broad areas - Gaining Understanding, Increasing Confidence and Making Changes\n
  55. But we can categorize them into three broad areas - Gaining Understanding, Increasing Confidence and Making Changes\n
  56. But we can categorize them into three broad areas - Gaining Understanding, Increasing Confidence and Making Changes\n
  57. But we can categorize them into three broad areas - Gaining Understanding, Increasing Confidence and Making Changes\n
  58. Gaining Understanding. Tell the Story, Naked CRC. Let’s apply these to two pieces of legacy code.\n
  59. Tell a story (or pick an example from the audience)\n
  60. Naked CRC. Class Responsibility Collaboration (CRC) cards are a brainstorming tool used in the design of object-oriented software. They were proposed by Ward Cunningham and Kent Beck. [1] They are typically used when first determining which classes are needed and how they will interact.\nCRC cards are usually created from index cards on which are written:\nThe class name\nIts Super and Sub classes (if applicable)\nThe responsibilities of the class.\nThe names of other classes with which the class will collaborate to fulfill its responsibilities.\nAuthor\n Next is Increasing Confidence in making changes\n
  61. Characterization Tests, Sensing Variables, Pair Programming\n
  62. Sensing Variables and Characterization Tests (see the link at the bottom of the slide for more info)\n
  63. Sensing Variables and Characterization Tests (see the link at the bottom of the slide for more info)\n
  64. Note we could use a debugger, but this lets us come at it from different angles. We also won’t leave the variable in there long term - extract out the method, then test using that\n
  65. Note we could use a debugger, but this lets us come at it from different angles. We also won’t leave the variable in there long term - extract out the method, then test using that\n
  66. Pair Programming - Ping Pong Programming\n
  67. Old Pair Programming Setup\n
  68. Old Pair Programming Setup\n
  69. Next is making changes to the code base\n
  70. ATDD, TDD, Refactoring\n
  71. ATDD helps us prep and add behavior. TDD helps us Add behavior and prep to remove duplication. Refactoring helps us remove duplication\n
  72. ATDD helps us prep and add behavior. TDD helps us Add behavior and prep to remove duplication. Refactoring helps us remove duplication\n
  73. ATDD helps us prep and add behavior. TDD helps us Add behavior and prep to remove duplication. Refactoring helps us remove duplication\n
  74. ATDD helps us prep and add behavior. TDD helps us Add behavior and prep to remove duplication. Refactoring helps us remove duplication\n
  75. ATDD helps us prep and add behavior. TDD helps us Add behavior and prep to remove duplication. Refactoring helps us remove duplication\n
  76. ATDD helps us prep and add behavior. TDD helps us Add behavior and prep to remove duplication. Refactoring helps us remove duplication\n
  77. \n
  78. \n
  79. $800 for the first line is clear.\n$950 may not be clear, but it is 40 @ $20/hr + 5 @ $30/hr\nThe $1520 may not be clear. I could think: 40 @ $20/hr + 8 @ $30/hr + 8 * $40 = $1360. But that is wrong.\nThe 8 Holiday Hours get paid time and a half of double time. So it should be:\n 40 @ $20/hr + 8 @ $30/hr + 8 * $60 = $1520\n
  80. Write the Wiki Syntax\n
  81. Write some code to make it fail\n
  82. Write the code to make it pass\n
  83. Can be more natural language-ish\n
  84. To talk about TDD, we need to first talk about unit tests. This is Michael Feather’s definition.\n
  85. TDD\n
  86. TDD\n
  87. TDD\n
  88. TDD\n
  89. TDD\n
  90. TDD\n
  91. TDD example with Ruby and RSpec\n
  92. TDD example with Ruby and RSpec\n
  93. TDD example with Ruby and RSpec\n
  94. TDD example with Ruby and RSpec\n
  95. Martin Fowler’s definition of refactoring\n
  96. Refactorings available in Resharper, with common ones circled\n
  97. Refactorings available in Resharper, with common ones circled\n
  98. Refactorings available in Resharper, with common ones circled\n
  99. Refactorings available in Resharper, with common ones circled\n
  100. Approaches - Feather’s Change Approach, ATDD Approach, Edit and Pray\n
  101. Feather’s Change Approach: Identify Change Points, Find Test Points, Break Dependencies, Write Tests, Make Changes and Refactor\n
  102. Feather’s Change Approach: Identify Change Points, Find Test Points, Break Dependencies, Write Tests, Make Changes and Refactor\n
  103. Feather’s Change Approach: Identify Change Points, Find Test Points, Break Dependencies, Write Tests, Make Changes and Refactor\n
  104. Feather’s Change Approach: Identify Change Points, Find Test Points, Break Dependencies, Write Tests, Make Changes and Refactor\n
  105. Feather’s Change Approach: Identify Change Points, Find Test Points, Break Dependencies, Write Tests, Make Changes and Refactor\n
  106. Feather’s Change Approach: Identify Change Points, Find Test Points, Break Dependencies, Write Tests, Make Changes and Refactor\n
  107. ATDD Approach - Write Tests for the behavior you want. Write tests to characterize the current behavior. Use TDD to implement the new behavior until your acceptance tests pass.\n
  108. ATDD Approach - Write Tests for the behavior you want. Write tests to characterize the current behavior. Use TDD to implement the new behavior until your acceptance tests pass.\n
  109. ATDD Approach - Write Tests for the behavior you want. Write tests to characterize the current behavior. Use TDD to implement the new behavior until your acceptance tests pass.\n
  110. ATDD Approach - Write Tests for the behavior you want. Write tests to characterize the current behavior. Use TDD to implement the new behavior until your acceptance tests pass.\n
  111. ATDD Approach - Write Tests for the behavior you want. Write tests to characterize the current behavior. Use TDD to implement the new behavior until your acceptance tests pass.\n
  112. ATDD Approach - Write Tests for the behavior you want. Write tests to characterize the current behavior. Use TDD to implement the new behavior until your acceptance tests pass.\n
  113. ATDD Approach - Write Tests for the behavior you want. Write tests to characterize the current behavior. Use TDD to implement the new behavior until your acceptance tests pass.\n
  114. ATDD Approach - Write Tests for the behavior you want. Write tests to characterize the current behavior. Use TDD to implement the new behavior until your acceptance tests pass.\n
  115. ATDD Approach - Write Tests for the behavior you want. Write tests to characterize the current behavior. Use TDD to implement the new behavior until your acceptance tests pass.\n
  116. Edit and Pray\n
  117. \n