Testing and Refactoring Legacy Code

14 Dec 2012

SC London
The place where passionate Software Craftspeople, Community, Experts & Thought Leaders come together
Book your ticket now!

Testing and Refactoring Legacy Code

In this video, we take a piece of crappy Java code with no tests. Our objective is to write tests for it and then refactor to make it better. The code has the most common problems that much larger legacy applications have, like Singletons, static calls and feature envy. It also has some design problems. Fixing that is quite hard, mainly when we need to write all the tests before we start the refactoring. Another rule: We cannot change production code if it is not covered by tests but quite often we need to change the production code in order to be able to test it. How to solve this problem? Well, I hope I can answer all these questions in this video.

If you want to play with the code, clone it from Sandro's Github repository

Related Blogs

Get content like this straight to your inbox!

Codurance Logo

Software is our passion.

We are software craftspeople. We build well-crafted software for our clients, we help developers to get better at their craft through training, coaching and mentoring, and we help companies get better at delivering software.

Latest Blogs




Contact Us

3 Sutton Lane
London EC1M 5PU

Phone: +44 207 4902967

2 Mount Street
Manchester M2 5WQ

Phone: +44 161 302 6795

Carrer de Pallars, 99
08018, Barcelona

Phone: +34 937 82 28 82

Email: hello@codurance.com