News for hackers. Stuff that matters.
Re:Is it a Good Idea to Write Tests for Legacy Code? by prawks on Wednesday November 20, 2013 @07:29AM (#6767607)
Parent 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.

Re:Is it a Good Idea to Write Tests for Legacy Code? by AYBABTME on Wednesday November 20, 2013 @07:45AM (#6767655)
It'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?).

Re:Is it a Good Idea to Write Tests for Legacy Code? by ollysb on Wednesday November 20, 2013 @09:02AM (#6767980)
If you were expecting the test to fail for some inputs you might as well just add another test case for that scenario.