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
190
Introduction to Vagrant and Docker
lagilaper
0
89
Recap of Jordan DeaMattson TechTalk
lagilaper
0
350
Other Decks in Programming
See All in Programming
Honoとフロントエンドの 型安全性について
yodaka
7
1.5k
Swift Testingのモチベを上げたい
stoticdev
2
150
dbt Pythonモデルで実現するSnowflake活用術
trsnium
0
270
機能が複雑化しても 頼りになる FactoryBotの話
tamikof
1
230
楽しく向き合う例外対応
okutsu
0
710
pylint custom ruleで始めるレビュー自動化
shogoujiie
0
160
Bedrock Agentsレスポンス解析によるAgentのOps
licux
3
940
DevNexus - Create AI Infused Java Apps with LangChain4j
kdubois
0
120
SwiftUI Viewの責務分離
elmetal
PRO
2
280
Boost Performance and Developer Productivity with Jakarta EE 11
ivargrimstad
0
990
第3回関東Kaggler会_AtCoderはKaggleの役に立つ
chettub
3
1.2k
もう少しテストを書きたいんじゃ〜 #phpstudy
o0h
PRO
19
4.2k
Featured
See All Featured
Facilitating Awesome Meetings
lara
53
6.3k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
114
51k
Documentation Writing (for coders)
carmenintech
68
4.6k
Stop Working from a Prison Cell
hatefulcrawdad
268
20k
Reflections from 52 weeks, 52 projects
jeffersonlam
348
20k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
227
22k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
193
16k
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
4
380
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
RailsConf 2023
tenderlove
29
1k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
45
9.4k
Building Applications with DynamoDB
mza
93
6.2k
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!!