3 ms·
> If the tests are too complex for anyone to change the code, the the code is too complex. No, more than that, it's a sign that the tests are not just testing
by DarkWiiPlayer 6y ago
> If the tests are too complex for anyone to change the code, the the code is too complex.
No, more than that, it's a sign that the tests are not just testing for how code behaves, but also its implementation details.
With well-written tests, you can completely re-structure some code and, if it still does the same thing, the tests for that code will still pass.
If the code being changed has several components with their own tests, then either those components have no interface change, in which case the previous paragraph applies to them, or the do, in which case their tests should be easy to adapt.