Refactoring Legacy Code guided by Simple Design
Are you frustrated by the many trivial examples that show up when you google "refactor legacy code"? How do you translate these examples to your real-world code base? Sometimes it's just easier to give up on the refactoring and increased test coverage, reserving these techniques for the ever elusive greenfield project. To help you with this dilemma, Nayan will walk through a real legacy Java code base, and perform some safe refactorings required to bring the code under test. All of this will be done under the guidance of the Four Rules of Simple Design (Pass the tests, DRY, Reveal intent, Minimize moving parts).
Outline/structure of the Session
I have a prepared local git repository of the codebase and the refactorings. I will step through the various commits to show how the code is evolving as the refactorings are made. This approach keeps people engaged in the interesting bits, while fast forwarding through the slow bits. I will be constantly engaging the audience in discussion about techniques and concepts.
- Understanding of the 4 rules of Simple Design
- Understanding the prerequisites of refactoring any legacy code
- Understanding of Characterization Tests
- Basic Understanding of Mocking
- Some handy IDE shortcuts