Step 3: Refactor

Arguably the most important step out of the three, and the easiest to forget, refactoring is where you go back over your test and solution and make any necessary adjustments in the spirit of improving your overall design. With the tests at your back, you are now free to make changes.

Here you can extract methods, rename variables, and the like. It’s a crucial step because it’s here where you really improve your design and make it more maintainable. In step 2, you are making the tests pass. In step 3, you are making them pass in style.

Once you finish with refactoring, you are then free to grab another test and repeat the process all over again. You continue to do this until you can think of no more tests, or your system does ...

Get The Way of the Web Tester now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.