4 ms·
Red -> Green -> Refactor is important because it indicates that the test genuinely behaves as required. (RED shows you that the test fails when it should: ther
by ronaldx 13y ago
Red -> Green -> Refactor is important because it indicates that the test genuinely behaves as required.
(RED shows you that the test fails when it should: there is good reason why this step should not normally be skipped; then GREEN shows you that the test passes when it should)
- prawks 13y agoParent was suggesting that an existing system's tests should already pass (green) before you monkey with it (red). Although if you're fixing bugs, red-green-refactor can work well.
- AYBABTME 13y agoIt's very possible that without a red test, your green test would be green with inputs for which you intended it to be red. It's not enough to know that the test pass, you need to make sure the test would fail. Otherwise it's like having a cybernetic canary that doesn't need air to survive (great example, isn't it?).
- ollysb 13y agoIf you were expecting the test to fail for some inputs you might as well just add another test case for that scenario.