TDD in Ruby on Rails? -


I wonder how TDD is used in rail.

Here is the step I wrote:

  1. Create migration and model for database tables
  2. Add affiliation to the model
  3. Add assumptions for the model
  4. Run the test and see to pass them, if not, the code They pass by editing
  5. routing, controller and view (which uses it
  6. Write experimental tests
  7. Run tests and fail them
  8. Edit the code and pass them
  9. Write integration test
  10. Li

I have never done TDD before.

It was in my mind, but I wanted to check with the people first.

I am sure this Not very "right" and I miss something and things are in the wrong order.

Can you correct the above list if Some of the best practices are not in accordance.

Share your experience!

If there is some misunderstanding (or should I misunderstand it?) TDD does not mean "Write all the code first, then write all the tests". As soon as your app grows, pieces are broken up, tests increase with it.

This can be a good place to get some practical examples:

On the Comment
And should you test before making a migration? See definition:
Test-Planned Development (TDD) is a software development technique that relies on the repetition of a very short development cycle: first developer writes a failed automated test case Which defines the desired correction or the new function, then produces the code to pass that test and eventually re-use the new code for acceptable standards.

However, personally I feel that there is nothing wrong in making application dead bodies before the first test. More importantly, a very small growth cycle is that you do not code the whole day and test it the next day. You do both in parallel.


Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -