SlideShare une entreprise Scribd logo
1  sur  22
Test Driving Legacy Code
Breaking out of the “Legacy Code Dilemma”
About me…
Developer since 1994
(C++ used to be my friend…)
Agile Coach since 2009
fernando.a.cuenca@gmail.com
@fer_cuenca
Big Thanks to our
Sponsor!
http://digitalfactory.scotiabank.com
Agenda
TDD in the context of Legacy Code
Practice Session 1 + Debrief
BREAK
Practice Session 2 + Debrief
So, what is “Legacy Code”
anyways?
Code that
actively prevents
you from making
changes
Code we’re
afraid to change
Code where the
design makes
more design
decisions than
the programmer
Code without
Unit Tests
you could
have a
“magic
button”…
Pecha Kucha @ OOP 2015 "Is TDD dead?
https://www.youtube.com/watch?v=9NANcPTbDBQ
Start
Here
TDD
Write a
failing
test
Make it
pass
Improve
the
Design
The Legacy Code Dilemma
Michael Feathers
“Working Effectively with Legacy Code”
Pinning Down
Behaviour
Your turn now!
2 Practice sessions + Debrief
We need to choose a common Programming
Language
Java
C#
Javascript
Find a partner (we’ll switch for Session 2)
Log in to my Cyber-Dojo:
http://cyberdojo.ddns.net
Welcome to Ugly Trivia!
What does the code do?
What are the different RESPONSIBILITIES?
How “good” or “bad” is this code? Why?
How much “Technical Debt” does it have?
Can you identify two distinct kinds of tests?
What is the purpose of each?
Key Ideas
Adding More Characterization
Tests
What kinds of things are displayed? When?
What’s the minimum number of players?
What happens when a player rolls?
How does the current location change?
How are categories selected?
How are coins awarded?
What’s the order of the players?
How big is the board? How is it traversed?
What happens when the answer is correct?
Incorrect?
What are the rules around the “penalty box”?
Debrief: What was it like?
What are most important insights you gained
from the session?
What was helpful / not-helpful?
What will you do differently in the next session?
Let’s fix some defects!
Fix typo when answering correctly ("Answer was
corrent")
Terminate nicely instead of throwing exceptions:
when questions run out
when rolling before adding players
Let’s add some new
features!
Backlog
1. Display the winner's
name when the game
ends
2. Display output in
multiple languages
Guidelines
Cover, then modify
Can you test-drive a
replacement?
Are your tests passing
all the time?
How small are your
steps? Can you make
them smaller?
Large-Scale Refactoring
New Features
1. Configurable board size
2. New Category: Politics
3. When questions run out (in
any category), the game ends
and the player with the most
coins wins
4. Different categories pay
different amount of coins
when answered correctly
5. if 2 people in a row answer
incorrectly, the order of
players inverts
Guidelines
Pick a feature to work
on
Agree on a “good
design” for it.
Sketch general
incremental steps to
get there
The Mikado Method (https://mikadomethod.wordpress.com)
Debrief: What was it like?
What are most important insights you gained
from this session?
What was the overall feeling?
How does the result compares to what you
initially thought the outcome might be?
How/Where could this approach be useful?
What will you do differently tomorrow, back in the
office?
Learning more
Thank you!
And please, complete the feedback forms!!

Contenu connexe

Similaire à Test Driving Legacy Code Mini Workshop

Global Day of Coderetreat Munich 2018
Global Day of Coderetreat Munich 2018Global Day of Coderetreat Munich 2018
Global Day of Coderetreat Munich 2018David Völkel
 
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
 
Global Day of Coderetreat Munich 2017
Global Day of Coderetreat Munich 2017Global Day of Coderetreat Munich 2017
Global Day of Coderetreat Munich 2017David Völkel
 
sitHVR - The Hitchhikers Guide to the Legacy
sitHVR - The Hitchhikers Guide to the LegacysitHVR - The Hitchhikers Guide to the Legacy
sitHVR - The Hitchhikers Guide to the LegacyLaurens van Rijn
 
sitBRU - The Hitchhikers Guide to the Legacy
sitBRU - The Hitchhikers Guide to the LegacysitBRU - The Hitchhikers Guide to the Legacy
sitBRU - The Hitchhikers Guide to the LegacyLaurens van Rijn
 
How I Learned to Stop Worrying and Love Legacy Code.....
How I Learned to Stop Worrying and Love Legacy Code.....How I Learned to Stop Worrying and Love Legacy Code.....
How I Learned to Stop Worrying and Love Legacy Code.....Mike Harris
 
InfoSession2022_merged.pdf
InfoSession2022_merged.pdfInfoSession2022_merged.pdf
InfoSession2022_merged.pdfKINGSHUKGHOSH20
 
Agile Methodologies And Extreme Programming - Svetlin Nakov
Agile Methodologies And Extreme Programming - Svetlin NakovAgile Methodologies And Extreme Programming - Svetlin Nakov
Agile Methodologies And Extreme Programming - Svetlin NakovSvetlin Nakov
 
Agile Methodologies And Extreme Programming
Agile Methodologies And Extreme ProgrammingAgile Methodologies And Extreme Programming
Agile Methodologies And Extreme ProgrammingUtkarsh Khare
 
DevLearn 2017 Play to Learn workshop slides
DevLearn 2017 Play to Learn workshop slidesDevLearn 2017 Play to Learn workshop slides
DevLearn 2017 Play to Learn workshop slidesSharon Boller
 
Coding Dojo Firenze - vol1
Coding Dojo Firenze - vol1 Coding Dojo Firenze - vol1
Coding Dojo Firenze - vol1 Massimo Iacolare
 
Greythorn Whiteboard Interview Guide
Greythorn Whiteboard Interview GuideGreythorn Whiteboard Interview Guide
Greythorn Whiteboard Interview GuideVaco Seattle
 
Kata Your Way to SW Craftsmanship
Kata Your Way to SW CraftsmanshipKata Your Way to SW Craftsmanship
Kata Your Way to SW CraftsmanshipCamille Bell
 
How to Design Effective Learning Games: Sharon Boller and Karl Kapp
How to Design Effective Learning Games: Sharon Boller and Karl KappHow to Design Effective Learning Games: Sharon Boller and Karl Kapp
How to Design Effective Learning Games: Sharon Boller and Karl KappSharon Boller
 

Similaire à Test Driving Legacy Code Mini Workshop (20)

Global Day of Coderetreat Munich 2018
Global Day of Coderetreat Munich 2018Global Day of Coderetreat Munich 2018
Global Day of Coderetreat Munich 2018
 
Make a better with clean code
Make a better with clean codeMake a better with clean code
Make a better with clean code
 
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
 
Global Day of Coderetreat Munich 2017
Global Day of Coderetreat Munich 2017Global Day of Coderetreat Munich 2017
Global Day of Coderetreat Munich 2017
 
Code Retreat
Code RetreatCode Retreat
Code Retreat
 
sitHVR - The Hitchhikers Guide to the Legacy
sitHVR - The Hitchhikers Guide to the LegacysitHVR - The Hitchhikers Guide to the Legacy
sitHVR - The Hitchhikers Guide to the Legacy
 
sitBRU - The Hitchhikers Guide to the Legacy
sitBRU - The Hitchhikers Guide to the LegacysitBRU - The Hitchhikers Guide to the Legacy
sitBRU - The Hitchhikers Guide to the Legacy
 
How I Learned to Stop Worrying and Love Legacy Code.....
How I Learned to Stop Worrying and Love Legacy Code.....How I Learned to Stop Worrying and Love Legacy Code.....
How I Learned to Stop Worrying and Love Legacy Code.....
 
InfoSession2022_merged.pdf
InfoSession2022_merged.pdfInfoSession2022_merged.pdf
InfoSession2022_merged.pdf
 
Agile Methodologies And Extreme Programming - Svetlin Nakov
Agile Methodologies And Extreme Programming - Svetlin NakovAgile Methodologies And Extreme Programming - Svetlin Nakov
Agile Methodologies And Extreme Programming - Svetlin Nakov
 
Agile Methodologies And Extreme Programming
Agile Methodologies And Extreme ProgrammingAgile Methodologies And Extreme Programming
Agile Methodologies And Extreme Programming
 
DevLearn 2017 Play to Learn workshop slides
DevLearn 2017 Play to Learn workshop slidesDevLearn 2017 Play to Learn workshop slides
DevLearn 2017 Play to Learn workshop slides
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
Coding Dojo Firenze - vol1
Coding Dojo Firenze - vol1 Coding Dojo Firenze - vol1
Coding Dojo Firenze - vol1
 
Best pratice
Best praticeBest pratice
Best pratice
 
Agile Practices
Agile PracticesAgile Practices
Agile Practices
 
Greythorn Whiteboard Interview Guide
Greythorn Whiteboard Interview GuideGreythorn Whiteboard Interview Guide
Greythorn Whiteboard Interview Guide
 
Kata Your Way to SW Craftsmanship
Kata Your Way to SW CraftsmanshipKata Your Way to SW Craftsmanship
Kata Your Way to SW Craftsmanship
 
Raising the Bar
Raising the BarRaising the Bar
Raising the Bar
 
How to Design Effective Learning Games: Sharon Boller and Karl Kapp
How to Design Effective Learning Games: Sharon Boller and Karl KappHow to Design Effective Learning Games: Sharon Boller and Karl Kapp
How to Design Effective Learning Games: Sharon Boller and Karl Kapp
 

Plus de Fernando Cuenca

Kanban: More than boards and WIP limits
Kanban: More than boards and WIP limitsKanban: More than boards and WIP limits
Kanban: More than boards and WIP limitsFernando Cuenca
 
Kanban: mucho Mas que tableros y Limites de WIP
Kanban: mucho Mas que tableros y Limites de WIPKanban: mucho Mas que tableros y Limites de WIP
Kanban: mucho Mas que tableros y Limites de WIPFernando Cuenca
 
Finding your Service Delivery Manager
Finding your Service Delivery ManagerFinding your Service Delivery Manager
Finding your Service Delivery ManagerFernando Cuenca
 
Agile Dependencies: When "going cross-functional" is not an option
Agile Dependencies: When "going cross-functional" is not an optionAgile Dependencies: When "going cross-functional" is not an option
Agile Dependencies: When "going cross-functional" is not an optionFernando Cuenca
 
Kanban in The Land of Scrum: Choose your Own Scrumban Adventure
Kanban in The Land of Scrum: Choose your Own Scrumban AdventureKanban in The Land of Scrum: Choose your Own Scrumban Adventure
Kanban in The Land of Scrum: Choose your Own Scrumban AdventureFernando Cuenca
 
From Team Flow to System Flow to Customer Flow: Practical Tools to Keep Valua...
From Team Flow to System Flow to Customer Flow: Practical Tools to Keep Valua...From Team Flow to System Flow to Customer Flow: Practical Tools to Keep Valua...
From Team Flow to System Flow to Customer Flow: Practical Tools to Keep Valua...Fernando Cuenca
 
Your board is trying to tell you something
Your board is trying to tell you somethingYour board is trying to tell you something
Your board is trying to tell you somethingFernando Cuenca
 
AgileLunch Meetup - Listen to your Board
AgileLunch Meetup - Listen to your BoardAgileLunch Meetup - Listen to your Board
AgileLunch Meetup - Listen to your BoardFernando Cuenca
 
Visualizing Work: If you can't see it, you can't manage it
Visualizing Work: If you can't see it, you can't manage itVisualizing Work: If you can't see it, you can't manage it
Visualizing Work: If you can't see it, you can't manage itFernando Cuenca
 
Kanban to #003 - Metrics
Kanban to #003 - MetricsKanban to #003 - Metrics
Kanban to #003 - MetricsFernando Cuenca
 
Amp up your Agile Implementation with Systems Thinking
Amp up your Agile Implementation with Systems ThinkingAmp up your Agile Implementation with Systems Thinking
Amp up your Agile Implementation with Systems ThinkingFernando Cuenca
 

Plus de Fernando Cuenca (15)

Kanban: More than boards and WIP limits
Kanban: More than boards and WIP limitsKanban: More than boards and WIP limits
Kanban: More than boards and WIP limits
 
El Pivot Pragmatico
El Pivot PragmaticoEl Pivot Pragmatico
El Pivot Pragmatico
 
Kanban: mucho Mas que tableros y Limites de WIP
Kanban: mucho Mas que tableros y Limites de WIPKanban: mucho Mas que tableros y Limites de WIP
Kanban: mucho Mas que tableros y Limites de WIP
 
Finding your SDM
Finding your SDMFinding your SDM
Finding your SDM
 
Finding your Service Delivery Manager
Finding your Service Delivery ManagerFinding your Service Delivery Manager
Finding your Service Delivery Manager
 
Agile Dependencies: When "going cross-functional" is not an option
Agile Dependencies: When "going cross-functional" is not an optionAgile Dependencies: When "going cross-functional" is not an option
Agile Dependencies: When "going cross-functional" is not an option
 
Kanban in The Land of Scrum: Choose your Own Scrumban Adventure
Kanban in The Land of Scrum: Choose your Own Scrumban AdventureKanban in The Land of Scrum: Choose your Own Scrumban Adventure
Kanban in The Land of Scrum: Choose your Own Scrumban Adventure
 
From Team Flow to System Flow to Customer Flow: Practical Tools to Keep Valua...
From Team Flow to System Flow to Customer Flow: Practical Tools to Keep Valua...From Team Flow to System Flow to Customer Flow: Practical Tools to Keep Valua...
From Team Flow to System Flow to Customer Flow: Practical Tools to Keep Valua...
 
Que tan agiles somos?
Que tan agiles somos?Que tan agiles somos?
Que tan agiles somos?
 
Your board is trying to tell you something
Your board is trying to tell you somethingYour board is trying to tell you something
Your board is trying to tell you something
 
AgileLunch Meetup - Listen to your Board
AgileLunch Meetup - Listen to your BoardAgileLunch Meetup - Listen to your Board
AgileLunch Meetup - Listen to your Board
 
Visualizing Work: If you can't see it, you can't manage it
Visualizing Work: If you can't see it, you can't manage itVisualizing Work: If you can't see it, you can't manage it
Visualizing Work: If you can't see it, you can't manage it
 
Kanban to #003 - Metrics
Kanban to #003 - MetricsKanban to #003 - Metrics
Kanban to #003 - Metrics
 
Amp up your Agile Implementation with Systems Thinking
Amp up your Agile Implementation with Systems ThinkingAmp up your Agile Implementation with Systems Thinking
Amp up your Agile Implementation with Systems Thinking
 
Basic TDD moves
Basic TDD movesBasic TDD moves
Basic TDD moves
 

Dernier

Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...SelfMade bd
 
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...WSO2
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisamasabamasaba
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...masabamasaba
 
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
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...masabamasaba
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...Shane Coughlan
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastPapp Krisztián
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrandmasabamasaba
 
WSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
%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
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...masabamasaba
 
%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
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024VictoriaMetrics
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplatePresentation.STUDIO
 
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
 

Dernier (20)

Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
WSO2CON 2024 - API Management Usage at La Poste and Its Impact on Business an...
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
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
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
WSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - Keynote
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
%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
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
%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
 
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
Large-scale Logging Made Easy: Meetup at Deutsche Bank 2024
 
AI & Machine Learning Presentation Template
AI & Machine Learning Presentation TemplateAI & Machine Learning Presentation Template
AI & Machine Learning Presentation Template
 
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...
 

Test Driving Legacy Code Mini Workshop

  • 1. Test Driving Legacy Code Breaking out of the “Legacy Code Dilemma”
  • 2. About me… Developer since 1994 (C++ used to be my friend…) Agile Coach since 2009 fernando.a.cuenca@gmail.com @fer_cuenca
  • 3. Big Thanks to our Sponsor! http://digitalfactory.scotiabank.com
  • 4. Agenda TDD in the context of Legacy Code Practice Session 1 + Debrief BREAK Practice Session 2 + Debrief
  • 5. So, what is “Legacy Code” anyways?
  • 6. Code that actively prevents you from making changes Code we’re afraid to change Code where the design makes more design decisions than the programmer Code without Unit Tests
  • 7. you could have a “magic button”… Pecha Kucha @ OOP 2015 "Is TDD dead? https://www.youtube.com/watch?v=9NANcPTbDBQ
  • 9. The Legacy Code Dilemma Michael Feathers “Working Effectively with Legacy Code”
  • 11. Your turn now! 2 Practice sessions + Debrief We need to choose a common Programming Language Java C# Javascript Find a partner (we’ll switch for Session 2) Log in to my Cyber-Dojo: http://cyberdojo.ddns.net
  • 12. Welcome to Ugly Trivia! What does the code do? What are the different RESPONSIBILITIES? How “good” or “bad” is this code? Why? How much “Technical Debt” does it have? Can you identify two distinct kinds of tests? What is the purpose of each?
  • 14. Adding More Characterization Tests What kinds of things are displayed? When? What’s the minimum number of players? What happens when a player rolls? How does the current location change? How are categories selected? How are coins awarded? What’s the order of the players? How big is the board? How is it traversed? What happens when the answer is correct? Incorrect? What are the rules around the “penalty box”?
  • 15. Debrief: What was it like? What are most important insights you gained from the session? What was helpful / not-helpful? What will you do differently in the next session?
  • 16. Let’s fix some defects! Fix typo when answering correctly ("Answer was corrent") Terminate nicely instead of throwing exceptions: when questions run out when rolling before adding players
  • 17. Let’s add some new features! Backlog 1. Display the winner's name when the game ends 2. Display output in multiple languages Guidelines Cover, then modify Can you test-drive a replacement? Are your tests passing all the time? How small are your steps? Can you make them smaller?
  • 18. Large-Scale Refactoring New Features 1. Configurable board size 2. New Category: Politics 3. When questions run out (in any category), the game ends and the player with the most coins wins 4. Different categories pay different amount of coins when answered correctly 5. if 2 people in a row answer incorrectly, the order of players inverts Guidelines Pick a feature to work on Agree on a “good design” for it. Sketch general incremental steps to get there
  • 19. The Mikado Method (https://mikadomethod.wordpress.com)
  • 20. Debrief: What was it like? What are most important insights you gained from this session? What was the overall feeling? How does the result compares to what you initially thought the outcome might be? How/Where could this approach be useful? What will you do differently tomorrow, back in the office?
  • 22. Thank you! And please, complete the feedback forms!!

Notes de l'éditeur

  1. We tend to associate two ideas with “Legacy Code”: old, and messy.
  2. Cyber-dojo start-point: Ugly Trivia / With Tests Ask people to review the code in pairs Distribute responsibilities page (if people need guidance)
  3. Distribute Characterization test list (if people are lost)
  4. Focus is to practice “Cover, then modify” Distribute refactoring diagrams == BREAK ==