« Working and having fun with legacy code
December 6, 2006 • ☕️ 1 min read
A lot of collegues and friends told me to read Working Effectively with legacy code and one of these days I’ll. In the meanwhile I’ve joined a project were we work with only legacy code and I’m having fun reading huuuge classes with huuuge methods, no patterns (only a lot of crap singletons!) and of course, no code coverage.
Why fun?
Cos we setted up some ant tasks: CheckStyle to find out the hotspots of the application (ie where the code smells more!), Simian to find out the copy and paste on the code, and Abbot to perform automated funcional tests on the Swing GUI.
All together runs on Cruise Control.
Abbot is very very nice and powerful: you can record the user operation on the GUI, the test is written in xml and then you can run it from a Junit class. You can also write some “scripts”, means that you can write some java code and then put these expressions in your xml test.