3 ms·
I think you misunderstand. 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
by josteink 8y ago
I think you misunderstand.
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!
- swish_bob 8y agoIt's quite possible that he's testing after. It's implied, but it isn't necessarily the case. 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.
- ramblerman 8y agoI'm pretty sure everyone understood. There are many ways write code.