DEV Community

Discussion on: When to TDD (Test Driven Develop), a Newbie’s Story

Collapse
 
ratraze_54 profile image
ratraze

It's also a good idea to use TDD to embrace "Program an interface, not an implementation".
It will also allow you to generate code from your tests, because almost all IDE's will mark your methods as absent, and you can generate them freely.

These concepts will help to design your code before you write any implementation whatsoever, and help you keep code away from bloating.

Collapse
 
jhiatt profile image
jhiatt

That makes sense. TDD forces you to be forward thinking so it can be a great way to push you to plan ahead.

I need to learn more about this "Program an interface, not an implementation" thing. Have any good suggested readings?

Collapse
 
ratraze_54 profile image
ratraze • Edited

I think this answer on quora can be helpful.

To continue with this topic I'll suggest reading Design Patterns or something from Gang of Four.

Thread Thread
 
jhiatt profile image
jhiatt

Thanks! I'll check it out.