News for hackers. Stuff that matters.
Re:Lean Testing or Why Unit Tests Are Worse Than You Think by Jtsummers on Monday July 16, 2018 @01:49PM (#17543305)
> Imagine you have three components, A, B and C. You have written an extensive unit test suite to test them. Later on you decide to refactor the architecture so that functionality of B will be split among A and C. You now have two new components with different interfaces. All the unit tests are suddenly rendered useless. Some test code may be reused but all in all the entire test suite has to be rewritten.

That's not a refactor. That's a rewrite or rearchitecturing. Of course you have to redo unit tests, you've eliminated the units that were being tested.

> What if you decouple two components that are always used together.

If they're always used together, then they were a unit. Why were they decoupled? See the other front page post about Dijkstra's parable for a rather apropos example of where coupling (perhaps not his intended moral) makes sense.

There are no comments on this comment yet.