I’ve started playing the TDD game again in Clojure but I had a bit of a shock. I copied an example out of a book, wrote some code and fixed it so the test passed. I then saw something else I could test, so wrote my own test and that passed too.
A few minutes later I noticed I’d made a typo in the 2nd test. It shouldn’t have been passing. Does this happen often in TDD? Is this a good reason to write the test first, to check it knows how to fail?