Do you test your code? What about your tests? Your tests are code, you need to write, refactor and maintain them.
How do you know you added enough tests to capture the behaviour of an untested application in order to refactor it safely?
Discover Mutation Testing, a fun tool to make your code better by introducing bugs.