$30 off During Our Annual Pro Sale. View Details »
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Working With Legacy Rails Apps
Search
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
64
Sane User Interfaces for Ruby on Rails
this_ahmed
2
170
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
ローターアクトEクラブ アメリカンナイト:川端 柚菜 氏(Japan O.K. ローターアクトEクラブ 会長):2720 Japan O.K. ロータリーEクラブ2025年12月1日卓話
2720japanoke
0
730
【Streamlit x Snowflake】データ基盤からアプリ開発・AI活用まで、すべてをSnowflake内で実現
ayumu_yamaguchi
1
120
Developing static sites with Ruby
okuramasafumi
0
290
令和最新版Android Studioで化石デバイス向けアプリを作る
arkw
0
400
ID管理機能開発の裏側 高速にSaaS連携を実現したチームのAI活用編
atzzcokek
0
230
著者と進める!『AIと個人開発したくなったらまずCursorで要件定義だ!』
yasunacoffee
0
140
組み合わせ爆発にのまれない - 責務分割 x テスト
halhorn
1
150
配送計画の均等化機能を提供する取り組みについて(⽩⾦鉱業 Meetup Vol.21@六本⽊(数理最適化編))
izu_nori
0
150
Cell-Based Architecture
larchanjo
0
120
まだ間に合う!Claude Code元年をふりかえる
nogu66
5
830
Github Copilotのチャット履歴ビューワーを作りました~WPF、dotnet10もあるよ~ #clrh111
katsuyuzu
0
110
堅牢なフロントエンドテスト基盤を構築するために行った取り組み
shogo4131
8
2.4k
Featured
See All Featured
The Pragmatic Product Professional
lauravandoore
37
7.1k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.6k
Making the Leap to Tech Lead
cromwellryan
135
9.7k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.1k
Done Done
chrislema
186
16k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.6k
Testing 201, or: Great Expectations
jmmastey
46
7.8k
We Have a Design System, Now What?
morganepeng
54
7.9k
YesSQL, Process and Tooling at Scale
rocio
174
15k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.3k
Into the Great Unknown - MozCon
thekraken
40
2.2k
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