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
55
Agile Retrospective
lagilaper
0
140
Culture Test
lagilaper
0
180
Introduction to Vagrant and Docker
lagilaper
0
87
Recap of Jordan DeaMattson TechTalk
lagilaper
0
340
Other Decks in Programming
See All in Programming
Kotlin2でdataクラスの copyメソッドを禁止する/Data class copy function to have the same visibility as constructor
eichisanden
1
120
offers_20241022_imakiire.pdf
imakurusu
2
360
讓數據說話:用 Python、Prometheus 和 Grafana 講故事
eddie
0
350
Boost Performance and Developer Productivity with Jakarta EE 11
ivargrimstad
0
810
Tuning GraphQL on Rails
pyama86
2
1k
ECSのサービス間通信 4つの方法を比較する 〜Canary,Blue/Greenも添えて〜
tkikuc
11
2.3k
GitHub Actionsのキャッシュと手を挙げることの大切さとそれに必要なこと
satoshi256kbyte
5
390
ピラミッド、アイスクリームコーン、SMURF: 自動テストの最適バランスを求めて / Pyramid Ice-Cream-Cone and SMURF
twada
PRO
9
980
アジャイルを支えるテストアーキテクチャ設計/Test Architecting for Agile
goyoki
7
2.8k
Realtime API 入門
riofujimon
0
100
PHP でアセンブリ言語のように書く技術
memory1994
PRO
1
150
qmuntal/stateless のススメ
sgash708
0
120
Featured
See All Featured
Designing for Performance
lara
604
68k
The Power of CSS Pseudo Elements
geoffreycrofte
72
5.3k
The Pragmatic Product Professional
lauravandoore
31
6.3k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
3
370
Statistics for Hackers
jakevdp
796
220k
Designing Experiences People Love
moore
138
23k
Producing Creativity
orderedlist
PRO
341
39k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
GraphQLとの向き合い方2022年版
quramy
43
13k
Keith and Marios Guide to Fast Websites
keithpitt
408
22k
RailsConf 2023
tenderlove
29
880
Thoughts on Productivity
jonyablonski
67
4.3k
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!!