SlideShare ist ein Scribd-Unternehmen logo
1 von 49
Downloaden Sie, um offline zu lesen
HOW DO YOU HANDLE 
BIG REFACTORING WITH AGILE 
METHODOLOGIES? 
Luca Merolla
What is code refactoring?
CODE REFACTORING 
“Process to change the existing code without changing 
its external behavior. 
Refactoring improves nonfunctional attributes 
of the software”
Why we need code 
refactoring?
WHY REFACTORING? 
Some arguments : 
❏ Quality 
❏ Code Clean 
❏ Better Design 
❏ Right Thing
WHY REFACTORING? 
Some arguments : 
❏ Quality 
❏ Code Clean 
❏ Better Design 
❏ Right Thing 
Good Luck!
WHY REFACTORING? 
The only “sellable” reason to do refactoring is
WHY REFACTORING? 
The only “sellable” reason to do refactoring is
WHY REFACTORING? 
The only “sellable” reason to do refactoring is 
Save money Faster to deliver new 
functionalities
WHY REFACTORING?
When to do refactoring?
WHEN REFACTORING? 
Ideally, when we identify: 
❏ Code Smells: Things are not right 
❏ WTFs: Code is not understandable 
❏ It should be different: Product evolved
WHEN REFACTORING? 
Don’t clean up everything. 
It should be a constant and 
gradual improvement
WHEN REFACTORING? 
Keep the balance between: 
refactoring vs new features 
Don't refactor unless you think it will pay off later by 
allowing faster feature delivery
How to do refactoring? 
<
HOW TO REFACTOR? 
From the methodology point of view, my experience 
tells me that: 
❏ Revolutionary design is evil 
❏ Evolutionary design is good
HOW TO REFACTOR? 
The most common approaches about refactoring are: 
❏ “Big Bang” 
❏ “Divide and Conquer” 
❏ Planned refactoring
HOW TO REFACTOR? 
The “Big Bang” approach: 
❏ Define a new structure for your code 
❏ Move the code to the new structure 
❏ Rebuild the puzzle 
❏ Make tests green again!
HOW TO REFACTOR? 
The “Big Bang” approach: 
❏ Define a new structure for your code 
❏ Move the code to the new structure 
❏ Rebuild the puzzle 
❏ Make tests green again! 
❏ High risks! 
❏ Almost like rewrite from scratch
HOW TO REFACTOR? 
The “Divide and Conquer” approach: 
❏ Define a Vision 
❏ Break the application into pieces 
❏ Rebuild the puzzle 
❏ Make tests green again!
HOW TO REFACTOR? 
The “Divide and Conquer” approach: 
❏ Define a Vision 
❏ Break the application into pieces 
❏ Rebuild the puzzle 
❏ Make tests green again! 
❏ Difficult estimation (like bugs) 
❏ Code could be “undeliverable” for 
long period
HOW TO REFACTOR? 
Planned Refactoring also called as Stabilization 
periods: 
❏ No new features developed (Code freeze period) 
❏ Work without adding Value 
❏ Not an improvement for the customer
HOW TO REFACTOR? 
Planned Refactoring also called as Stabilization 
periods: 
❏ No new features developed (Code freeze period) 
❏ Work without adding Value 
❏ Not an improvement for the customer 
❏ It’s a Methodology Smell! 
❏ No real “value” added to the 
application
HOW TO REFACTOR? 
What a Good Team does is: 
❏ Define a Vision 
❏ Break it into smaller tasks 
❏ Refactoring all the time (part of regular work) 
❏ Responsible (Diligently keep the code clean)
HOW TO REFACTOR? 
What a Good Team does is: 
❏ Define a Vision 
❏ Break it into smaller tasks 
❏ Refactoring all the time (part of regular work) 
❏ Responsible (Diligently keep the code clean) 
❏ Code can be delivered (often) 
❏ New features benefits from the 
refactor (faster to develop)
How much refactoring should 
we be doing? 
<
HOW MUCH REFACTOR? 
We need to always consider the benefits of 
refactoring 
❏ Tolerance level (metrics could help) 
❏ Don’t clean up everything 
❏ Make refactoring part of our daily work 
❏ Multiple small improvements 
❏ Don’t refactor what is not likely to change 
❏ Consider the economic factor: 
Cleaner code ⇨ Quicker and Cheaper changes
How can we obtain 
Refactoring with Agile 
Methodologies?
AGILE & REFACTOR? 
Agile Methodologies focuses on continuous (or at 
least frequent) Value delivery. 
The Value (for the customer) is realized when the 
product is shipped in production, not before.
AGILE & REFACTOR? 
In order to use Agile Methodologies for big 
refactoring, we need to enforce some practices: 
❏ Define and communicate the Vision 
❏ Start with small tasks 
❏ Iterate and Learn
VISION 
Where to go MUST be clear.
Small Steps 
(Tasks) are 
easier to 
handle
Iterate and Learn 
throughout 
the process
Which Tools and Techniques 
should we use?
TOOLS & TECHNIQUES 
There are different tools and techniques that can help 
us to be more agile and deliver more often: 
❏ Trunk Based Development 
❏ Branch By Abstraction 
❏ Feature Toggles/Flags
What is Trunk Based 
Development?
TRUNK BASED DEV. 
Branches act as an Isolation from the “real world”.
TRUNK BASED DEV. 
Multi branches 
can make the 
code 
undeployable 
for long 
periods 
● Undeployable 
● Deployable
TRUNK BASED DEV. 
What is really wrong with Branches? 
❏ Branching is not bad, long lived branches are bad 
❏ “Isolation” for prolonged periods of time is bad 
❏ Multi-branches can lead to undeployable code
TRUNK BASED DEV. 
How does TBD look like?
TRUNK BASED DEV. 
What are the benefits of TBD? 
❏ Work on a single shared trunk 
❏ Always work against the latest code 
❏ Merge and integration pain is minimised 
Note: 
❏ TBD does not prohibit branching
TRUNK BASED DEV. 
F FIX TBD Optimistic Branching 
R D ? 
R RELEASED 
DEVELOPED NO COMMITS YET 
D ? 
209 210 211 TRUNK 
209.x 
FIX 
R 
209.1 
R D F 
? 
209 210 211 TRUNK
TRUNK BASED DEV. 
TBD Pessimistic Branching 
R RELEASED 
F FIX DEVELOPED NO COMMITS YET 
D ? 
209.x 
? 
R D ? 
209 210 211 TRUNK 
209.x 
R D 
R 
211.x 
? 
209 210 211 TRUNK 
209.x 
R D 
FIX 
R 
209.1 
F 
R 
211.x 
? 
209 210 211 TRUNK
What is Branch By Abstraction?
BRANCH BY ABSTRACTION 
1. Introduce an abstraction layer 
2. Update all the code to rely on the abstraction 
3. Make new implementation of the abstraction 
4. Remove the old implementation
BRANCH BY ABSTRACTION 
⇒ 
⇒
What are feature toggles/flags?
TOGGLES & FLAGS? 
What are the advantages of using Feature Toggles: 
❏ Decouples code deployment from feature 
❏ No need to rollback (disable the feature) 
❏ A/B testing 
❏ Deliver features to specific users only 
❏ Continuous delivery
THANK YOU! 
Questions? 
@lucamerolla

