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
300
Metrics and Monitoring
lagilaper
0
68
Agile Retrospective
lagilaper
0
180
Culture Test
lagilaper
0
190
Introduction to Vagrant and Docker
lagilaper
0
97
Recap of Jordan DeaMattson TechTalk
lagilaper
0
360
Other Decks in Programming
See All in Programming
Codexに役割を持たせる 他のAIエージェントと組み合わせる実務Tips
o8n
3
1.1k
RubyとGoでゼロから作る証券システム: 高信頼性が求められるシステムのコードの外側にある設計と運用のリアル
free_world21
0
230
Swift ConcurrencyでよりSwiftyに
yuukiw00w
0
250
Docコメントで始める簡単ガードレール
keisukeikeda
1
100
あなたはユーザーではない #PdENight
kajitack
4
340
AIとペアプロして処理時間を97%削減した話 #pyconshizu
kashewnuts
1
210
grapheme_strrev関数が採択されました(あと雑感)
youkidearitai
PRO
1
210
CSC307 Lecture 13
javiergs
PRO
0
310
nilとは何か 〜interfaceの構造とnil!=nilから理解する〜
kuro_kurorrr
3
1.8k
文字コードの話
qnighy
44
17k
Codex の「自走力」を高める
yorifuji
0
1.1k
受け入れテスト駆動開発(ATDD)×AI駆動開発 AI時代のATDDの取り組み方を考える
kztakasaki
2
550
Featured
See All Featured
The Cost Of JavaScript in 2023
addyosmani
55
9.8k
Exploring anti-patterns in Rails
aemeredith
2
280
Heart Work Chapter 1 - Part 1
lfama
PRO
5
35k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Designing for Performance
lara
611
70k
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
370
Test your architecture with Archunit
thirion
1
2.2k
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
120
Build your cross-platform service in a week with App Engine
jlugia
234
18k
How to make the Groovebox
asonas
2
2k
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
9.8k
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
220
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!!