Monday, January 2nd, 2012 11:30am
Evening Meetings have been canceled since December 2010.
Meeting Location: okcCoCo (directions)
Abstract
In Working Effectively with Legacy Code (Welc hereafter), Michael Feathers defines legacy code as code without automated tests – I like to add to that definition “that someone depends upon, e.g., in production”.
Legacy Code is hard to work with… Or is it? Modern mocking tools make creating what Michael Feathers calls a “link seam” easy, language-driven rather than build driven, fast, reliable, and, frankly, cool as hell. I like to call this a “dynamic link seam” instead of a boring old link seam. The former is cool, fast, automated, and built into the language (or a library), while the latter requires custom build scripts, custom build targets, and may, depending on the language, multiple executables.
We’ll take a look at some legacy code and use a modern mocking tool, http://www.typemock.com/typemock-isolator-product3, to write some tests to exercise the production code. We will then do some quick Welc-based refactorings on the code to see:
- How to do it
- Does it improve the code
- Do the tests age well
- What happens if we were to use the modern mocking tool on the “after” code
- Does this suggest anything about having all that power at your fingertips?
This is a code-intensive discussion. Given the time length, we’ll review already-written examples rather than write them on the fly but the point should be the same. We will do the Welc-based refactorings interactively, however.
About Brett Schuchert
Brett Schuchert has 20+ years of teaching experience and over 17 years of experience with object technology. He has worked extensively in developing software, training, mentoring, and consulting using Java, C++ and Smalltalk as well as software process and requirements analysis both locally and internationally.