DEV Community

Discussion on: TDD Misconception: Yes, you can write code before test in TDD

Collapse
 
chrisza4 profile image
Chakrit Likitkhajorn • Edited

I believe I haven't redefine TDD. When TDD says that you need to write tests before code, it means production code, not any type of code.

At least that is my interpretation. I don't think it make sense to interprete test before code as test before any type of code. That means you cannot even fire an REPL or write Linux script since it is also some form of code. We can even say TDD forbid the usage of git pull in the bash since it is some type of code.

I think the literal interpretation is both unrealistic and unfair to the practice.

That's why I believe TDD mean test before production code, not any type of code. And my article align with this interpretation.

And again, we can argue wether TDD is something useful or should be ditched. But that is another story. I can say that it have its own upside and downside.