How to write an agile story? A lot of people ask this question; So we will try to answer at this question with this article.
It’s really important in scrum or agile to write well your user stories. So let’s see together how to write an agile story; it’s not really difficult but at the beginning, it’s complicated to find the good way.
How to write an agile story?
At the beginning, I recommend you to choose the good format. So for that, the most popular description is this one:
As a < type of user >, I want < some goal > so that < some reason >.
Some people purpose others templates that we can see in this blog in the future.
A lot of teams use this format because it focus on the customer/user with the first part “As”. Indeed, we know directly who is concerned by the request. Some people consider that the “so that” are not a mandatory if the goal makes sens.
But this description is not enough to develop the request. We need to describe the management rules to be sure what is expected by the customers/users.
The management rules
For the management rules, in agile we try to write them in the simplest way. We avoid to write very complicated sentences, to use acronyms (or we explain the definition) or to use expert words. It’s really important that all the readers understand all the management rules.
For example in an ecommerce website, if we have the user story: “As a customer, I want to add a product in my cart”.
if stock < 1, impossible to add the product in the cart
but if stock < 1 but preorder = 1, so you can add the product in my cart
As you can see, it’s easy if you write your management rules like that.
How to write an agile story for beginner?
Some team use the story A4 like a user story format. It’s a simple user story format to write all your user stories. This format purpose to write the management rules in the simple form. Fell free to read our article about story 4.
How to test our user stories
If you write just the management rules, we consider in some cases that it’s not really easy to test all the different cases. So, I recommend you to use a special language to write the expected outcomes; we usually use the name “acceptance test” to define them. Generally, the teams use the gherkin language to write them.
Here is an example of the test write in gherkin language:
Scenario: add a product on my cart
Given I am on my cart
And that I have a product of id “1234” in quantity “1”
And the remaining stock on this product is “0”
When I add “1” quantity to my product
Then my cart will show an error
Given I am on my cart
And that I have a product of id “1235” in quantity “1”
And the remaining stock on this product is “10”
When I add “1” quantity of my product
So my product will have “2” quantities
Now, with this article, you define your own format or use the story A4 format to write your user stories. The most important is: everybody can really understand without doubt what is the expected outcomes.
Useful link: Story A4 (in french)