Live Refactoring Session:
Getting rid of dirty code
A typical refactoring situation: Untested legacy
code, written in Java 5, 14 years ago. Without tests we cannot
touch the code, but without touching and understanding the code
we cannot write tests. Chicken-and-egg problem! What to do?
In this live hacking I will refactor a small Sudoku Brute Force
Solver. The code is anything but bad, but its age shows. In short
sections we want to give the legacy code a rejuvenating treatment.
In doing this, I want to introduce you to my personal approach
when refactoring untested legacy code.
Among many other things, we will cover:
- Code readability
- General OO
- Immutable Classes
- Modern IO
- Java 8 Streams
I recommend that you familiarize yourself with the Sudoku rules
and check the original code beforehand: