Ruby on Rails Monday, January 28, 2013

On 27 January 2013 11:24, Hans <Hans.Marmolin@klockholm.se> wrote:
> I have problem with applying a test driven development as It takes too long
> time and effort for the kind of applications that I develop as an
> application developer (working alone)

So it takes longer to do the first iteration of a simple site using
TDD. Very likely true.

> However, after a while., also my applications become so complicated that
> changing one part has effect on other parts, i.e correcting one bug, often
> generates new bugs.

And in the long run you realise that actually it would have been
better to invest the additional effort from the start. Also true. So
the moral is, for the next project, do the tests from the beginning.

> I am therefore looking for some kind of lazy testing approach with a
> scaffolding technique for generating test code, based on running each action
> and method with same combination of valid in- and outdata. I think it would
> be possible to develop at least simple test in that way but I have not found
> any when googling for them.
> I very simple example would be to generate tests of the six generic actions
> in each controllers according to e.g this template
> test "should get index" do
> get :index
> assert_response :success
> assert_not_nil assigns(:posts)
> end
> Although this is a very simple test it would be better than nothing.
> One could also try to analyse a log file to find the valid in and out data
> of each action and method used

As Fred has pointed out you can get basic tests generated by the
scaffolding but whether they are much use is debatable.

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-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment