[rspec-users] How thorough do you test?
pergesu at gmail.com
Wed Nov 21 15:42:50 EST 2007
On Nov 21, 2007 12:33 PM, Chris Olsen <lists at ruby-forum.com> wrote:
> When you said that, testing helps you by defining how our code will be
> used, seems to be close with Ben's mention of Kinderman's post which has
> already started me looking at things from a different angle, which is a
> good thing.
Exactly. My main problem with a bottom-up approach is that you're
basically speculating how code will be used. I've seen people argue
that as long as you have good design skills it really isn't an issue.
However, I much prefer to let my actual usage drive the design, and
then use my design skills to shape it even further. Simply put, you
have more information, allowing you to make better decisions.
> When you start testing from the view to model, do you still use the
> scaffolded tests. I am not sure if it is just me, but when I have all
> these tests auto-created I find it somewhat distracting. I can see
> where writing them from scratch would eliminate that and allow me to
> guide the tests instead of having the auto-generated tests guide me.
> What do you guys think about that?
I don't use the scaffolded tests at all. I'm sure a part of it is
Not-Invented-Here syndrome. Ruby is so lightweight and expressive
that I think it's acceptable to write that stuff from scratch rather
than use scaffolding. More importantly though, I'm addicted to
building up behavior in tiny steps.
More information about the rspec-users