Weitere ähnliche Inhalte

Was ist angesagt?

TDD And Refactoring
TDD And RefactoringTDD And Refactoring
TDD And RefactoringNaresh Jain
 
Extreme Programming
Extreme ProgrammingExtreme Programming
Extreme ProgrammingKnoldus Inc.
 
TDD reloaded - JUGTAA 24 Ottobre 2012
TDD reloaded - JUGTAA 24 Ottobre 2012TDD reloaded - JUGTAA 24 Ottobre 2012
TDD reloaded - JUGTAA 24 Ottobre 2012Pietro Di Bello
 
Scrum and Test-driven development
Scrum and Test-driven developmentScrum and Test-driven development
Scrum and Test-driven developmenttoteb5
 
Agile Programming Systems # TDD intro
Agile Programming Systems # TDD introAgile Programming Systems # TDD intro
Agile Programming Systems # TDD introVitaliy Kulikov
 
Agile and ATDD the perfect couple
Agile and ATDD the perfect coupleAgile and ATDD the perfect couple
Agile and ATDD the perfect coupleStephen Tucker
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Developmentguestc8093a6
 
VT.NET 20160411: An Intro to Test Driven Development (TDD)
VT.NET 20160411: An Intro to Test Driven Development (TDD)VT.NET 20160411: An Intro to Test Driven Development (TDD)
VT.NET 20160411: An Intro to Test Driven Development (TDD)Rob Hale
 
Acceptance Test Driven Development
Acceptance Test Driven DevelopmentAcceptance Test Driven Development
Acceptance Test Driven DevelopmentMike Douglas
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven DevelopmentConsulthinkspa
 
