Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
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
91
Agile Retrospective
lagilaper
0
210
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
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
450
UPDATE をやめる — EF Core でマスタをバージョン管理する
panda728
PRO
0
1k
[Rails World 2026] Durable orchestration on Rails: from continuation to workflow
palkan
1
400
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
370
re:Inventに行く前に知っておきたい現地参加のノウハウ
nokomoro3
0
290
速習iPhone Duo対応
yuukiw00w
2
910
Streamlitで実現する自然言語データアプリ開発
ayumu_yamaguchi
1
330
巨大モノリシックアプリ モダン化大作戦
ktcryomm
1
1.2k
UnityでSystem.Net.WebSocketsなWebSocketサーバが動かないのでUnity Monoのコードを覗いてみた / about implementing websocket server with unity mono
drumath2237
1
510
テストを司るデーモンに会いに行く 〜隔離した仮想マシンでテストを通すまで〜
h1d3mun3
1
600
モジュールの視点からSwiftを読み解く #iosdc
s_shimotori
0
290
ソニーのクラウド共通基盤の変遷とAI時代の開発スタイルに合わせた進化 / The Journey of Sony’s Common Cloud Platform and Its Evolution for AI-Native Development
kenjiyoneyama
0
200
Featured
See All Featured
Optimising Largest Contentful Paint
csswizardry
37
4k
Bash Introduction
62gerente
615
220k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.3k
Java REST API Framework Comparison - PWX 2021
mraible
34
9.7k
GitHub's CSS Performance
jonrohan
1033
470k
The Curious Case for Waylosing
cassininazir
1
550
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.9k
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
500
Build your cross-platform service in a week with App Engine
jlugia
234
19k
Git: the NoSQL Database
bkeepers
PRO
432
67k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2.1k
Embracing the Ebb and Flow
colly
88
5.2k
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!!