Lock in $30 Savings on PRO—Offer Ends Soon! ⏳
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Legacy codes
Search
Kuncara Adi Nugraha
April 01, 2016
Programming
0
3.2k
Legacy codes
What's legacy codes? What should we do with it?
Kuncara Adi Nugraha
April 01, 2016
Tweet
Share
More Decks by Kuncara Adi Nugraha
See All by Kuncara Adi Nugraha
Recap of Dicoding Events : Continuous Quality and Test Automations
lagilaper
0
300
Metrics and Monitoring
lagilaper
0
65
Agile Retrospective
lagilaper
0
170
Culture Test
lagilaper
0
190
Introduction to Vagrant and Docker
lagilaper
0
95
Recap of Jordan DeaMattson TechTalk
lagilaper
0
360
Other Decks in Programming
See All in Programming
[堅牢.py #1] テストを書かない研究者に送る、最初にテストを書く実験コード入門 / Let's start your ML project by writing tests
shunk031
11
6.2k
All(?) About Point Sets
hole
0
230
React Native New Architecture 移行実践報告
taminif
1
120
CSC305 Lecture 17
javiergs
PRO
0
200
Building AI Agents with TypeScript #TSKaigiHokuriku
izumin5210
5
1.1k
Duke on CRaC with Jakarta EE
ivargrimstad
0
310
OSS開発者の憂鬱
yusukebe
15
12k
CSC305 Lecture 14
javiergs
PRO
0
330
イベントストーミングのはじめかた / Getting Started with Event Storming
nrslib
1
770
Module Harmony
petamoriken
2
580
なあ兄弟、 余白の意味を考えてから UI実装してくれ!
ktcryomm
10
9.4k
Herb to ReActionView: A New Foundation for the View Layer @ San Francisco Ruby Conference 2025
marcoroth
0
210
Featured
See All Featured
Build The Right Thing And Hit Your Dates
maggiecrowley
38
2.9k
How GitHub (no longer) Works
holman
316
140k
Unsuck your backbone
ammeep
671
58k
Site-Speed That Sticks
csswizardry
13
970
YesSQL, Process and Tooling at Scale
rocio
174
15k
Code Review Best Practice
trishagee
73
19k
The Art of Programming - Codeland 2020
erikaheidi
56
14k
Build your cross-platform service in a week with App Engine
jlugia
234
18k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
48
9.8k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.4k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
118
20k
It's Worth the Effort
3n
187
29k
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!!