DEV Community

Discussion on: 100 days practicing TDD

Collapse
 
thiagoa profile image
Thiago Araújo Silva

"You don't need to practice TDD at the nano cycle" - that makes sense, but in my experience, it's always a good practice to at least take the opposite direction once: do red-green in one cycle but make your test fail intentionally after that. I've caught many bugs because I assumed my test was right but it wasn't. And the green (without a red) was just a false-positive.

TLDR: I always make my tests fail to prove I am doing the right thing, it doesn't matter how obvious it all may seem, I am usually surprised by how often I am wrong. Thanks for sharing your experience!

Collapse
 
rubberduck profile image
Christopher McClellan

“Never trust a test you haven’t personally seen fail.”

Best advice I’ve ever gotten. I don’t get bitten by false positives anymore.