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
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
290
Metrics and Monitoring
lagilaper
0
57
Agile Retrospective
lagilaper
0
140
Culture Test
lagilaper
0
180
Introduction to Vagrant and Docker
lagilaper
0
88
Recap of Jordan DeaMattson TechTalk
lagilaper
0
340
Other Decks in Programming
See All in Programming
どうして僕の作ったクラスが手続き型と言われなきゃいけないんですか
akikogoto
1
120
Webの技術スタックで マルチプラットフォームアプリ開発を可能にするElixirDesktopの紹介
thehaigo
2
1k
タクシーアプリ『GO』のリアルタイムデータ分析基盤における機械学習サービスの活用
mot_techtalk
4
1.5k
OSSで起業してもうすぐ10年 / Open Source Conference 2024 Shimane
furukawayasuto
0
110
Less waste, more joy, and a lot more green: How Quarkus makes Java better
hollycummins
0
100
Tauriでネイティブアプリを作りたい
tsucchinoko
0
370
距離関数を極める! / SESSIONS 2024
gam0022
0
290
Nurturing OpenJDK distribution: Eclipse Temurin Success History and plan
ivargrimstad
0
960
ふかぼれ!CSSセレクターモジュール / Fukabore! CSS Selectors Module
petamoriken
0
150
とにかくAWS GameDay!AWSは世界の共通言語! / Anyway, AWS GameDay! AWS is the world's lingua franca!
seike460
PRO
1
900
CSC509 Lecture 11
javiergs
PRO
0
180
OnlineTestConf: Test Automation Friend or Foe
maaretp
0
110
Featured
See All Featured
Raft: Consensus for Rubyists
vanstee
136
6.6k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
126
18k
Faster Mobile Websites
deanohume
305
30k
Making Projects Easy
brettharned
115
5.9k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
229
52k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
4 Signs Your Business is Dying
shpigford
180
21k
GraphQLとの向き合い方2022年版
quramy
43
13k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
109
49k
Product Roadmaps are Hard
iamctodd
PRO
49
11k
It's Worth the Effort
3n
183
27k
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!!