RE: Re: Ambiguous Refactoring Solution
"Donaldson, John (GEO)" <[email protected]>
| Newsgroups | gmane.comp.programming.refactoring |
|---|---|
| Message-ID | <8A89F8BA0CF8D14BB5E18AEEBBAC36EF6F8361022D@GVW1121EXC.americas.hpqcorp.net> |
Olof, > But again - if there is no driving force (fixing errors, adding new > use cases), I would wait with refactoring. Of course, one driving > force could be the will to learn refactoring.. I'm a little bit worried about this direction. I mean, in the cycle red-green-refactor, we have no motive for the refactoring, other than some nebulous concept of code goodness. So, if you see a class that is too big, and you have some time to spend on improving your code base - then why not? John D. -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Olof Bjarnason Sent: 23 September 2009 09:11 To: [email protected] Subject: Re: [refactoring] Re: Ambiguous Refactoring Solution 2009/9/23 Donaldson, John (GEO) <[email protected]> > > > > Bryan, > > > I do not have tests for the class. > > The reason is that I don't feel tests on this class will pay for themselves. Tests are invaluable when doing refactorings. Adding tests after the code is written can be painful - but it will also guide you on what refactorings to do (to make the functionality encapsulated by the class testable). For example, you might find certain methods hard to test from the outside - then move them to a separate class and make it public/testable. There you go, you've refactored the class. But again - if there is no driving force (fixing errors, adding new use cases), I would wait with refactoring. Of course, one driving force could be the will to learn refactoring.. ------------------------------------ Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/refactoring/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/refactoring/join (Yahoo! ID required) <*> To change settings via email: mailto:[email protected] mailto:[email protected] <*> To unsubscribe from this group, send an email to: [email protected] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/