Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Confident refactors
Search
Mehdi Lahmam B.
June 19, 2017
Technology
170
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Confident refactors
Mehdi Lahmam B.
June 19, 2017
More Decks by Mehdi Lahmam B.
See All by Mehdi Lahmam B.
Beyond code: Becoming a Product Engineer
mehlah
0
79
Possible to measure developer productivity?
mehlah
0
83
PG FDW FTW
mehlah
0
210
Product culture
mehlah
0
110
OpenAPI and AsyncAPI specifications as contracts
mehlah
0
710
Technical Debt
mehlah
1
330
Data informed growth
mehlah
0
280
Serverless Ruby and AWS Lambda
mehlah
0
200
Middleware all the things
mehlah
2
910
Other Decks in Technology
See All in Technology
検証フェーズはAIの回答を判断するための学習機会
toru_kubota
2
510
継続的なAIコスト最適化
bgpat
1
210
不可逆な意思決定を避けながら10億超の顧客データを AI Ready にするデータ基盤設計
baseballyama
1
160
Oracle Base Database Service 技術詳細
oracle4engineer
PRO
17
120k
形式手法を使って仕様をコーディングしよう
mikanichinose
0
190
ミイダス株式会社 テックチームのご紹介 / MIIDAS Tech Team
miidas
0
160
オブザーバビリティを高める AI エージェント体験を考える / Designing AI Agent Experiences That Enhance Observability
aoto
PRO
2
310
AIは爆速なのに、私が詰まっていた話 ― 音声入力と鳴くマスコットでボトルネックを削る
yama3133
0
530
AI駆動開発、viviONの1年 ── うまくいったこと・いかなかったこと
vivion
0
270
自主式軟體工廠
philipz
0
240
全PRの83%が AIレビューだけでマージできるようになった開発組織は その後どうなったか @2026/10
athug
0
120
いちAWSエンジニアのAI活用を振り返る #devio2026 / devio osaka 2026 kawahara
masahirokawahara
2
410
Featured
See All Featured
Amusing Abliteration
ianozsvald
1
330
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
540
A Modern Web Designer's Workflow
chriscoyier
699
190k
Bash Introduction
62gerente
615
220k
The #1 spot is gone: here's how to win anyway
tamaranovitovic
4
1.2k
Fashionably flexible responsive web design (full day workshop)
malarkey
409
67k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
20k
Building a Scalable Design System with Sketch
lauravandoore
464
34k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
490
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.5k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2.2k
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
570
Transcript
Confident Refactors
Mehdi Lahmam @mehlah
25kV Rails app, started in Feb 2009 Never rewritten 23k+
commits from 52 contributors
Ruby is a massively successful language!
Early success Making it easy to make new things
Later success Making it easy to maintain old things
Today, let’s refactor some legacy code
Today, let’s refactor some legacy code
Refactor - verb To change the design of code without
changing its observable behavior.
Refactor - verb To change in advance of a new
feature or bug fix, making the job easier.
Today, let’s refactor some legacy code
Legacy - noun Old code.
Legacy - noun Code without tests.
Legacy - noun Code that we don’t like.
Legacy - noun Code we don’t understand well enough to
change confidently.
Today, let’s refactor some legacy code
Refactoring is hard
Refactoring legacy code is very hard
Easy to accidentally break functionality
Legacy refactors feels unsafe
Legacy refactors are hard to sell
Business priority Cost / risks
Business priority Cost / risks New features
Business priority Cost / risks New features Bugs fixes
Business priority Cost / risks New features Bugs fixes Testing
Business priority Cost / risks New features Bug fixes Testing
Refactoring
Business priority Cost / risks New features Bug fixes Testing
Refactoring no selling needed easy to sell can often sell very hard to sell
Selling refactoring is hard ⏲ ⛔
Business priority Cost / risks Refactoring
Too much pressure ⏳ ⚒
Refactors are scary
What techniques we have? PDD - Pray Driven Development Fowler’s
refactoring book Characterization testing A/B testing, experiments
Refactors as surgeries
Refactors as surgeries Requires careful planning Follow a clear process
Multiple observations Flexible tools Things can get bloody
1. Plan 2. Cut 3. Record 4. Validate 5. Refactor
6. Verify 7. Compare 8. Fallback 9. Delete Clear process
None
None
None
Cut
Record
Validate ✅
Refactor <Insert magic here />
Verify
Compare ⚖
Fallback
Delete ✂
We dit it
We dit it Time to celebrate hard