Dan,
This is going to be one hell of a long thread if it turns into a text-
based back-and-forth. I suggest a BDD celebrity boxing match at the
alt.net open spaces event in Seattle :)
Nonetheless...
> I'm not sure we're on the same page with the term "story". Let's take a step
> back here.
For me, it goes back to RBehave and the inclusion of user story text
in program code as a primary organizing construct for executable
specifications.
> The important thing is the automation of scenarios as acceptance tests.
> (Actually with outside-in development they start as an executable
> specification at the application level, and then become
> acceptance/regression/functional/user/whatever tests. See how the testing
> words still keep getting in the way, at the application level?)
I experience this as an overly-narrow scope. In my world view, all
tests are acceptance test and the term becomes quite irrelevant. I
observe different audiences for different profiles of tests, but they
all point to the acceptability of the software for a given segment of
the audience.
> - especially since it means that they are duplicates of the whole
>
> > team version of the artifact that lives outside of the code in order
> > to be accessible to, and changeable by the whole team.
>
> Not if you're doing it right. The story narrative probably lives on a wiki
> or in a document or on a spreadsheet on a file share or wherever the team,
> globally, thinks is the right place. There is probably an id, say a story
> number, that identifies the story.
I don't use electronic copies of user stories as master copies unless
I'm forced into it by dislocated teams, and if I can't find enough
cork boards and shoe boxes to hold the index cards. I do use wiki's
for details that are too big for an index card, but rarely so, and
typically when I can't get continuous customer availability and need
to queue story background and context for an iteration batch.
> The only thing the team cares about automating - at an application level -
> are the scenarios (several teams I work with still call them acceptance
> tests, but we have a shared understanding of what that means). This usually
> starts out as a paired activity between testers and devs, but over time the
> testers take more ownership of this.
>
> The scenarios are in two buckets, "in progress" and "completed". Any
> completed scenarios should always be passing, and should fail the build if
> they fail. The in-progress ones can fail.
I feel that you are saying that you apply BDD only to the outer-most
level of an app, and to customer-facing tests. Am I reading this
right?
> Stories are
>
> > meant to be fluid - they are meant to be changed much more easily than
> > code.
>
> It's usually the understanding of the story that's variable, by which I mean
> the scope, by which I mean the set of scenarios that define "done" for this
> story. Code is the perfect representation for these.
I feel that the definition of stories is quite changeable until the
story is in an iteration backlog - and then acceptance criteria might
change, and if so drastically, the card might represent an egregious
misunderstanding as surfaced by relatively massive in-iteration
changes to its specifications.
> When stories end up in code, they no longer take part in the
>
> > software production's visual control system,
>
> I don't know what you mean by "visual control system", but on the tens of
> projects I have seen using BDD the continuous build runs whenever anyone
> changes any code (which includes any configuration or environment details)
> and the results are published and available to the whole team, including
> external stakeholders.
I see the build report on a CI server as a visual control system that
is most suitable to part of a team. Story cards marching across an
iteration board as a higher-level visual control for the iteration
remains my preference for that level of information and for breadth of
audience.
> and we inevitably end up
>
> > with two versions of the truth - one version that is part of the
> > visual control system for the whole of the production effort, and
> > another one that is more frequently influencing only programmers'
> > understandings of the truth.
>
> If this is a real effect you are seeing then I can only suggest you aren't
> using automated verification and continuous integration properly. I'm happy
> to talk about the variance you're seeing.
A voice conversation would certainly be more expedient. I'd be happy
to improve my continuous integration practices. However, I've got
doubts that the issue I'm pointing to is a CI automation issue. I see
this as an information radiation issue for a level of interest and
breadth of audience that is better served by less programmer-centric
media.
> Code is a much *harder* artifact that user stories, and therefore is
>
> > the wrong medium for stories.
>
> Ward Cunningham uses the metaphor of clay when he describes test-driven
> code. It is malleable and easy to change providing you have a reliable and
> repeatable method of validating that it still does what it is supposed to.
Sure, but code is still harder than pencil on paper.
> I want to be able to rewrite, expand, delete or move scenarios as I wish,
> and to be able to instantly(ish) validate my new understanding. Having a
> scenario decomposed into steps, where each step is either setting up,
> executing or verifying my application, is a very powerful model for doing
> this. I've also observed a number of projects where just the shift in
> vocabulary (to given/when/then), without any of the automation, made a huge
> impact on the quality of dialog between stakeholders, analysts, testers and
> developers on software teams.
Is it the change in vocabulary, or the focus specifically on
specification? I will personally become much more amenable to the
given/when/then grammar is a natural dialect of the humans on the
whole team rather than just the programmers.
> > Having multiple versions of softer
> > artifacts that are independently changeable will lead to multiple
> > versions of the truth
>
> Absolutely.
>
> - and in the case of stories in code - secondary
> > versions of the the truth that influence an entire, consistent
> > subsection of the whole team.
>
> Only if the stories-in-code are the secondary artifacts. In my world they
> aren't.
And this is where we fundamentally part methodological ways. Stories
captured in code is a thing that a programmer does looking through a
programmers perspective out onto the world. It's such a clear lens
for the programmer that he isn't even conscious of its existence.
The natural extension of putting stories in code is the story exporter
that we then use to generate story text to print out and put on an
iteration board. You'll have to go a very long way to convince me
that this isn't more programmer predisposition to technology
fetishism. Time and dialog may change my mind, but in the mean time I
remain rather attached to my low-fi perspective on software production
and necessary means of technology-supported communication and flow
control.
> > User stories in code: only programmers can be so narrow-sighted about
> > software development. :)
>
> Hang on, there are two different audiences here at different levels of
> granularity, namely programmers and stakeholders. (This also refers back to
> the "why do we need a scenario runner" thread.)
>
> Programmers want examples. I've started calling TDD "coding-by-example", a
> term partly inspired by Brian Marick's work athttp://
testing.com/. Using a
> framework like rspec programmers can write:
>
> describe CustomerRepository
> it should find a unique customer by id
> it should fail if it finds duplicate customers
> it should find customers by partial surname
>
> It's at the same level as an xunit test, and it's just as useless for a
> business stakeholder.
Then this is a test that a customer shouldn't see - unless he were an
extremely technical customer, at which point, we'd need some other
filtering.
> The stakeholders want to read stuff in their own language. They want to read
> scenarios, particularly edge cases, and tell you whether it's worth dealing
> with that edge case. (As a developer I can keep coding forever delivering
> ever-diminishing returns. But it's not my money.)
Sure. Agreed. But I prefer to use grammars that are more business-
natural and more English-natural than the run-on expressions I see
coming out of the given/when/then API's. Here again, you'll have to
go a long way to convince me that this is a more expressive way to
create natural specification. I find this grammar very amenable to
encoding via programmatic API, but I find it unnatural as a simple and
natural language use.
I prefer the plain old English sentences that RSpec provides as a way
to capture expression. I much prefer this over breaking up cohesive
expressiveness over multiple API calls seemingly for the purposes of
fitting natural expressiveness to a programmer's interface.
I haven't seen anything yet that I can specify with an xBehave
framework that I can't specify using an xSpec framework. With an
xSpec framework, I don't the contextually-generated documentation, but
if I'm doing outer example-driven development for primary and edge
case coverage I need to formulate the text of the specification
manually. I can live with that. I see the tradeoff as a positive one
as I see xBehave grammars to lead to sub-optimization by fragmenting
and obfuscating specification code across xBehave API calls.
> The scenario runner (not story runner - you don't run stories)
Yep. Well. Horses have left the stable on that one. I believe that
you could get them back in the stable, but the appearance of a Story
primitive as a central organizing concept in the frameworks doesn't
really help.
> The scenario runner (not story runner - you don't run stories) is our shared
> definition of done, and what's more, our shared understanding of progress.
> This story comprises these 6 scenarios. When they work we're done. If your
> stakeholder meant something else by that story - either more or less - then
> scenarios are the unit of currency you can use to discuss that.
>
> As you quite rightly said, you can express any scenario in just a regular
> example, or xunit test case. The reason I don't is that they are for a
> different audience - the stakeholder - and that it turns out the
> given/when/then steps are usually of a suitable granularity to be easily and
> frequently reused.
I try to write xUnit test names in such a way as to be demonstrative
of what the customer expressed as criteria for a story. Again, and
with all due respect for your experience and your work on tools and
your leadership, I believe that given/when/then grammar is a more
awkward form of expression and I don't believe that it is endemic too
English customer communication.
The only reason that I can see that this grammar is penetrating
business-natural communications contexts in software development
projects is that programmers are pushing it into place.
> In fact I would go further and say that all the scenarios for a story
> typically have the same core behaviour (the "when"), but with different
> givens resulting in a different outcomes. The testers very quickly become
> adept in describing the differences between scenarios. "This one is like the
> previous one but where the card is also reported stolen. In that case the
> ATM should retain the card."
Ok, but there's nothing completely germane about give/when/then
grammar that makes it more natural or appropriate to that
communication. I could just have easily used some more absolutely-
worded version of: "This one is like the previous one but where the
card is also reported stolen. In that case the ATM should retain the
card."
> I really value your energy in the BDD space. I hope I can help close the gap
> between our understandings of what BDD is and why it works.
I do, too. Although, I fear that we're going to run out of shared
understanding headroom in text media like email. I have a solid track
record of really ticking people off in text, but only mildly ticking
them off on the phone. In person, I'd simply win you over to my world
view through the magic of bar napkin scribblings and impassioned
dialog over a pint or two :)
Best,
Scott