|
|
|
|
|
by vigilant
3674 days ago
|
|
My experience is that more often than not, unit tests get thrown away in aggressive refactorings, and system level tests survive. If you have a system that depends on units A, B and C, and refactor it to use a totally different structure divided into units D, E and F, then the unit tests for A B and C get thrown away, as they don't really have an equivalent in D, E and F. But the system level test stays, as the system as a whole does the same thing. So, the system level test is what guarantees the safety of the refactor. That is not always the case, but that happens in most of the large refactorings i've been involved in. |
|
It doesn't invalidate the fact that unit tests increase your confidence in your own code.