Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Tests took work to produce and provide some sort of information.

It seems foolhardy to start off a process by throwing away information which could inform it.

Not having tests which cover the implementation makes refactoring impossible if the goal of refactoring is to preserve certain salient aspects of the implementation, rather than uproot it entirely.

Why not just start refactoring first. Then see what breaks, and then decide on a case-by-cases who wins: do you keep the refactoring which broke the test, and delete the test? Or do you back out that aspect of the refactoring.



This is my preferred approach as well.

When one does this one hopefully also get a feel for what tests will be useful and which ones will be thrown out early and start writing more of the first ones.

Couple this with a well designed language and a good IDE that can do the trivial refactorings (method rename - including catching overload collisions etc) and it becomes easy to maintain tests.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: