I appreciate TDD and think it indispensable but always write my tests ONLY after I write my source code then refactor accordingly. I can never bring myself to write the test first then the source to pass the test. So I always reverse the process. Is this a bad practice on my part? What are the disadvantages of doing it in reverse like me?
Share
If you don’t write your tests first then it’s arguably not TDD. With TDD you normally write the test, watch it fail, then implement to make it pass.
The advantages over your workflow are:
You can mitigate the risks of all of those points, so it’s down to you whether you want to keep going the way you are or switch to test first.