Re: Ambiguous Refactoring Solution

Carfield Yim <[email protected]>
Newsgroups gmane.comp.programming.refactoring
Message-ID <[email protected]>
Sometime we may like to remove variable that we think we don't use anymore, like

int dog = createDog();

however in method createDog(), it may do more than just return a dog
and remove that line cause somthing else fail.

With unit test we can prevent problem like that, of course if you
don't you will make mistake then it is fine

On Friday, September 25, 2009, Richard <[email protected]> wrote:
>
> In article <[email protected]>,
>     Adam Sroka <[email protected]>  writes:
>
>> I think you may be misunderstanding what I mean when I say to cover
>> with tests before you refactor.
>
> No, I don't misunderstand at all.
>
> You didn't really answer any of the questions I posted, but instead
> assumed I didn't understand what you were saying.
>
> There are plenty of times where I have enough confidence in automated
> refactorings that I don't feel the need to write a covering test
> before performing the refactoring.  Rename and Extract Method are the
> two most common refactorings used by me, and probably by anyone who
> refactors.  With good automated support for these refactorings, I
> don't feel I'm "living dangerously" by applying them from my IDE on
> code that is uncovered by tests.
> --
> "The Direct3D Graphics Pipeline" -- DirectX 9 draft available for download
>  <http://legalizeadulthood.wordpress.com/the-direct3d-graphics-pipeline/>
>
>       Legalize Adulthood! <http://legalizeadulthood.wordpress.com>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>
>


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

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.