Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Legacy codes
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Kuncara Adi Nugraha
April 01, 2016
Programming
3.2k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Legacy codes
What's legacy codes? What should we do with it?
Kuncara Adi Nugraha
April 01, 2016
Transcript
21 slides
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!!
More Decks by Kuncara Adi Nugraha
See All by Kuncara Adi Nugraha
Recap of Dicoding Events : Continuous Quality and Test Automations
lagilaper
0
320
Metrics and Monitoring
lagilaper
0
94
Agile Retrospective
lagilaper
0
220
Culture Test
lagilaper
0
220
Introduction to Vagrant and Docker
lagilaper
0
120
Recap of Jordan DeaMattson TechTalk
lagilaper
0
380
Other Decks in Programming
See All in Programming
Rails初心者がパスキーを実装してみて大変だったこと
ktombow
0
210
学びを記事・スライド・Xへ高速展開する― AI-assisted Learning Loopで回すコンテンツ生成術
ochtum
0
210
Python Lambdaにおけるテストしやすい設計とAI支援の活用 / Designing Testable Python Lambda Functions with AI
kitano_yuichi
1
340
AI Augmentation Techniques with Liberty
ivargrimstad
1
520
AIコーディング時代のKotest ユニットテストから APIレベルの仕様固定化テストへ
ooga04
0
270
Ruby から Emacs を操作したい
phigasui
0
340
Goコンパイラを作ってGoをもっと理解する / Build a Go compiler to better understand Go
ikura_hamu
0
130
AI時代のFlutter品質設計 — アプリ品質を守るQuality Layers
omatty198
0
380
TS 7.0 で baseUrl が使えなくなった今、パスエイリアスをどうするか
bicstone
2
720
Kotlin JVM用に作られたライブラリのKMPを前提とした再設計
jsoizo
0
160
Distance field of Julia set
kinakomoti321
0
330
はじめてのPLATEAU
nokonoko1203
1
660
Featured
See All Featured
HDC tutorial
michielstock
2
1k
The Curious Case for Waylosing
cassininazir
1
610
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.6k
Chasing Engaging Ingredients in Design
codingconduct
0
400
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
20k
The Language of Interfaces
destraynor
162
27k
Facilitating Awesome Meetings
lara
57
7.2k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.4k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
Thoughts on Productivity
jonyablonski
76
5.5k
Discover your Explorer Soul
emna__ayadi
2
1.3k
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
300