

Write unit tests? Start deleting them - ShaunCodeweaver
http://codeweavers.wordpress.com/2012/01/21/write-unit-tests-start-deleting-them/

======
ColinWright
My understanding is that Unit Tests are intended to protect you while
refactoring. Refactoring is not intended to change implementation or purpose,
it is intended to restructure without such changes. As such, Unit Tests should
(pretty much) never be broken by true refactoring.

Enhancement, improvement and extension are all likely to break Unit Tests,
because they can easily require that you change the way things currently work.
In this case end-to-end tests are what you need, to make sure your system is
producing the right results, including the new enhancements, but especially
including the previous results.

In my experience, you can't make substantial improvements to a system with all
Unit Tests in place and untouched.

Equally in my experience, with comprehensive Unit Tests you can refactor
without fear, and constantly ensure your code is clean and ready for the next
phase of development.

~~~
lelele
Refactoring can impact your unit interface too, and when that happens you'll
have to refactor your tests accordingly. What you don't want while refactoring
is being stuck with your old interfaces.

~~~
ShaunCodeweaver
Exactly. Refactoring is the process of changing code without changing
behaviour. If that means you change some tests so be it. There is no rule to
say that you can't do this, but many devs seem to fear this.

