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
たのしいparse.y
ydah
3
120
Effective Signals in Angular 19+: Rules and Helpers @ngbe2024
manfredsteyer
PRO
0
140
テストコードのガイドライン 〜作成から運用まで〜
riku929hr
4
560
コンテナをたくさん詰め込んだシステムとランタイムの変化
makihiro
1
130
Effective Signals in Angular 19+: Rules and Helpers
manfredsteyer
PRO
0
100
これでLambdaが不要に?!Step FunctionsのJSONata対応について
iwatatomoya
2
3.7k
CQRS+ES の力を使って効果を感じる / Feel the effects of using the power of CQRS+ES
seike460
PRO
0
130
開発者とQAの越境で自動テストが増える開発プロセスを実現する
92thunder
1
190
テストコード書いてみませんか?
onopon
2
120
HTTP compression in PHP and Symfony apps
dunglas
2
1.7k
Refactor your code - refactor yourself
xosofox
1
260
Cloudflare MCP ServerでClaude Desktop からWeb APIを構築
kutakutat
1
550
Featured
See All Featured
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
59k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5.1k
VelocityConf: Rendering Performance Case Studies
addyosmani
326
24k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
0
98
Designing Dashboards & Data Visualisations in Web Apps
destraynor
229
52k
Making the Leap to Tech Lead
cromwellryan
133
9k
Six Lessons from altMBA
skipperchong
27
3.5k
Building Better People: How to give real-time feedback that sticks.
wjessup
365
19k
Fontdeck: Realign not Redesign
paulrobertlloyd
82
5.3k
The Pragmatic Product Professional
lauravandoore
32
6.3k
Designing for Performance
lara
604
68k
How to train your dragon (web standard)
notwaldorf
88
5.7k
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!!