DEV Community

loading...

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)

pic
Editor guide
Collapse
vlasales profile image
Vlastimil Pospichal

codecademy.com/articles/tdd-red-gr...

Test specify what you need. Must be first.

Collapse
helpmichaelcode profile image
HelpMichaelCode Author

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