[rspec-devel] Stories vs. examples

Ian Dees undees at gmail.com
Mon Nov 5 22:06:13 EST 2007

Hi, all.

I'm posting a philosophical question here, rather than cluttering up
the tracker for the patch where it originated.

Quoth David, in response to some fuzzy thinking on my part:

> Stories are not just another way to express examples - they're a completely different animal.

The offending clause of mine: "stories are another way to write your
tests.... examples are meant for small, targeted descriptions of your
code's behavior... stories are suited to longer, more detailed

The intent wasn't to say that stories are a different syntax for
examples; it was that stories and examples are two different syntaxes
for two different test-writing purposes.  But now I'm wondering if I
even have _that_ right.

In Rails-land, the distinction is much clearer: you typically see
examples for testing code, and stories for testing applications (in
the blog posts I've read, anyway).

But in GUI-land, the picture blurs a great deal: you're always testing
applications, but sometimes you're giving a tiny example of how one
feature works, and at other times you're writing a story about several
steps of an interaction between the customer and the UI.

Anyone want to jump into these muddy waters?

More information about the rspec-devel mailing list