November 2024
Intermediate to advanced
300 pages
7h 12m
English
Refactoring—changing the implementation of a solution without changing its behavior—should not normally break tests. Here, however, you did make a behavioral change due to a deficiency in the Profile interface. Your updated design now exposes the score method’s behavior in a different manner than before, hence the broken tests. You might consider that your refactoring “pushed out a change to the interface.”
Sure, you must spend time to fix the tests. In this case, having tests in the first place enabled you to recognize and fix a faulty design.
You’ve learned throughout this book the potential benefits of unit tests:
Read now
Unlock full access