Test Maintenance Cost
Learn the cost of maintaining Unit tests.
The change to the interface with Profile
broke a number of tests in ProfileTest
. We need to invest some effort to fix the tests, which highlights one of the costs of using unit tests in the first place; they need to be maintained regularly.
Refactoring
Refactoring is supposed to be an activity where we change the implementation of the code without changing its behavior.
Our tests are supposed to be a reflection of the program’s behavior. However, the reality is that we are changing the behavior of our classes in terms of how we expose that behavior through the classes’ interfaces.
We accept the cost of fixing broken tests because their value can be far greater than the effort we put into them.
There is certainly some benefit of being able to make changes without the worry of breaking other codes, especially ...