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
Legacy codes
Search
Kuncara Adi Nugraha
April 01, 2016
Programming
3.2k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Legacy codes
What's legacy codes? What should we do with it?
Kuncara Adi Nugraha
April 01, 2016
More Decks by Kuncara Adi Nugraha
See All by Kuncara Adi Nugraha
Recap of Dicoding Events : Continuous Quality and Test Automations
lagilaper
0
310
Metrics and Monitoring
lagilaper
0
85
Agile Retrospective
lagilaper
0
200
Culture Test
lagilaper
0
210
Introduction to Vagrant and Docker
lagilaper
0
110
Recap of Jordan DeaMattson TechTalk
lagilaper
0
380
Other Decks in Programming
See All in Programming
The Bowling Game- From Imperative to Functional Programming - Part 1
philipschwarz
PRO
0
340
Lean は証明の正しさを確認するためだけのツールって思ってませんか?
inoueasei
1
110
AI時代の仕事技芸論〜ソフトウェア開発で「遊ぶように働く」職人的熟達のすすめ(スクフェス仙台 2026バージョン)
kuranuki
0
720
使用 Meilisearch 建立新聞搜尋工具
johnroyer
0
170
FDEが実現するAI駆動経営の現在地
gonta
2
220
初めてのKubernetes 本番運用でハマった話
oku053
0
130
数百円から始めるRuby電子工作
tarosay
0
100
Generative UI & AI-Assistants for Your Angular Solutions
manfredsteyer
PRO
0
120
エンジニア向け会社紹介/Findy Company Profile
findyinc
6
360k
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
390
今さら聞けない .NET CLI
htkym
0
120
SLOをサービス品質の共通言語にするために 取り組んできたこと
wakana0222
0
550
Featured
See All Featured
Being A Developer After 40
akosma
91
590k
WCS-LA-2024
lcolladotor
0
750
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.5k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.5k
Making the Leap to Tech Lead
cromwellryan
135
10k
[SF Ruby Conf 2025] Rails X
palkan
2
1.2k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.1k
AI: The stuff that nobody shows you
jnunemaker
PRO
9
840
Designing Powerful Visuals for Engaging Learning
tmiket
1
460
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
1
2.1k
Visualization
eitanlees
152
17k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
420
Transcript
Legacy Code Sleman, April 1st, 2016
What is legacy code? Code we’ve gotten from somewhere else
Demoralising code (big ball of mud) Code without unit tests
None
Characteristics Poor Architectures Without tests Poor written documentation Oral documentation
IT’S WORKING!!!
IF IT’S WORKING, THEN WHY CHANGE IT ???
Reasons to change Legacy Code Kill some BUGS! Add new
FEATURES Do some OPTIMISATIONS Add new automations things ( tests, scaling, etc)
None
Reasons not to change Legacy Code It looks ugly I
would like to see nicer code I want to use new shiny tools ….
What do we do? REWRITE?
BOOOOMMMM!!!
STOP!! DON’T REWRITE It takes time Need business analysis Features
will keep coming Breeding new bugs
Working Code is OK
What do we do? You can rewrite but you cannot
rewrite all Fight temptations to refactor a lot of codes DO IT SLOWLY AND CALMLY!!
2 Kinds of Refactoring Edit and Pray Cover and Modify
Edit and Pray Steps Find boundaries Discover the codes Refactor
/ Rewrite Run it and do smoke tests Pray that everything is okay
Cover and Modify Steps Find boundaries Discover the code Start
write tests around the to-be- refactored code Do refactor / rewrite Tests and ensure its working
Find Boundaries Act at one part of code at a
time Domains FTW
Discover the Code Read documentations Interview previous developers Read the
codes Try the codes
Prepare and Write Tests Surround it with tests ( integration,
GUI, unit tests, exploratory tests ) Testing is an investment
Write Code to make it Pass! SELF EXPLANATORY! ^_^
THANKS!!