RE: Ambiguous Refactoring Solution

"Donaldson, John (GEO)" <[email protected]>
Newsgroups gmane.comp.programming.refactoring
Message-ID <8A89F8BA0CF8D14BB5E18AEEBBAC36EF6F83F53097@GVW1121EXC.americas.hpqcorp.net>
Keith,

I guess the lesson here is: "if you only have manual tests, rerun them manually as you change things". (As you say " At some point, I tried manually testing the code". I suggest you waited too long).

What you'd like to do is automate all of your manual tests before really cutting into the code. But if you can't then at least rerun your manual tests regularly. That way you will know if you break something.

I don't think you should take this experience as completely negative in fact:
- you will value good, fast, automated tests more in the future
- you have a really good understanding of the moves you can make on the code, so next time will be much faster.

John D.

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Keith Ray
Sent: 29 September 2009 06:37
To: [email protected]
Subject: Re: [refactoring] Ambiguous Refactoring Solution

Once upon a time, I had a 600-line C++ class (or two) that I wanted to
refactor. This was before I had automated tests, and I did not have
automated refactoring tools (even today, refactoring tools for C++ are
rather very minimal when compared to those for Java and these tool can be *
buggy*).

So I spent a weekend improving the code.

At some point, I tried manually testing the code. It no longer worked. I
really had no way to determine at what point my changes made the code no
longer work, since I didn't do frequent manual testing of the code while I
was refactoring it. I didn't have Eclipse's history capabilities, or similar
local repository functionality.

So I had to throw away the changed code.

It's not an experience that I would like to repeat.



------------------------------------

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/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.