DEV Community

HelpMichaelCode
HelpMichaelCode

Posted on

1

Red, Green and Refactor in TDD

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.

Top comments (2)

Collapse
 
vlasales profile image

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

Test specify what you need. Must be first.

Collapse
 
helpmichaelcode profile image
HelpMichaelCode

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

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

Rather than just generating snippets, our agents understand your entire project context, can make decisions, use tools, and carry out tasks autonomously.

Read full post