Working Effectively with Legacy Code
Tuesday Apr 24
9:00 AM –
4:00 PM
Room 204
Test Driven Development and Refactoring are powerful tools. With them you can add new codeto systems and make existing code more maintainable. However, refactoring code withouthaving tests in place can be hazardous. This class presents a collection of dependencybreaking and test writing techniques that can be used to get existing code safely under test forrefactoring. These techniques can be used in conjunction with Test Driven Development tobreathe new life into large existing code bases. This class is structured as a set of lectures,discussions, and handson exercises.
Objectives
By the end of this course, you will:
- Understand what legacy code is
- Understand how to break dependencies in legacy code
- Learn a variety of techniques for breaking external dependencies
- Learn a variety of techniques for breaking internal dependencies
- Understand when to employ each of the techniques
- Learn a variety of strategies for code refactoring
- Learn how to identify change points
- Learn how to find an inflection point
- Understand the concept of test coverage for inflection points
- Understand how to write effective tests for legacy codeOutline
Here is a brief course outline for the course:
- Introduction / Testing as a Programmer’s tool
- Seam identification
- Breaking Dependencies – Sensing and Separation
- Breaking Hidden and Manifest Dependencies
- Characterization Testing
- Refactoring Toward Understandability
- Strategies for Getting Large Methods under Test
- Dealing with Deeply Nested Conditionals
- Planning LargeScale Refactoring and Technical Debt Reduction