Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
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
150
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
63
Sane User Interfaces for Ruby on Rails
this_ahmed
2
170
Compose Software Like Nature Would
this_ahmed
1
200
Welcome to JavaScript
this_ahmed
0
47
Designing & Building RESTful JSON APIs
this_ahmed
4
5.3k
Other Decks in Programming
See All in Programming
251126 TestState APIってなんだっけ?Step Functionsテストどう変わる?
east_takumi
0
300
チームをチームにするEM
hitode909
0
260
Integrating WordPress and Symfony
alexandresalome
0
140
AIコーディングエージェント(skywork)
kondai24
0
130
新卒エンジニアのプルリクエスト with AI駆動
fukunaga2025
0
180
AIコードレビューがチームの"文脈"を 読めるようになるまで
marutaku
0
340
C-Shared Buildで突破するAI Agent バックテストの壁
po3rin
0
360
配送計画の均等化機能を提供する取り組みについて(⽩⾦鉱業 Meetup Vol.21@六本⽊(数理最適化編))
izu_nori
0
140
複数人でのCLI/Infrastructure as Codeの暮らしを良くする
shmokmt
5
2.2k
Navigation 3: 적응형 UI를 위한 앱 탐색
fornewid
1
190
全員アーキテクトで挑む、 巨大で高密度なドメインの紐解き方
agatan
8
19k
分散DBって何者なんだ... Spannerから学ぶRDBとの違い
iwashi623
0
180
Featured
See All Featured
The World Runs on Bad Software
bkeepers
PRO
72
12k
Writing Fast Ruby
sferik
630
62k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
359
30k
Product Roadmaps are Hard
iamctodd
PRO
55
12k
Bash Introduction
62gerente
615
210k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
8.3k
Site-Speed That Sticks
csswizardry
13
990
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.3k
Building Flexible Design Systems
yeseniaperezcruz
329
39k
Optimizing for Happiness
mojombo
379
70k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
132
19k
Building a Scalable Design System with Sketch
lauravandoore
463
34k
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