Hi,
I am still trying to learn how to effectively use BDD. I would like to
know if there is a typical BDD workflow or if it is really just a
question of personal preference.
So far I see the following steps being fairly common:
- talk with user to establish a few stories and features
- write plaintext stories or cucumber features (with the user?)
- write specs for whatever step needs to be wnitten
- code until specs pass
- write story/feature steps
- repeat steps 3-5 until the story/feature passes
- show the user to confirm that it works the way the user want (and
go back to step 2 if it doesn’t)
- go back to step 1 for new stories/features
Is that how you do things? Should I do it this way? How flexible
should this process be? For example, if the user wants a tiny change,
should I always be so disciplined as to update the story first, then
the specs, and then code?
Thanks!
On 19 Sep 2008, at 02:00, DyingToLearn wrote:
- write specs for whatever step needs to be wnitten
- code until specs pass
- write story/feature steps
- repeat steps 3-5 until the story/feature passes
- show the user to confirm that it works the way the user want (and
go back to step 2 if it doesn’t)
- go back to step 1 for new stories/features
This seems to be pretty much the workflow that’s evolving for us,
though I tend to write the step implementations before I start coding
the views, controller, models. (i.e. 5 before 3)/
It’s the ‘outside-in’ model of development that Dan N. talks about
- driving out all your changes to the code from a real user goal.
Is that how you do things? Should I do it this way? How flexible
should this process be? For example, if the user wants a tiny change,
should I always be so disciplined as to update the story first, then
the specs, and then code?
IMO, you have to be pragmatic - maybe you can just change the spec of
a controller to listen for another querystring parameter value and do
something different - I don’t think that necessarily needs the full
ceremony of another feature scenario.
Thanks!
rspec-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rspec-users
cheers,
Matt
http://blog.mattwynne.net
In case you wondered: The opinions expressed in this email are my own
and do not necessarily reflect the views of any former, current or
future employers of mine.
On 19.9.2008, at 10.58, Matt W. wrote:
This seems to be pretty much the workflow that’s evolving for us,
though I tend to write the step implementations before I start
coding the views, controller, models. (i.e. 5 before 3)/
Ditto, and also, don’t write all the specs at a time. My plan for 3-5
is something like this:
- Write the first step of the feature in question
- Write the view spec to satisfy the step code
- Write the view functionality to make 4 pass
- Write the controller spec to satisfy the needs of 4
- Write the code to make 6 pass
- Write the model spec to satisfy the needs of 6
- Write the code to make 8 pass
At this point the step should pass, so go back to 3 and repeat with
the next step.
Note that I left out the refactoring part of the TDD cycle here. It
generally happens between every layer after the specs pass.
//jarkko
–
Jarkko L.
http://www.railsecommerce.com
http://odesign.fi
sometimes i do
story => code => spec => (re)code => story step => (re)code => spec
=> (re)code
or whatever, but hey, thats just me…
On Sep 19, 2008, at 4:09 AM, Jarkko L. wrote:
question of personal preference.
go back to step 2 if it doesn’t)
- Write the view spec to satisfy the step code
- Write the view functionality to make 4 pass
- Write the controller spec to satisfy the needs of 4
- Write the code to make 6 pass
- Write the model spec to satisfy the needs of 6
- Write the code to make 8 pass
At this point the step should pass, so go back to 3 and repeat with
the next step.
Note that I left out the refactoring part of the TDD cycle here. It
generally happens between every layer after the specs pass.
As far as I can remember, this is how Pat introduced described his
cycle in the screencast he posted on the story runner when it first
came out. I’d be curious to see if (and how) he has changed his
workflow since then.
Scott
hi there,
you might wanna be insterest in this talk on Stories DD by webrat
maintainer
at GoRuCo 2008 http://goruco2008.confreaks.com/01_helmkamp.html
there he hightlights the workflow like this:
- Write scenario (yellow color)
- Write steps matchers (red color)
- Write code (green color)
- refactor (even greener ;-))
and according to him you loop between 2 and 3, and you can even be a
little
relaxed between 2 and 3 ( make a little of 3 to know what your page will
look like before 2)
check it out, its great
joaquin
2008/9/19 Jonathan L. [email protected]
Scott T. wrote:
As far as I can remember, this is how Pat introduced described his
cycle in the screencast he posted on the story runner when it first
came out.
I’ve been caught in plagiarism!
I actually wrote this message while I was watching that screencast.
Thanks to everyone for your comments (and the link to that video).
Paul