$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
66
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
公共交通オープンデータ × モバイルUX 複雑な運行情報を 『直感』に変換する技術
tinykitten
PRO
0
160
令和最新版Android Studioで化石デバイス向けアプリを作る
arkw
0
450
AtCoder Conference 2025
shindannin
0
580
リリース時」テストから「デイリー実行」へ!開発マネージャが取り組んだ、レガシー自動テストのモダン化戦略
goataka
0
140
GISエンジニアから見たLINKSデータ
nokonoko1203
0
180
SwiftUIで本格音ゲー実装してみた
hypebeans
0
500
LLM Çağında Backend Olmak: 10 Milyon Prompt'u Milisaniyede Sorgulamak
selcukusta
0
130
tparseでgo testの出力を見やすくする
utgwkk
2
280
Developing static sites with Ruby
okuramasafumi
0
330
AIエージェントの設計で注意するべきポイント6選
har1101
5
2.4k
tsgolintはいかにしてtypescript-goの非公開APIを呼び出しているのか
syumai
7
2.3k
GoLab2025 Recap
kuro_kurorrr
0
780
Featured
See All Featured
Highjacked: Video Game Concept Design
rkendrick25
PRO
0
250
Large-scale JavaScript Application Architecture
addyosmani
515
110k
A Modern Web Designer's Workflow
chriscoyier
698
190k
The Power of CSS Pseudo Elements
geoffreycrofte
80
6.1k
The #1 spot is gone: here's how to win anyway
tamaranovitovic
1
870
The SEO identity crisis: Don't let AI make you average
varn
0
39
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
150
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
55k
Color Theory Basics | Prateek | Gurzu
gurzu
0
150
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
110
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
0
2.2k
Being A Developer After 40
akosma
91
590k
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