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
Three Principles To Bring Your Legacy Code Into...
Search
Roland Weisleder
December 11, 2023
Programming
260
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Three Principles To Bring Your Legacy Code Into the Future
Roland Weisleder
December 11, 2023
More Decks by Roland Weisleder
See All by Roland Weisleder
Enforcing Architecture in Legacy Systems
rweisleder
0
11
Architecture as Code in Practice
rweisleder
0
43
Unit Test Your Java Architecture With ArchUnit
rweisleder
0
640
Immer wieder die gleichen Fehler? Nicht mit ArchUnit!
rweisleder
0
400
Alles einsteigen! Einen eigenen Release Train mit Maven umsetzen
rweisleder
0
360
7 Tipps für eine verständliche Git-Historie
rweisleder
0
190
Other Decks in Programming
See All in Programming
[GoCon2026] When Goroutines Are Not Enough: Runtime Locality in High-Throughput Go
takehaya
6
2.3k
AGENTS.md Is Not Enough:Build Skills, Don't Download Them
lx_t
0
120
速く作れる。その次は、速く確かめられる開発へ 〜AIネイティブ開発を支える、Shift Down〜 / Can build fast. Next, moving to development where we can verify fast.
rkaga
5
3.2k
LoopHub - ローカルで動く GitHub で、AI と共同開発
jugyo
1
560
App Storeの外へ──日本のiOSサイドローディング入門 for iOSDC Japan 2026
yuukiw00w
0
220
モバイル交通系ICへのチャージ実例から考える、クロスプラットフォーム開発におけるiOS実機テスト設計とCI運用
yusuga
1
480
{ Android | Kotlin } Gradle Plugin in 2026
ryunen344
1
320
App Intentsのビルドプロセスを支える技術
kntkymt
0
380
20260914 AIエージェント時代のPlatform Engineering LLM基盤とプロダクトの責務境界線
kanfab1
7
2k
iOSDC2026登壇資料.pdf
riofujimon
0
170
GKE で Pod の見方を変えたら、スケールアウト時の挙動を真に捉えられた話
stkk
0
130
Security issues being discussed on Web Platforms
petamoriken
0
960
Featured
See All Featured
A Soul's Torment
seathinner
8
3.6k
Evolving SEO for Evolving Search Engines
ryanjones
0
300
Building Adaptive Systems
keathley
44
3.2k
[SF Ruby Conf 2025] Rails X
palkan
3
1.4k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9.2k
Fireside Chat
paigeccino
43
4k
Code Review Best Practice
trishagee
74
20k
The browser strikes back
jonoalderson
0
1.7k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
1k
Designing for Performance
lara
611
70k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Claude Code のすすめ
schroneko
67
230k
Transcript
@Ro_Wei Roland Weisleder
[email protected]
Three Principles To Bring Your Legacy
Code Into the Future
About Me Independent Software Developer & Consultant Bringing Legacy Java
Systems Into the Future Spring Boot Trainer @ workshops.de Lecturer @ HTW Berlin in/roland-weisleder @rweisleder @Ro_Wei
[email protected]
What is Legacy Code?* • Still in production use •
Relies on outdated technologies • Has insufficient test coverage • Lacks adequate documentation • Expert knowledge unavailable *According to ChatGPT
Big Bang Rewrite? Too time-consuming
What to improve? What you work on anyway
Rewrite or Refactor? Rewrite only with test coverage
Old bugs need to be added to the rewritten system.
Source: https://martinfowler.com/bliki/StranglerFigApplication.html
How to increase test coverage? Add tests for current behavior
How to understand the current behavior?
Where to start?
Source: https://www.commitstrip.com/en/2016/03/03/its-not-working/
Analyze Stack Trace or Thread Dump Source: https://www.jetbrains.com/help/idea/analyzing-external-stacktraces.html
Call Hierarchy
Source: https://twitter.com/codewisdom/status/1154436195126009858
Understand Code
Scratch Refactoring • Learn through refactoring • Make experiments •
Revert everything
Source: https://www.morling.dev/blog/the-code-review-pyramid/
Document Code
Our code is self-documenting.
• What about the input format? • What about malformed
input? • What about null? • What about thrown exceptions?
• What about the return value? * don’t use double
for money…
Suddenly a wild Java update appears
Unit tests are our documentation.
Who has read the tests of their favorite language /
framework / library to understand how to use it?
None
None
not only Don‘t Repeat Yourself but also Documentation Reflects Implementation
Source: https://twitter.com/sweblogtweets/status/1249698475249467393
Test Code
What should I test? The documented behavior.
Use Descriptive Test Names
Concise Implementation Keep relevant stuff together, hide irrelevant stuff
I want to test private methods Private methods are independent
units in disguise. Extract, document and test.
I have to mock everything So the method does nothing
useful? Keep it simple, delete the method.
The code contains hard-to-mock dependencies Current Time Database External Systems
Declare dependencies as parameters vs vs
Declare dependencies as parameters vs
Separate Domain and Infrastructure to simplify testing
Clean Architecture
Code Coverage • Find untested code • Find dead code
Still doing Scratch Refactoring? Revert everything, except the tests. Congratulations!
Time for TDD.
Inverted TDD
Source: https://twitter.com/kentbeck/status/250733358307500032
Improve Code
Source: https://www.morling.dev/blog/the-code-review-pyramid/
Focus on clean APIs
Define Interfaces Input Process Output
Invalid objects …
… vs valid objects
What about null?
Primitive Obsession vs
Source: https://twitter.com/codewisdom/status/1154436195126009858
None
https://www.youtube.com/watch?v=OGZ1JkC-cQc
Key Takeaways Separate Domain and Infrastructure Documentation Reflects Implementation Input
Process Output
Bringing Legacy Code Into the Future Slides: speakerdeck.com/rweisleder Gilded Rose
Kata: github.com/emilybache/GildedRose-Refactoring-Kata Need help with your Legacy Code? Contact me!
[email protected]
in/roland-weisleder @rweisleder @Ro_Wei