Hacker News new | ask | show | jobs
by spinlock 3750 days ago
Of your tests break when refactoring, something is wrong. Probably, you're testing the implementation not the behavior.
2 comments

The behaviour of internal components is part of the implementation of the whole application.
In my experience, for any non-trivial application with a non-trivial number of tests, some percentage of those tests, particular the unit tests, will have by accident or carelessness come to rely on internal implementation details that aren't reflected in the result.

Those kinds of "atrophied" tests can make a refactor considerably more painful than it should be.