Many people start writing user stories over traditional feature/requirement documents; however, almost everyone struggles when writing their first batch of user stories. This is not at all uncommon, just like riding a bike, it does take a little bit of practice (but once you get it - you get it).

Writing user stories is dead simple if you follow these simple steps:

1. As a [role], I can [feature] so that [reason]

When writing user stories, using this pattern is a for sure bullseye. Let’s look at an example:

As a account owner, I can check my balance online so that I can keep a daily balance 24 hours a day.

Pretty easy right? However, in some instances I find that the “so that” suffix reads redundantly so go ahead and have that be optional if you wish.

As a account owner, I can check my balance online.

Feel free to use slight deviations of this template using synonyms:

  • As a [role], I want [feature] because [reason]
  • As a [role], I can [feature]
  • As a [role], I can [feature] so that [reason]

2. Use index cards

When creating new user stories, always hand write your new stories on a single side of a index card. It will aid you in creating the correct size of user story.

The theory is simple - if you use any larger than a 3″ x 5″ index card you will write too much.

User stories are suppose to be short and sweet. They are supposed to aid in further communication and not to tell the entire long-winded version of the story. Sticking to these physical constraints will help.

3. Make it testable with acceptance stories

If use stories are short and sweet - how are we suppose to know all the different acceptance criteria? Again easy as pie, just write out any of your acceptance tests using this template:

Scenario 1: Title
Given [context]
And [some more context]…
When [event]
Then [outcome]
And [another outcome]…

For example:

Scenario 1: Account balance is negative
Given the account’s balance is below 0
And their is not a scheduled direct deposit that day
When the account owner attempts to withdraw money
Then the bank will deny it
And send the account owner a nasty letter.

Again, one trick I learned to keep my user stories small is to only allow enough scope so that all of my acceptance stories can be written using a ball point pen on the backside of the user story index card. Another physical constraint!

If your user story has more than 3-4 acceptance stories, really analyze the story and see if it makes sense to break it down even further so you can fit all its acceptance tests on the back of the card. Doing so might help you break down those larger stories into more digestible pieces.

4. Connect the dots

Like I have said before, write out all the possible user stories you can currently think of. I guarantee that you will be missing some of the project scope; however with a little luck, you will be able to conncet the dots and see the enitre project picture.

How should user stories be written?

What is a User Story?

A User Story is a piece of system functionality, understood by the Customer / Product Owner, representing an increment of business value, to be implemented by the team.

A User Story is not a requirements document. It is not a written communication between requirements giver and requirements implementor. A User Story is just “a thing to do.”

How is a User Story Devised?

Well, in principle a user story can be devised in any old way. The requirements giver “thinks them up”. However, there are valuable principles to consider.

The “As a … I want … so that …” notion reminds us that we need to consider all the users of our product, that we need to consider what they want to accomplish, and that we need to turn that into a feature that they want. These are all good things for a requirements creator to think about … and they are all valuable to communicate to the developers, to aid their understanding.

The “INVEST” notion reminds us that stories should ideally be Independent, Negotiable, Valuable, Estimatable, Small, and Testable. All good notions that should be considered when deciding what to ask for.

So these ideas are very important during the time when we are trying to think of stories. At least some aspects of them are well worth communicating across the whole team.

How is a user story communicated?

The fundamental notion for our purpose here is that a story is communicated to the team by conversation. The communication is not a written document supported by Q&A. It is an explicit conversation between product owner and developers.

The conversation ideally ends with a clear statement of the acceptance criteria for the story, answering the question “How will you know that we have done what you’re asking?” The answer comes, again ideally, in the form of one or more executable tests which, when they work, show that the story is done.

How is a story tracked?

A story goes through a number of state transitions in its lifetime. It starts as a gleam in the eye of the product owner. It becomes something the product owner really wants. It becomes something that the product owner decides to schedule. It gets scheduled into an iteration. It is coded. It is tested. It is finally deemed to be done. Through all these states, we want not to lose the story, and usually we want to know what state it is in, especially as it goes through those final ones. How might this tracking be accomplished?

One really great way is to create a card representing the story, and post it on a wall chart showing the story’s current state.

Story cards on a wall are simple, public, easy to maintain, highly participative, and communicate very clearly. Highly recommended. What should the cards say on them? Anything at all that reminds everyone of what the story means. The card could say “Overtime Pay”, even if the original thinking was “As a manager of hourly-paid employees, I want them to be paid overtime in accord with the law and our policies, so that they will be properly compensated and we will be rightly seen as a just and friendly company.” We discussed all that stuff in the Conversation. We only need to quote enough of that to remind ourselves what we were talking about.

And remember: the card is backed up by an executable test that is quite probably under version control in the software repository.

That said, some teams, rightly or wrongly, want to do more. Perhaps they want to have some kind of database of story definitions, or to communicate stories across time and space. Personally, I’d push back against those notions fairly hard, but there certainly are cases where that’s what you should do.

When you do, however, you have just committed yourself to a different, heavier form of user story. The card is just a token for the story, used to mark its progression through the process. This heavier thing now begins to serve as a permanent archival document, part of some formal representation of the project. It is certainly OK to do this, even if by some standards it is wasteful.

A formally written story is an option!

By Agile standards, turning the story into a document is an option, not a standard and necessary part of doing user stories.If we are going to do it, we should strive to write the minimum amount that will serve the need in hand, which may be nothing more than to tell some remote team members what is going on. For some teams — few teams, I believe — we have additional needs for archival properties, or distance-communication properties, that require us to do more. We should do that … albeit only reluctantly.

Bottom Line

The story is a user-understood bit of requirements that the team is going to implement.

The best way to communicate to the team what is needed is to talk with them. The best way to be sure we have a mutual understanding is to define a test. Some kind of document might be provided as backup or detail on the conversation. That document should not be carrying most of the weight of the story: it is the job of the conversation, and the confirmation, to do that.

The “As a … I want … so that” and “INVEST” notions are quite important during consideration of what stories we need, and may be important during the communication of the story to the team. That doesn’t mean anything should be written down in this format … nor does it mean we can’t write things down that way if we want to. We’re allowed to do that. It’s not required.

Thus we see that a user story is a thing that needs doing, that must be effectively communicated and tested. We see that a user story card or a user story tool entry might be a written sort of thing. But the writing is not the most important part. Quite likely it is the least important part, far behind the thinking, the communicating, and the testing.


© 2007 scrum.boulevart.be | iKon Wordpress Theme by TextNData | Powered by Wordpress | rakCha web directory