On 14 July 2010 16:18, lucky in ruby <li...@ruby-forum.com> wrote: > Hey, > > I am a rails beginners. I have created a couple of simple applications > without following TDD. > > I have a question - Do good programmers really follow TDD strictly ? I > mean.. Do they follow { 1. Write Test 2. Write Code 3. Refactor } > cycle ?
The one time I write code before test is when I am not sure how to achieve what I want to achieve in the app, For example I may wish to get a particular visual layout and am not sure exactly what html I need to generate to get the effect (due to my lack of experience). In that case I will read docs, google and experiment with the code till it is what I want and then knowing the html (which I make sure I now understand) I write the tests. I then comment out the code generating the html and check the tests fail, then put the code back in a bit at a time to make sure the appropriate tests now pass. What I found amazing when I started with TDD was how quickly I got the stage of writing tests and code to develop the app, often only viewing the app in the browser almost as an afterthought, as I was confident it was going to work anyway. Colin -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-t...@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.