Writing Characterization Tests Before Refactoring
You cannot safely refactor untested legacy code. This lesson teaches characterization testing: capturing the current behavior of legacy Objective-C so refactors preserve it.
The Refactoring Dilemma
Refactoring should not change behavior, but legacy code often has no tests proving what its behavior even is. Characterization tests solve this.
What Is a Characterization Test
A characterization test documents the code as it actually behaves, not as it should behave. It pins current output so any change becomes visible.
All lessons in this course
- Refactoring Legacy Objective-C
- Managing Technical Debt
- Long-Term Maintenance Strategies
- Writing Characterization Tests Before Refactoring