Legacy Code
(lightning edition)
by That TDD Fellow
Oleksii Fedorov
@waterlink000
What is legacy code?
Lets define "legacy code" for the purpose of this talk.
- inherited code
- created by someone in the past
- (other programmers, company)
Slows down current development
- hard to understand
- have near to no test suite
- (or test suite is not helpful)
What can we do about that?
We should not blame anyone
It is our responsibility to fix that
.. over time ..
.. one small step at a time ..
"Big Refactoring Project" is not a solution
- business needs new features yesterday
- you will rush to complete that "Big Project"
- and will make another mess
Problem A: Afraid to clean up
because it will break
Solution: Rely on the test suite
Problem B: There is no test suite
- or near to no test suite
- or it is not reliable
Solution: Create this test suite
But be LEAN about that
prioritize parts of legacy code (by frequency of change)
i.e.: when faced with new feature, that touches legacy code:
Make change easy
i.e.:
- increase test coverage for related functionality
- clean up relevant code
Be faster one small step at a time
While delivering increasing business value
0
Legacy Code
(lightning edition)
by That TDD Fellow
Oleksii Fedorov
@waterlink000