[rspec-users] Working outside-in with Cucumber and RSpec

Zach Dennis zach.dennis at gmail.com
Thu Oct 30 10:54:28 EDT 2008

On Thu, Oct 30, 2008 at 9:46 AM, David Chelimsky <dchelimsky at gmail.com>wrote:

> On Thu, Oct 30, 2008 at 5:20 AM, Matt Wynne <matt at mattwynne.net> wrote:
> > On 27 Oct 2008, at 16:35, Pat Maddox wrote:
> >
> >> Matt Wynne <matt at mattwynne.net> writes:
> >>
> >>> Pat - are you going solo too?
> >>
> >> Nope, I'm trying to teach RSpec/BDD to an organization that currently
> >> doesn't use it and has 0% test coverage.  It's interesting, to say the
> >> least.  They're good devs, but even so, the effects of not writing tests
> >> first (or even at all) are painfully evident when trying to get the
> >> codebase under test, and especially to change stuff.  Really puts your
> >> "working effectively with legacy code" chops to work :)
> >
> > :D
> >
> > This reminds me of an argument I was going to make for consistently
> writing
> > specs as you go, even for apparently very simple controllers. As the
> > controller gets more and more complex, it's hard to know when you've
> crossed
> > the line into something that needs specs, and when you realise it, it's
> > usually too late.
> I'd agree with this (in spite of my previous comments), and add to it.
> One of the benefits of writing examples is that they actually help to
> expose things that are growing complex. If it's hard to test, it's
> probably hard to change.
> Aslak made a good point earlier this thread with "don't write specs
> just cuz," but perhaps this fact is sufficient "cuz" to motivate.

I think having this motivation and/or reasoning makes it no longer a "just
cuz" argument. There is a clear reason Matt is writing the spec. It seems to
be in alignment with Ben Mabey's argument earlier. There is design value
from these specs, it just isn't prevalent in at the time of creation.
Instead the value is received as the application evolves and grows because
you're able to maintain a clean and simple design -- partially from the
early warning signs that the examples give you.

Zach Dennis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20081030/c54b9a9f/attachment.html>

More information about the rspec-users mailing list