At the time of this writing, I have received different definitions about what is legacy code. Some people say that is mainframe code, other people that its structured oriented code such as in the C programming language.
I think I will stick with Michael Feathers definition. "Legacy code is code that does not have tests. No matter how beautiful it is or how object oriented is, code withouth tests are not telling us if we have broken something when we change the behavior of the code".
In his book "Working Effectively with Legacy Code" Michael show us many different ways to handle this type of legacy code, starting with the affirmation in chapter 6 "I don't have much time and I have to change it" it show us that making changes to the code creating some tests and proving that our code is safe save us a lot of time to do other more important things such as going on vacation to a warm beach or playing soccer with your friends.
Give a shot to Michael Feathers book, read it and improve your efficiency at work.
http://www.ibm.com/developerworks/java/library/j-legacytest.html
ReplyDelete