Conclusion

We are safe: Do your changes

We successfully applied the ‘cover’ part of the ‘Cover and modify’ technique. Tests cover our code, and we can now start to make our changes. While making our changes, we can continuously run our tests. We will immediately see when a bug is introduced that breaks our tests. We don’t have to wait to find the bug in production two months after we made the change. The change can be deployed even during a running project!

The test may break, but it’s intended to change the function’s behavior. In this case, we need to adjust the test to the new requirements. But we can be sure; we only changed what we wanted to change.

Last modified August 24, 2020