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?

有帮助吗?

解决方案

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.

其他提示

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top