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
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
75
Agile Retrospective
lagilaper
0
190
Culture Test
lagilaper
0
200
Introduction to Vagrant and Docker
lagilaper
0
100
Recap of Jordan DeaMattson TechTalk
lagilaper
0
370
Other Decks in Programming
See All in Programming
ソースコード→AST→オペコード、の旅を覗いてみる
o0h
PRO
1
130
属人化しないコード品質の作り方_2026.04.07.pdf
muraaano
0
350
Surviving Black Friday: 329 billion requests with Falcon!
ioquatix
0
3.1k
mruby on C#: From VM Implementation to Game Scripting (RubyKaigi 2026)
hadashia
2
1.8k
継続的な負荷検証を目指して
pyama86
3
1.2k
「OSSがあるなら自作するな」は AI時代も正しいか ── Build vs Adopt の新しい判断基準
kumorn5s
7
2.7k
(Re)make Regexp in Ruby: Democratizing internals for the JIT
makenowjust
3
1.1k
運転動画を検索可能にする〜Cosmos-Embed1とDatabricks Vector Searchで〜/cosmos-embed1-databricks-vector-search
studio_graph
3
930
20年以上続くプロダクトでも使い続けられる静的解析ツールを求めて
matsuo_atsushi
0
150
PHPでローカル環境用のSSL/TLS証明書を発行することはできるのか? #phpconkagawa
akase244
0
370
Hive Metastoreを通して学ぶIceberg REST Catalog ― 仕様から実装まで
okumin
0
120
ハーネスエンジニアリングにどう向き合うか 〜ルールファイルを超えて開発プロセスを設計する〜 / How to approach harness engineering
rkaga
28
22k
Featured
See All Featured
GitHub's CSS Performance
jonrohan
1033
470k
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
360
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
210
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
390
How to Think Like a Performance Engineer
csswizardry
28
2.6k
Scaling GitHub
holman
464
140k
Are puppies a ranking factor?
jonoalderson
1
3.4k
My Coaching Mixtape
mlcsv
0
130
WENDY [Excerpt]
tessaabrams
10
37k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
0
230
Java REST API Framework Comparison - PWX 2021
mraible
34
9.3k
Amusing Abliteration
ianozsvald
1
170
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!!