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
150
Culture Test
lagilaper
0
180
Introduction to Vagrant and Docker
lagilaper
0
88
Recap of Jordan DeaMattson TechTalk
lagilaper
0
350
Other Decks in Programming
See All in Programming
動作確認やテストで漏れがちな観点3選
starfish719
6
1k
Multi Step Form, Decentralized Autonomous Organization
pumpkiinbell
1
750
『GO』アプリ データ基盤のログ収集システムコスト削減
mot_techtalk
0
120
CSS Linter による Baseline サポートの仕組み
ryo_manba
1
110
データベースのオペレーターであるCloudNativePGがStatefulSetを使わない理由に迫る
nnaka2992
0
150
メンテが命: PHPフレームワークのコンテナ化とアップグレード戦略
shunta27
0
120
Software Architecture
hschwentner
6
2.1k
Lottieアニメーションをカスタマイズしてみた
tahia910
0
130
Conform を推す - Advocating for Conform
mizoguchicoji
3
690
SpringBoot3.4の構造化ログ #kanjava
irof
2
1k
JavaScriptツール群「UnJS」を5分で一気に駆け巡る!
k1tikurisu
9
1.8k
GoとPHPのインターフェイスの違い
shimabox
2
190
Featured
See All Featured
Code Reviewing Like a Champion
maltzj
521
39k
BBQ
matthewcrist
87
9.5k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
21
2.5k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
233
17k
Product Roadmaps are Hard
iamctodd
PRO
50
11k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
40
2k
The Pragmatic Product Professional
lauravandoore
32
6.4k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
Unsuck your backbone
ammeep
669
57k
Side Projects
sachag
452
42k
Navigating Team Friction
lara
183
15k
Bash Introduction
62gerente
611
210k
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!!