Refactoring Legacy Code

Description

"To me, legacy code is simply code without tests." ~ Michael Feathers

Refactoring legacy code is difficult and risks introducing defects. In this workshop a set of techniques is learned and practised to make refactoring legacy code safer.

Refactoring is a set of skills. We use refactoring on code and tests, to ensure we will be able to maintain our code and change it quickly the next time we need to change it. While it is easy to do with tests, it is harder (but even more essential) to do with legacy code.

Outline

In this 2-day workshop, we'll try our hands at different techniques of refactoring. We'll discuss naming methods, code extraction, practice refactoring before and after tests, and understand how to refactor legacy code to make it more testable. The objective is to learn the principles of simple design and apply them through refactoring for better code.

Techniques used:

  • Golden Master
  • System Tests
  • Isolate and Replace
  • Rename for better understanding
  • Characterization Tests
  • Mikado Method

Key learning outcomes

After this workshop you will be able to:

  • Safely make changes to an existing complex code base.
  • Prepare your existing legacy code for unit testing.
  • Refactor for better design with the aid of tests.

Target Audience

This workshop is for developers who are working with legacy code. Some unit testing experience is expected. Attendees need to bring a laptop with their favourite IDE in their favourite language (it doesn't matter which one), and a testing framework.

More Information

  • Location: On-site training
  • Languages: German / English