DEV Community


Red, Green and Refactor in TDD

helpmichaelcode profile image HelpMichaelCode ・1 min read

I’m new to this concept of TDD and usually what other developers would do is write up their functionality and write up a unit test afterwards. My question is, what’s the difference between writing test first following the red, green and refactor pattern and writing code first then testing it.

Discussion (2)

Editor guide
vlasales profile image
Vlastimil Pospichal

Test specify what you need. Must be first.

helpmichaelcode profile image
HelpMichaelCode Author

Thanks for replying and that article link you attached was helpful!