Background Image
Table of Contents Table of Contents
Previous Page  219 / 478 Next Page
Information
Show Menu
Previous Page 219 / 478 Next Page
Page Background

Don’t forget the “Refactor” in “Red, Green, Refactor”

The whole point of having tests is to allow you to refactor your code! Use them, and

make your code as clean as you can.

Don’t refactor against failing tests

• In general!

• But the FT you’re currently working on doesn’t count.

• You can occasionally put a skip on a test which is testing something you haven’t

written yet.

• More commonly, make a note of the refactor you want to do, finish what you’re

working on, and do the refactor a little later, when you’re back to a working

state.

• Don’t forget to remove any skips before you commit your code! You should

always review your diffs line by line to catch things like this.

Refactor: Removing Hardcoded URLs

|

191