You _could_ just assume your test is correctly written, but I personally prefer to be sure by seeing it red at least once.
You _could_ just assume your test is correctly written, but I personally prefer to be sure by seeing it red at least once.
I'm not arguing against red tests. I'm arguing for them.
What I'm arguing against is 1. writing the finished code, 2. writing green tests to "prove" the code correct, 3. trying to sabotage the finished code to "prove" that the tests works by making them red.
Sounds crazy? That was what OP said he was doing!
Anyway, we all agree testing is good. And that a test you've never seen fail is bad. Personally, I try to delete exploratory code and try to use tests to drive out the _real_ implementation, but I'm going to admit that at least sometimes I'll write code that's inherently "safe", and then add a test afterwards for garbage inputs, for example.