3 ms·
> Developers should be able to freely refactor the internal design of a class as long as the public API remains unchanged Is refactoring the only reason for do
by eecks 11y ago
> Developers should be able to freely refactor the internal design of a class as long as the public API remains unchanged
Is refactoring the only reason for doing this? To me it seems that when a developer refactors code they should also refactor the tests.
If everything (including private methods) are tested then the refactoring should be easier because they know ALL the code is working in the way it was tested. If there are a bunch of private methods that aren't tested then refactoring them could introduce new bugs that aren't covered in the unit tests testing the public API.