The cycle for adding new features, including any refactoring, is roughly this: write failing test; code; get to green; make it right. If you’re doing it right, you’re executing a lot of unit tests along the way, sometimes a focused set and sometimes the entire suite.