[Cucumber] My Feature Narrative seems too long?

16 views
Skip to first unread message

Scott G Smith

unread,
Oct 5, 2009, 3:48:54 PM10/5/09
to Cukes
Hello People,

I have working with Gherkin (Cucumber syntax) for about an hour now.

I like it in a puzzle-solving kind of way.

Perhaps I will learn how to make it useful for my software efforts.

Suppose I sell appliances and I accept credit card payments once a
month from customers who buy appliances from me on a payment plan.

I came up with this Feature-name and narrative:

Feature: Process Payments
So that the system can regularly process credit card payments for a
set of payment plans it needs to respond to time based events and then
work through a queue of the payment plans while connected to the
credit card processing gateway


The above Feature-narrative seems okay to me.

But, when I compare it to other Feature-narratives I see on the web
and in the RSpec book,
I worry my Feature-narratives is too long and thus I lack good
understanding of Gherkin.

Thoughts anyone?

--Scott

Stephen Eley

unread,
Oct 6, 2009, 2:35:25 AM10/6/09
to cu...@googlegroups.com
On Mon, Oct 5, 2009 at 3:48 PM, Scott G Smith <scottx...@gmail.com> wrote:
>
> Feature: Process Payments
>  So that the system can regularly process credit card payments for a
> set of payment plans it needs to respond to time based events and then
> work through a queue of the payment plans while connected to the
> credit card processing gateway

First thought: no feature description is "wrong" if it helps make the
reason for the feature clear to you and other stakeholders.

Second thought: wow, that's a convoluted sentence. >8->

Third thought: who realizes value from this feature? I don't think
"the system" is a correct answer. "The system" doesn't care; it's a
vague and passive abstraction, like "the weather." Are there any human
beings who care about this feature? If so, why? (And if not, why build
it?)

Fourth thought: are you sure that's just one feature? It looks like
several to me:

* Connect to a credit card gateway
* Step through a queue of payment plans
* Respond to time-based events
* Process credit card payments for a payment plan

Yes, they're interrelated. But if they're separate non-trivial chunks
of work, it's probably more manageable to look at each chunk one at a
time. Your last feature can build on the successful implementation of
the prior ones and take their working as a given.

Enjoy.

--
Have Fun,
Steve Eley (sfe...@gmail.com)
ESCAPE POD - The Science Fiction Podcast Magazine
http://www.escapepod.org

Adam Sroka

unread,
Oct 6, 2009, 3:28:25 AM10/6/09
to cu...@googlegroups.com

Even when you break it down I hear a lot more implementation than
business value. To get at the real value, you need to ask "why?" until
you get to a value proposition (Probably has something to do with
being able to collect revenue from credit card receipts.) Then you
need to write stories that focus on what the value is and not /how/
you do it.

For example:

Feature:
In order to pay for my plan as a customer I want to be able to
schedule payments by credit card.

Feature:
In order to see revenue from credit sales as a finance manager I want
credit payments to be processed by a third party gateway in a timely
manner.

Or something like that.

To get good at seeing features this way you need to work
collaboratively with business people on an agile team. Over time it
becomes second nature.

The stuff like "queues of payments", "time-based events", "connect to
a gateway", etc. Are irrelevant from a value perspective. They are
about how you get it done, and thus they belong in your unit tests (or
specs... whatever you call them).

Matt Wynne

unread,
Oct 6, 2009, 3:38:15 AM10/6/09
to cu...@googlegroups.com

Firstly, this discussion has very little to do with Gherkin. The
'narrative' section you're discussing here is simply a free-text area.
You can put whatever you like in here: ASCII art, a poem, or nothing
at all. Most people however (probably prompted by the TextMate bundle)
put something like this:

http://www.infoq.com/news/2008/06/new-user-story-format

There are lots of good reasons for using that standard user-story
structure, which although there are many people on this list who
understand them, are well documented elsewhere. Hopefully that link
above should show you where to look to find out more.

cheers,
Matt

+447974 430184
ma...@mattwynne.net
http://blog.mattwynne.net

Scott G Smith

unread,
Oct 6, 2009, 10:05:13 PM10/6/09
to Cukes
All of the responses to this thread have been really good.

But I do feel a bit guilty that the original post was a bit off topic
for this forum.

I read the content located here:

http://www.infoq.com/news/2008/06/new-user-story-format

I learned a bit there.

I learned even more here:

http://en.wikipedia.org/wiki/User_story

If you know of a forum which discusses user stories please post its
URL here
(as I intend to do after I find the forum(s)).

Also I intend to get a book or 3 at the library.

Books are good but I think that learning from forums and talking with
people is more enjoyable for me.

Last question:
How do I add [Cucumber] to the subject line?
I had it in there.
Google dropped it.
Stephen put it back in.

Thanks.

--Scott
> m...@mattwynne.nethttp://blog.mattwynne.net

Mike Sassak

unread,
Oct 6, 2009, 11:32:15 PM10/6/09
to cu...@googlegroups.com
On Tue, Oct 6, 2009 at 10:05 PM, Scott G Smith <scottx...@gmail.com> wrote:
<snip>
> Also I intend to get a book or 3 at the library.
>
> Books are good but I think that learning from forums and talking with
> people is more enjoyable for me.
>
<snip>

Hi Scott,

The wiki page on user stories includes it in the references, but I
think it's worth making it explicit: Mike Cohn's "User Stories
Applied" is an _excellent_ resource for learning about user stories. I
can't recommend it highly enough.

Mike

Andrew Premdas

unread,
Oct 7, 2009, 4:02:52 PM10/7/09
to cu...@googlegroups.com
2009/10/7 Scott G Smith <scottx...@gmail.com>


All of the responses to this thread have been really good.

But I do feel a bit guilty that the original post was a bit off topic
for this forum.

-1 This post is definitely ON topic IMO. This forum isn't just about getting cucumber to work, but also about getting us to work productively using Cucumber. Even though technically Cucumber ignores these first lines in the file, they are still the most important ones in the file. When done well they will set the stage for useful features that will stand the test of time. 

So by all means post more questions like this.

All best

Andrew 
Reply all
Reply to author
Forward
0 new messages