Where to start with test driven development?

362 views Asked by At

I'm relatively new to Test Driven Development, and I was just wondering where I should start? I understand how to do the testing. I just mean what should I test first? Is there a best practice for this? Should I test the models first? The controllers? Should I write an integration test first thing, then build everything up from there to make it pass?

What are the opinions on this?

2

There are 2 answers

1
Bill Hatter On BEST ANSWER

I don't think there's one hard and fast answer on where to start.

I personally like to start with my UI first because I want to understand the full user experience before I worry about what happens behind the scenes. However, I know developers who want to start with their models first and build the UI to match them.

So to answer your question, start where ever you feel most comfortable, build your tests then build whatever you need to make them pass.

0
MansoorShaikh On

A book on Test Driven Development by Kent Beck would be a good start. It explains everything you need to know to get started with TDD.