Re: Ambiguous Refactoring Solution
Steven Gordon <[email protected]>
| Newsgroups | gmane.comp.programming.refactoring |
|---|---|
| Message-ID | <[email protected]> |
On Fri, Sep 25, 2009 at 1:07 PM, Richard <[email protected]> wrote: > > > > In article <[email protected]>, > > Carfield Yim <[email protected]> writes: > > > Sometime we may like to remove variable that we think we don't use anymore,= > > like > > > > int dog =3D 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 > > ...and without a unit test, you would do things like inspect createDog > for side-effects that must occur, or you wouldn't remove the whole > statement, just the variable declaration because side effects may be > possible. > > Or, holy shit batman!, you could test it manually. And possibly miss testing the one corner case that was addressed by that code. > -- > "The Direct3D Graphics Pipeline" -- DirectX 9 draft available for download > <http://legalizeadulthood.wordpress.com/the-direct3d-graphics-pipeline/> ------------------------------------ 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/