Agile Test Driven Development
Agile Test Driven DevelopmentAgile Test Driven Development
Agile Test Driven DevelopmentViraf Karai
 
TDD - Test Driven Development
TDD - Test Driven DevelopmentTDD - Test Driven Development
TDD - Test Driven DevelopmentTung Nguyen Thanh
 
TDD and Simple Design Workshop - Session 1 - March 2019
TDD and Simple Design Workshop - Session 1 - March 2019TDD and Simple Design Workshop - Session 1 - March 2019
TDD and Simple Design Workshop - Session 1 - March 2019Paulo Clavijo
 
Overview on TDD (Test Driven Development) & ATDD (Acceptance Test Driven Deve...
Overview on TDD (Test Driven Development) & ATDD (Acceptance Test Driven Deve...Overview on TDD (Test Driven Development) & ATDD (Acceptance Test Driven Deve...
Overview on TDD (Test Driven Development) & ATDD (Acceptance Test Driven Deve...Zohirul Alam Tiemoon
 
TDD vs. ATDD - What, Why, Which, When & Where
TDD vs. ATDD - What, Why, Which, When & WhereTDD vs. ATDD - What, Why, Which, When & Where
TDD vs. ATDD - What, Why, Which, When & WhereDaniel Davis
 
TDD Flow: The Mantra in Action
TDD Flow: The Mantra in ActionTDD Flow: The Mantra in Action
TDD Flow: The Mantra in ActionDionatan default
 
optimizing code in compilers using parallel genetic algorithm
optimizing code in compilers using parallel genetic algorithm optimizing code in compilers using parallel genetic algorithm
optimizing code in compilers using parallel genetic algorithm Fatemeh Karimi
 
TDD (Test Driven Design)
TDD (Test Driven Design)TDD (Test Driven Design)
TDD (Test Driven Design)nedirtv
 

Was ist angesagt? (20)

TDD And Refactoring
TDD And RefactoringTDD And Refactoring
TDD And Refactoring
 
Extreme Programming
Extreme ProgrammingExtreme Programming
Extreme Programming
 
TDD reloaded - JUGTAA 24 Ottobre 2012
TDD reloaded - JUGTAA 24 Ottobre 2012TDD reloaded - JUGTAA 24 Ottobre 2012
TDD reloaded - JUGTAA 24 Ottobre 2012
 
Scrum and Test-driven development
Scrum and Test-driven developmentScrum and Test-driven development
Scrum and Test-driven development
 
Agile Programming Systems # TDD intro
Agile Programming Systems # TDD introAgile Programming Systems # TDD intro
Agile Programming Systems # TDD intro
 
TDD - Agile
TDD - Agile TDD - Agile
TDD - Agile
 
Agile and ATDD the perfect couple
Agile and ATDD the perfect coupleAgile and ATDD the perfect couple
Agile and ATDD the perfect couple
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
VT.NET 20160411: An Intro to Test Driven Development (TDD)
VT.NET 20160411: An Intro to Test Driven Development (TDD)VT.NET 20160411: An Intro to Test Driven Development (TDD)
VT.NET 20160411: An Intro to Test Driven Development (TDD)
 
Acceptance Test Driven Development
Acceptance Test Driven DevelopmentAcceptance Test Driven Development
Acceptance Test Driven Development
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
Agile Test Driven Development
Agile Test Driven DevelopmentAgile Test Driven Development
Agile Test Driven Development
 
Automation and Technical Debt
Automation and Technical DebtAutomation and Technical Debt
Automation and Technical Debt
 
TDD - Test Driven Development
TDD - Test Driven DevelopmentTDD - Test Driven Development
TDD - Test Driven Development
 
TDD and Simple Design Workshop - Session 1 - March 2019
TDD and Simple Design Workshop - Session 1 - March 2019TDD and Simple Design Workshop - Session 1 - March 2019
TDD and Simple Design Workshop - Session 1 - March 2019
 
Overview on TDD (Test Driven Development) & ATDD (Acceptance Test Driven Deve...
Overview on TDD (Test Driven Development) & ATDD (Acceptance Test Driven Deve...Overview on TDD (Test Driven Development) & ATDD (Acceptance Test Driven Deve...
Overview on TDD (Test Driven Development) & ATDD (Acceptance Test Driven Deve...
 
TDD vs. ATDD - What, Why, Which, When & Where
TDD vs. ATDD - What, Why, Which, When & WhereTDD vs. ATDD - What, Why, Which, When & Where
TDD vs. ATDD - What, Why, Which, When & Where
 
TDD Flow: The Mantra in Action
TDD Flow: The Mantra in ActionTDD Flow: The Mantra in Action
TDD Flow: The Mantra in Action
 
optimizing code in compilers using parallel genetic algorithm
optimizing code in compilers using parallel genetic algorithm optimizing code in compilers using parallel genetic algorithm
optimizing code in compilers using parallel genetic algorithm
 
TDD (Test Driven Design)
TDD (Test Driven Design)TDD (Test Driven Design)
TDD (Test Driven Design)
 

Andere mochten auch

Refactoring for Software Design Smells - Tech Talk
Refactoring for Software Design Smells - Tech TalkRefactoring for Software Design Smells - Tech Talk
Refactoring for Software Design Smells - Tech TalkGanesh Samarthyam
 
Multiple projects, different goals, one thing in common: the codebase!
Multiple projects, different goals, one thing in common: the codebase!Multiple projects, different goals, one thing in common: the codebase!
Multiple projects, different goals, one thing in common: the codebase!Carlos Lopes
 
Merge hells - Feature Toggles to the rescue
Merge hells - Feature Toggles to the rescueMerge hells - Feature Toggles to the rescue
Merge hells - Feature Toggles to the rescueLeena N
 
Trunk Based Development in the Enterprise - Its Relevance and Economics
Trunk Based Development in the Enterprise - Its Relevance and EconomicsTrunk Based Development in the Enterprise - Its Relevance and Economics
Trunk Based Development in the Enterprise - Its Relevance and EconomicsPerforce
 
Porque Odeio Branches
Porque Odeio BranchesPorque Odeio Branches
Porque Odeio BranchesRafael Petry
 
Refactoring for Software Design Smells
Refactoring for Software Design SmellsRefactoring for Software Design Smells
Refactoring for Software Design SmellsGanesh Samarthyam
 
Overcoming the fear of deployments
Overcoming the fear of deploymentsOvercoming the fear of deployments
Overcoming the fear of deploymentsAndrei Tognolo
 
Continuous Visual Integration - RailsConf 2016 - Mike Fotinakis - Percy.io
Continuous Visual Integration - RailsConf 2016 - Mike Fotinakis - Percy.ioContinuous Visual Integration - RailsConf 2016 - Mike Fotinakis - Percy.io
Continuous Visual Integration - RailsConf 2016 - Mike Fotinakis - Percy.ioMike Fotinakis
 
Pull requests and testers can be friends
Pull requests and testers can be friendsPull requests and testers can be friends
Pull requests and testers can be friendsAlan Parkinson
 
Who will test your tests?
Who will test your tests?Who will test your tests?
Who will test your tests?Yahya Poonawala
 
Entregas Contínuas com feature toggles
Entregas Contínuas com feature togglesEntregas Contínuas com feature toggles
Entregas Contínuas com feature togglessolon_aguiar
 
Continuous Integration, Delivery and Deployment
Continuous Integration, Delivery and DeploymentContinuous Integration, Delivery and Deployment
Continuous Integration, Delivery and DeploymentEero Laukkanen
 
Why we used Feature Branching
Why we used Feature BranchingWhy we used Feature Branching
Why we used Feature BranchingAlan Parkinson
 
Requirement and Test for Continuous Delivery - Customer in focus at Scania Co...
Requirement and Test for Continuous Delivery - Customer in focus at Scania Co...Requirement and Test for Continuous Delivery - Customer in focus at Scania Co...
Requirement and Test for Continuous Delivery - Customer in focus at Scania Co...Jonatan Mossberg
 
Trunk Based Development (CBSoft 2011)
Trunk Based Development (CBSoft 2011)Trunk Based Development (CBSoft 2011)
Trunk Based Development (CBSoft 2011)Wildtech
 
Feature Toggle Examples
Feature Toggle ExamplesFeature Toggle Examples
Feature Toggle ExamplesWildtech
 
Feature Flags Are Flawed: Let's Make Them Better
Feature Flags Are Flawed: Let's Make Them BetterFeature Flags Are Flawed: Let's Make Them Better
Feature Flags Are Flawed: Let's Make Them BetterStephen Young
 
Strategies in continuous delivery
Strategies in continuous deliveryStrategies in continuous delivery
Strategies in continuous deliveryAviran Mordo
 

Andere mochten auch (20)

Refactoring for Software Design Smells - Tech Talk
Refactoring for Software Design Smells - Tech TalkRefactoring for Software Design Smells - Tech Talk
Refactoring for Software Design Smells - Tech Talk
 
Multiple projects, different goals, one thing in common: the codebase!
Multiple projects, different goals, one thing in common: the codebase!Multiple projects, different goals, one thing in common: the codebase!
Multiple projects, different goals, one thing in common: the codebase!
 
Merge hells - Feature Toggles to the rescue
Merge hells - Feature Toggles to the rescueMerge hells - Feature Toggles to the rescue
Merge hells - Feature Toggles to the rescue
 
Feature Toggles On Steroids
Feature Toggles On SteroidsFeature Toggles On Steroids
Feature Toggles On Steroids
 
Trunk Based Development in the Enterprise - Its Relevance and Economics
Trunk Based Development in the Enterprise - Its Relevance and EconomicsTrunk Based Development in the Enterprise - Its Relevance and Economics
Trunk Based Development in the Enterprise - Its Relevance and Economics
 
Porque Odeio Branches
Porque Odeio BranchesPorque Odeio Branches
Porque Odeio Branches
 
Refactoring for Software Design Smells
Refactoring for Software Design SmellsRefactoring for Software Design Smells
Refactoring for Software Design Smells
 
Overcoming the fear of deployments
Overcoming the fear of deploymentsOvercoming the fear of deployments
Overcoming the fear of deployments
 
Continuous Visual Integration - RailsConf 2016 - Mike Fotinakis - Percy.io
Continuous Visual Integration - RailsConf 2016 - Mike Fotinakis - Percy.ioContinuous Visual Integration - RailsConf 2016 - Mike Fotinakis - Percy.io
Continuous Visual Integration - RailsConf 2016 - Mike Fotinakis - Percy.io
 
Pull requests and testers can be friends
Pull requests and testers can be friendsPull requests and testers can be friends
Pull requests and testers can be friends
 
Who will test your tests?
Who will test your tests?Who will test your tests?
Who will test your tests?
 
Entregas Contínuas com feature toggles
Entregas Contínuas com feature togglesEntregas Contínuas com feature toggles
Entregas Contínuas com feature toggles
 
Continuous Integration, Delivery and Deployment
Continuous Integration, Delivery and DeploymentContinuous Integration, Delivery and Deployment
Continuous Integration, Delivery and Deployment
 
Why we used Feature Branching
Why we used Feature BranchingWhy we used Feature Branching
Why we used Feature Branching
 
Requirement and Test for Continuous Delivery - Customer in focus at Scania Co...
Requirement and Test for Continuous Delivery - Customer in focus at Scania Co...Requirement and Test for Continuous Delivery - Customer in focus at Scania Co...
Requirement and Test for Continuous Delivery - Customer in focus at Scania Co...
 
Trunk Based Development (CBSoft 2011)
Trunk Based Development (CBSoft 2011)Trunk Based Development (CBSoft 2011)
Trunk Based Development (CBSoft 2011)
 
Feature Toggle Examples
Feature Toggle ExamplesFeature Toggle Examples
Feature Toggle Examples
 
Feature Flags Are Flawed: Let's Make Them Better
Feature Flags Are Flawed: Let's Make Them BetterFeature Flags Are Flawed: Let's Make Them Better
Feature Flags Are Flawed: Let's Make Them Better
 
Strategies in continuous delivery
Strategies in continuous deliveryStrategies in continuous delivery
Strategies in continuous delivery
 
Feature Toggles
Feature TogglesFeature Toggles
Feature Toggles
 

Ähnlich wie Big code refactoring with agility

The View - Lotusscript coding best practices
The View - Lotusscript coding best practicesThe View - Lotusscript coding best practices
The View - Lotusscript coding best practicesBill Buchan
 
Unit testing traning
Unit testing traningUnit testing traning
Unit testing traningDiego Pacheco
 
So You Want to Rewrite That...
So You Want to Rewrite That...So You Want to Rewrite That...
So You Want to Rewrite That...Camille Fournier
 
Software Craftsmanship @ Ntnu
Software Craftsmanship @ NtnuSoftware Craftsmanship @ Ntnu
Software Craftsmanship @ Ntnugoeran
 
Perfect product architecture in a non-stop start-up
Perfect product architecture in a non-stop start-upPerfect product architecture in a non-stop start-up
Perfect product architecture in a non-stop start-upDroidConTLV
 
Understand the system
Understand the systemUnderstand the system
Understand the systemDiego Pacheco
 
How BDD enables True CI/CD
How BDD enables True CI/CDHow BDD enables True CI/CD
How BDD enables True CI/CDRoger Turnau
 
Test Driven Development Methodology and Philosophy
Test Driven Development Methodology and Philosophy Test Driven Development Methodology and Philosophy
Test Driven Development Methodology and Philosophy Vijay Kumbhar
 
How have we developed product without bugs
How have we developed product without bugsHow have we developed product without bugs
How have we developed product without bugsSigma Software
 
You cant be agile if your code sucks
You cant be agile if your code sucksYou cant be agile if your code sucks
You cant be agile if your code sucksPeter Gfader
 
Test Driven Development with Laravel
Test Driven Development with LaravelTest Driven Development with Laravel
Test Driven Development with LaravelTyler Johnston
 
Test Driven Development on Android (Kotlin Kenya)
Test Driven Development on Android (Kotlin Kenya)Test Driven Development on Android (Kotlin Kenya)
Test Driven Development on Android (Kotlin Kenya)Danny Preussler
 
TDD CrashCourse Part2: TDD
TDD CrashCourse Part2: TDDTDD CrashCourse Part2: TDD
TDD CrashCourse Part2: TDDDavid Rodenas
 
Continuous Delivery for Agile Teams
Continuous Delivery for Agile TeamsContinuous Delivery for Agile Teams
Continuous Delivery for Agile TeamsMike Bowler
 
The Power Of Refactoring (PHPCon Italia)
The Power Of Refactoring (PHPCon Italia)The Power Of Refactoring (PHPCon Italia)
The Power Of Refactoring (PHPCon Italia)Stefan Koopmanschap
 

Ähnlich wie Big code refactoring with agility (20)

The View - Lotusscript coding best practices
The View - Lotusscript coding best practicesThe View - Lotusscript coding best practices
The View - Lotusscript coding best practices
 
Unit testing traning
Unit testing traningUnit testing traning
Unit testing traning
 
DevOps and Cloud
DevOps and CloudDevOps and Cloud
DevOps and Cloud
 
So You Want to Rewrite That...
So You Want to Rewrite That...So You Want to Rewrite That...
So You Want to Rewrite That...
 
Software Craftsmanship @ Ntnu
Software Craftsmanship @ NtnuSoftware Craftsmanship @ Ntnu
Software Craftsmanship @ Ntnu
 
Perfect product architecture in a non-stop start-up
Perfect product architecture in a non-stop start-upPerfect product architecture in a non-stop start-up
Perfect product architecture in a non-stop start-up
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
Hardening
HardeningHardening
Hardening
 
Understand the system
Understand the systemUnderstand the system
Understand the system
 
Tdd!
Tdd!Tdd!
Tdd!
 
How BDD enables True CI/CD
How BDD enables True CI/CDHow BDD enables True CI/CD
How BDD enables True CI/CD
 
Test Driven Development Methodology and Philosophy
Test Driven Development Methodology and Philosophy Test Driven Development Methodology and Philosophy
Test Driven Development Methodology and Philosophy
 
How have we developed product without bugs
How have we developed product without bugsHow have we developed product without bugs
How have we developed product without bugs
 
You cant be agile if your code sucks
You cant be agile if your code sucksYou cant be agile if your code sucks
You cant be agile if your code sucks
 
Test Driven Development with Laravel
Test Driven Development with LaravelTest Driven Development with Laravel
Test Driven Development with Laravel
 
Test Driven Development on Android (Kotlin Kenya)
Test Driven Development on Android (Kotlin Kenya)Test Driven Development on Android (Kotlin Kenya)
Test Driven Development on Android (Kotlin Kenya)
 
The Power of Refactoring
The Power of RefactoringThe Power of Refactoring
The Power of Refactoring
 
TDD CrashCourse Part2: TDD
TDD CrashCourse Part2: TDDTDD CrashCourse Part2: TDD
TDD CrashCourse Part2: TDD
 
Continuous Delivery for Agile Teams
Continuous Delivery for Agile TeamsContinuous Delivery for Agile Teams
Continuous Delivery for Agile Teams
 
The Power Of Refactoring (PHPCon Italia)
The Power Of Refactoring (PHPCon Italia)The Power Of Refactoring (PHPCon Italia)
The Power Of Refactoring (PHPCon Italia)
 

Mehr von Luca Merolla

Fundraising in chaotic environments
Fundraising in chaotic environmentsFundraising in chaotic environments
Fundraising in chaotic environmentsLuca Merolla
 
How to raise money in a digital world
How to raise money in a digital worldHow to raise money in a digital world
How to raise money in a digital worldLuca Merolla
 
The Learning Organization
The Learning OrganizationThe Learning Organization
The Learning OrganizationLuca Merolla
 
Innovation in Large Enterprises
Innovation in Large EnterprisesInnovation in Large Enterprises
Innovation in Large EnterprisesLuca Merolla
 
Introduction to Crowdfunding
Introduction to CrowdfundingIntroduction to Crowdfunding
Introduction to CrowdfundingLuca Merolla
 

Mehr von Luca Merolla (6)

Fundraising in chaotic environments
Fundraising in chaotic environmentsFundraising in chaotic environments
Fundraising in chaotic environments
 
How to raise money in a digital world
How to raise money in a digital worldHow to raise money in a digital world
How to raise money in a digital world
 
The Learning Organization
The Learning OrganizationThe Learning Organization
The Learning Organization
 
Innovation in Large Enterprises
Innovation in Large EnterprisesInnovation in Large Enterprises
Innovation in Large Enterprises
 
Event Sito
Event SitoEvent Sito
Event Sito
 
Introduction to Crowdfunding
Introduction to CrowdfundingIntroduction to Crowdfunding
Introduction to Crowdfunding
 

Kürzlich hochgeladen

WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...WSO2
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationJuha-Pekka Tolvanen
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2
 
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2
 
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2
 
tonesoftg
tonesoftgtonesoftg
tonesoftglanshi9
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park masabamasaba
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...Jittipong Loespradit
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension AidPhilip Schwarz
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benonimasabamasaba
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfonteinmasabamasaba
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park masabamasaba
 
WSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnAmarnathKambale
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareJim McKeeth
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...masabamasaba
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfonteinmasabamasaba
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburgmasabamasaba
 

Kürzlich hochgeladen (20)

WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open SourceWSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
WSO2CON 2024 - Freedom First—Unleashing Developer Potential with Open Source
 
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security Program
 
tonesoftg
tonesoftgtonesoftg
tonesoftg
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
WSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - Keynote
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
 

Big code refactoring with agility

  • 1. HOW DO YOU HANDLE BIG REFACTORING WITH AGILE METHODOLOGIES? Luca Merolla
  • 2. What is code refactoring?
  • 3. CODE REFACTORING “Process to change the existing code without changing its external behavior. Refactoring improves nonfunctional attributes of the software”
  • 4. Why we need code refactoring?
  • 5. WHY REFACTORING? Some arguments : ❏ Quality ❏ Code Clean ❏ Better Design ❏ Right Thing
  • 6. WHY REFACTORING? Some arguments : ❏ Quality ❏ Code Clean ❏ Better Design ❏ Right Thing Good Luck!
  • 7. WHY REFACTORING? The only “sellable” reason to do refactoring is
  • 8. WHY REFACTORING? The only “sellable” reason to do refactoring is
  • 9. WHY REFACTORING? The only “sellable” reason to do refactoring is Save money Faster to deliver new functionalities
  • 11. When to do refactoring?
  • 12. WHEN REFACTORING? Ideally, when we identify: ❏ Code Smells: Things are not right ❏ WTFs: Code is not understandable ❏ It should be different: Product evolved
  • 13. WHEN REFACTORING? Don’t clean up everything. It should be a constant and gradual improvement
  • 14. WHEN REFACTORING? Keep the balance between: refactoring vs new features Don't refactor unless you think it will pay off later by allowing faster feature delivery
  • 15. How to do refactoring? <
  • 16. HOW TO REFACTOR? From the methodology point of view, my experience tells me that: ❏ Revolutionary design is evil ❏ Evolutionary design is good
  • 17. HOW TO REFACTOR? The most common approaches about refactoring are: ❏ “Big Bang” ❏ “Divide and Conquer” ❏ Planned refactoring
  • 18. HOW TO REFACTOR? The “Big Bang” approach: ❏ Define a new structure for your code ❏ Move the code to the new structure ❏ Rebuild the puzzle ❏ Make tests green again!
  • 19. HOW TO REFACTOR? The “Big Bang” approach: ❏ Define a new structure for your code ❏ Move the code to the new structure ❏ Rebuild the puzzle ❏ Make tests green again! ❏ High risks! ❏ Almost like rewrite from scratch
  • 20. HOW TO REFACTOR? The “Divide and Conquer” approach: ❏ Define a Vision ❏ Break the application into pieces ❏ Rebuild the puzzle ❏ Make tests green again!
  • 21. HOW TO REFACTOR? The “Divide and Conquer” approach: ❏ Define a Vision ❏ Break the application into pieces ❏ Rebuild the puzzle ❏ Make tests green again! ❏ Difficult estimation (like bugs) ❏ Code could be “undeliverable” for long period
  • 22. HOW TO REFACTOR? Planned Refactoring also called as Stabilization periods: ❏ No new features developed (Code freeze period) ❏ Work without adding Value ❏ Not an improvement for the customer
  • 23. HOW TO REFACTOR? Planned Refactoring also called as Stabilization periods: ❏ No new features developed (Code freeze period) ❏ Work without adding Value ❏ Not an improvement for the customer ❏ It’s a Methodology Smell! ❏ No real “value” added to the application
  • 24. HOW TO REFACTOR? What a Good Team does is: ❏ Define a Vision ❏ Break it into smaller tasks ❏ Refactoring all the time (part of regular work) ❏ Responsible (Diligently keep the code clean)
  • 25. HOW TO REFACTOR? What a Good Team does is: ❏ Define a Vision ❏ Break it into smaller tasks ❏ Refactoring all the time (part of regular work) ❏ Responsible (Diligently keep the code clean) ❏ Code can be delivered (often) ❏ New features benefits from the refactor (faster to develop)
  • 26. How much refactoring should we be doing? <
  • 27. HOW MUCH REFACTOR? We need to always consider the benefits of refactoring ❏ Tolerance level (metrics could help) ❏ Don’t clean up everything ❏ Make refactoring part of our daily work ❏ Multiple small improvements ❏ Don’t refactor what is not likely to change ❏ Consider the economic factor: Cleaner code ⇨ Quicker and Cheaper changes
  • 28. How can we obtain Refactoring with Agile Methodologies?
  • 29. AGILE & REFACTOR? Agile Methodologies focuses on continuous (or at least frequent) Value delivery. The Value (for the customer) is realized when the product is shipped in production, not before.
  • 30. AGILE & REFACTOR? In order to use Agile Methodologies for big refactoring, we need to enforce some practices: ❏ Define and communicate the Vision ❏ Start with small tasks ❏ Iterate and Learn
  • 31. VISION Where to go MUST be clear.
  • 32. Small Steps (Tasks) are easier to handle
  • 33. Iterate and Learn throughout the process
  • 34. Which Tools and Techniques should we use?
  • 35. TOOLS & TECHNIQUES There are different tools and techniques that can help us to be more agile and deliver more often: ❏ Trunk Based Development ❏ Branch By Abstraction ❏ Feature Toggles/Flags
  • 36. What is Trunk Based Development?
  • 37. TRUNK BASED DEV. Branches act as an Isolation from the “real world”.
  • 38. TRUNK BASED DEV. Multi branches can make the code undeployable for long periods ● Undeployable ● Deployable
  • 39. TRUNK BASED DEV. What is really wrong with Branches? ❏ Branching is not bad, long lived branches are bad ❏ “Isolation” for prolonged periods of time is bad ❏ Multi-branches can lead to undeployable code
  • 40. TRUNK BASED DEV. How does TBD look like?
  • 41. TRUNK BASED DEV. What are the benefits of TBD? ❏ Work on a single shared trunk ❏ Always work against the latest code ❏ Merge and integration pain is minimised Note: ❏ TBD does not prohibit branching
  • 42. TRUNK BASED DEV. F FIX TBD Optimistic Branching R D ? R RELEASED DEVELOPED NO COMMITS YET D ? 209 210 211 TRUNK 209.x FIX R 209.1 R D F ? 209 210 211 TRUNK
  • 43. TRUNK BASED DEV. TBD Pessimistic Branching R RELEASED F FIX DEVELOPED NO COMMITS YET D ? 209.x ? R D ? 209 210 211 TRUNK 209.x R D R 211.x ? 209 210 211 TRUNK 209.x R D FIX R 209.1 F R 211.x ? 209 210 211 TRUNK
  • 44. What is Branch By Abstraction?
  • 45. BRANCH BY ABSTRACTION 1. Introduce an abstraction layer 2. Update all the code to rely on the abstraction 3. Make new implementation of the abstraction 4. Remove the old implementation
  • 47. What are feature toggles/flags?
  • 48. TOGGLES & FLAGS? What are the advantages of using Feature Toggles: ❏ Decouples code deployment from feature ❏ No need to rollback (disable the feature) ❏ A/B testing ❏ Deliver features to specific users only ❏ Continuous delivery
  • 49. THANK YOU! Questions? @lucamerolla