SlideShare a Scribd company logo
1 of 16
Download to read offline
Golden Thorns
Lessons in Golden Master Testing
From The Gilded Rose Kata
Paul Baker @paulbaker3
Husband, Father and Nerd
Hacking on stuff since 1999
Dev-ing for money since 2001
First Ruby gig in 2013
Currently at Capshare.com
WTF Is This Dude
Legacy code can really suck
Poorly designed
Bloated
Buggy
Untested or Naively tested
Arthritic Code
Arthritic Code
We’ve all been there...
or maybe you haven’t.
Right?
Not exactly
tests.all != tests.useful?
Adding useful unit tests can be
Hard
Expensive
Occasionally Impossible
We Can Only Go Up From Here
require ‘test_meow’
Not exactly
UnitTests == Dev::GoldStandard
Other testing strategies/ tools provide value
Nothing replaces the feedback you get from those . . . . .
From Therapy To Injury
http://blog.thecodewhisperer.com/permalink/integrated-tests-are-a-scam
But What About The Cost?
Problem Solved! Right….. ?
Golden Master/ Guru Checks Output
Just go with it man…
Assumption: Functions As Designed
Don’t CHANGE ANYTHING. But seriously… change everything
It’s really not that crazy… I promise
J. B. Rainsberger http://blog.thecodewhisperer.com/permalink/surviving-legacy-...
There’s A Gem For That
Approvals https://github.com/kytrinyx/approvals
I Know! ANTI-PATTERN!
The Gilded Rose Kata
A legacy coding exercise
It’s kind of a thing
Created by Bobby Johnson in 2011
http://iamnotmyself.com/2011/02/13/refactor-this-the-gilded-rose-kata/
Ported to Ruby by Jim Weirich https://github.com/jimweirich/gilded_rose_kata
Commented on by Sandi Metz http://confreaks.tv/videos/railsconf2014-all-the-little-things
and Randy Coulman http://confreaks.tv/videos/railsconf2015-getting-a-handle-on-legacy-code
amongst others…
First Some Background
To The Editor!
Reading > Googling
Is this just a terrible idea?
Are there ways to do this cheaper?
A Few Questions To Consider
“All that glitters is not gold”
Boy Scout the F*** Out of Your Code
Let me know if you give this a try @paulbaker3
Some Parting Thoughts
Thank You!
Randy Coulman
http://confreaks.tv/videos/railsconf2015-getting-a-handle-on-legacy-code
http://randycoulman.com//blog/2014/09/30/refactoring-legacy-code/
Lauren Voswinkel @laurenvoswinkel
Jim Weirich https://github.com/jimweirich/gilded_rose_kata
Sandi Metz http://confreaks.tv/videos/railsconf2014-all-the-little-things
Ryan Davis, Steven Books, and the rest of the Capshare Dev Team
Working Effectively with Legacy Code by Michael Feathers
Other blog posts
http://blog.codeclimate.com/blog/2014/02/20/gold-master-testing/
http://blog.thecodewhisperer.com/permalink/surviving-legacy-code-with-golden-master-and-sampling/
http://iamnotmyself.com/2011/02/13/refactor-this-the-gilded-rose-kata/
Sources, Thanks & Inspiration

More Related Content

Recently uploaded

Recently uploaded (20)

Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
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?
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
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
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
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
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
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
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
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
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
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...
 

Featured

Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Saba Software
 

Featured (20)

Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
 

Golden Thorns: Lessons in Golden Master Testing from the Gilded Rose Kata

  • 1. Golden Thorns Lessons in Golden Master Testing From The Gilded Rose Kata
  • 2. Paul Baker @paulbaker3 Husband, Father and Nerd Hacking on stuff since 1999 Dev-ing for money since 2001 First Ruby gig in 2013 Currently at Capshare.com WTF Is This Dude
  • 3. Legacy code can really suck Poorly designed Bloated Buggy Untested or Naively tested Arthritic Code
  • 4. Arthritic Code We’ve all been there... or maybe you haven’t.
  • 5. Right? Not exactly tests.all != tests.useful? Adding useful unit tests can be Hard Expensive Occasionally Impossible We Can Only Go Up From Here
  • 7. Not exactly UnitTests == Dev::GoldStandard Other testing strategies/ tools provide value Nothing replaces the feedback you get from those . . . . . From Therapy To Injury http://blog.thecodewhisperer.com/permalink/integrated-tests-are-a-scam But What About The Cost? Problem Solved! Right….. ?
  • 8.
  • 9. Golden Master/ Guru Checks Output Just go with it man… Assumption: Functions As Designed Don’t CHANGE ANYTHING. But seriously… change everything It’s really not that crazy… I promise J. B. Rainsberger http://blog.thecodewhisperer.com/permalink/surviving-legacy-... There’s A Gem For That Approvals https://github.com/kytrinyx/approvals I Know! ANTI-PATTERN!
  • 10. The Gilded Rose Kata A legacy coding exercise It’s kind of a thing Created by Bobby Johnson in 2011 http://iamnotmyself.com/2011/02/13/refactor-this-the-gilded-rose-kata/ Ported to Ruby by Jim Weirich https://github.com/jimweirich/gilded_rose_kata Commented on by Sandi Metz http://confreaks.tv/videos/railsconf2014-all-the-little-things and Randy Coulman http://confreaks.tv/videos/railsconf2015-getting-a-handle-on-legacy-code amongst others… First Some Background
  • 13. Is this just a terrible idea? Are there ways to do this cheaper? A Few Questions To Consider
  • 14. “All that glitters is not gold” Boy Scout the F*** Out of Your Code Let me know if you give this a try @paulbaker3 Some Parting Thoughts
  • 16. Randy Coulman http://confreaks.tv/videos/railsconf2015-getting-a-handle-on-legacy-code http://randycoulman.com//blog/2014/09/30/refactoring-legacy-code/ Lauren Voswinkel @laurenvoswinkel Jim Weirich https://github.com/jimweirich/gilded_rose_kata Sandi Metz http://confreaks.tv/videos/railsconf2014-all-the-little-things Ryan Davis, Steven Books, and the rest of the Capshare Dev Team Working Effectively with Legacy Code by Michael Feathers Other blog posts http://blog.codeclimate.com/blog/2014/02/20/gold-master-testing/ http://blog.thecodewhisperer.com/permalink/surviving-legacy-code-with-golden-master-and-sampling/ http://iamnotmyself.com/2011/02/13/refactor-this-the-gilded-rose-kata/ Sources, Thanks & Inspiration