0

My manager never did refactoring. I once read Martin Fowler's book Refactoring and apply its tips on a module. So he want me to make a plan on refactoring existing project.The project has no unit-test and my teammates not know much refactoring. He insist me to make a schedule on the process, as to modify which file, how long it take, the final outcome, how many methods will be extracted...

I have recommend him the tips in how-do-you-refactor, but he wants a detailed plan.

Community
  • 1
  • 1
Vacker
  • 216
  • 2
  • 11
  • This is a discussion question, and is really more appropriate for [Programmers](http://programmers.stackexchange.com). Voting to move it there instead. – Ken White Nov 23 '12 at 04:59

1 Answers1

1

Without unit tests, you can't really refactor with confidence. So start there. Don't set out to "unit test everything" or "refactor everything." Just quietly start wherever you are.

Eventually, the code you work on should be noticeably cleaner, which means it will be easier (cheaper) have fewer bugs and be cheaper to maintain & reuse. Those are the things your manager cares about.

Jon Reid
  • 20,545
  • 2
  • 64
  • 95
  • I have began written unit tests.What bothers me is that many a class or method has too many responsibilities,so the unit tests I wrote need me knowing the details or the many side effects ,I can not just test the methods base on their return value. – Vacker Nov 23 '12 at 01:41
  • Then I highly recommend _Working Effectively with Legacy Code_ by Michael Feathers. – Jon Reid Nov 23 '12 at 04:48