Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Working With Legacy Rails Apps
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Ahmed Omran
July 10, 2015
Programming
0
160
Working With Legacy Rails Apps
Ahmed Omran
July 10, 2015
Tweet
Share
More Decks by Ahmed Omran
See All by Ahmed Omran
Compose Software Like Nature Would - RubyConf 2024
this_ahmed
0
71
Sane User Interfaces for Ruby on Rails
this_ahmed
2
180
Compose Software Like Nature Would
this_ahmed
1
210
Welcome to JavaScript
this_ahmed
0
48
Designing & Building RESTful JSON APIs
this_ahmed
4
5.3k
Other Decks in Programming
See All in Programming
OCaml 5でモダンな並列プログラミングを Enjoyしよう!
haochenx
0
110
HTTPプロトコル正しく理解していますか? 〜かわいい猫と共に学ぼう。ฅ^•ω•^ฅ ニャ〜
hekuchan
2
670
なぜSQLはAIぽく見えるのか/why does SQL look AI like
florets1
0
440
コマンドとリード間の連携に対する脅威分析フレームワーク
pandayumi
1
440
TerraformとStrands AgentsでAmazon Bedrock AgentCoreのSSO認証付きエージェントを量産しよう!
neruneruo
4
2.7k
15年続くIoTサービスのSREエンジニアが挑む分散トレーシング導入
melonps
1
150
それ、本当に安全? ファイルアップロードで見落としがちなセキュリティリスクと対策
penpeen
7
2.4k
AIエージェントの設計で注意するべきポイント6選
har1101
7
3.4k
Fluid Templating in TYPO3 14
s2b
0
120
re:Invent 2025 トレンドからみる製品開発への AI Agent 活用
yoskoh
0
720
CSC307 Lecture 04
javiergs
PRO
0
650
GISエンジニアから見たLINKSデータ
nokonoko1203
0
200
Featured
See All Featured
A Soul's Torment
seathinner
5
2.2k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.7k
Evolving SEO for Evolving Search Engines
ryanjones
0
110
Making the Leap to Tech Lead
cromwellryan
135
9.7k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
0
130
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.3k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Chasing Engaging Ingredients in Design
codingconduct
0
110
The Language of Interfaces
destraynor
162
26k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
130
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
9.8k
Transcript
Working With Legacy Rails Apps @this_ahmed
Working With Legacy Rails Apps @this_ahmed
legacy code • untested code (Michael C. Feathers) • code
someone else wrote (old gems, outsourcing, maintainers left) • difficult to work with • risky to change • but serves a useful function
googling legacy code …
every project has legacy code?
None
• learning & experimenting • ambitious applications • big project,
developer churn, hiring outside help • bad code … even with the best of intentions • “Technical debt”
None
–Robert C. Martin “Even the most disciplined development team, knowing
the best principles, using the best patterns, and following the best practices will create messes from time to time.”
in the face of legacy code you can …
None
or…
None
Useful techniques
Rebuild Refactor
–Robert C. Martin “…taking a tangled, opaque, convoluted system and
slowly, gradually, piece by piece, step by step, turning it into a simple, nicely structured, well-designed system.”
Boy Scout Rule Clean up around you work area. Small
fixes; small refractors.
cover and modify • add unit test • test passes
• modify code • test passes
use mock objects to break dependencies
None
mock dependencies
break complicated dependencies with seams
None
seam => put in method + stub
first step to later refactor
i don’t understand this code…
Ask someone
code archeology
code archeology git blame / Github
code archeology search code for context git blame / Github
code archeology project management ticket git blame / Github search
code for context
code archeology git blame / Github project management ticket commit
message search code for context
review • boy scout rule • cover and modify •
break dependencies with mocks and seams • understand code with archeology
some parting thoughts
unit test
None
None
• code review • small git branches • add lots
of context in pull request / commit message