Let me tell you a Story
I’ve been having a little difficulty recently trying to assist the team in breaking down stories into more manageable (as in a single sprint) stories. I’d like to share the results of my research with you.
Before a user story is ready to be scheduled for implementation in an upcoming iteration, it should be “small enough”, the usual rule of thumb being “a story that can be completed within the iteration”. However, many user stories start out larger than that. “Splitting” consists of breaking up one user story into smaller ones, while preserving the property that each user story separately has measurable business value.
Story Splitting – Agile Alliance
A good story will always follow the INVEST model
- Independent
- Negotiable… and Negotiated
- Valuable
- Estimable
- Small
- Testable
And it is how we reach the Small requirement that this post will focus on.
Why Split a User Story?
Consider a team with a velocity of 20 which commits to two stories each worth 10 points. The team produces work equivalent to 19 story points, meaning only 50% of the stories committed to are completed.
Now consider the same team with the same output, but they have committed to 10 stories each worth 2 points. The team will achieve 90% of the stories committed to.
The benefits of smaller stories also include Improved Understanding, Increase the Accuracy of Estimation and make is Easier to Prioritise for the Product Owner.
It is worth noting that splitting a story is unlikely to reduce the story point total – 8 points will not split nicely into four 2 point stories, but may on the other hand, identify stories where no or little value will be added.
When to Split a User Story?
This will depend on each Team’s Velocity, however, it would seem reasonable to say that the larger the story, the greater the chance of failure and that we would always prefer to complete more than we do not after each sprint.
Going back to our earlier example:
The Team has an established velocity of 20 and commits to two stories at 10 points each, assuming both stories are worked on at the same time there will be a significant chance that neither will be finished at the sprint end – bugs, system problems, and sickness. The sprint has produced nothing and, although the team will potentially catch up in the next sprint, we have to remember the goal of each sprint is to produce “a ‘Done’, useable, and potential releasable product Increment”. Even if we complete one of the stories we have only completed 50% of the committed to work.
Taking this example we can say that any story that is at least 50% of the available velocity (and to err on the side of caution 40% may be a better benchmark) has to be a candidate for splitting.
How Small should a User Story be?
Again this depends on the Team’s Velocity and style. We also need to make sure we do not lose track of the other INVEST principles when seeking to split larger stories (though it may be the case that as we split a story we may find parts that have little or no Value and can so deprioritised or even discarded).
Leading Agile – How Many Stories per Sprint? suggests that each story should be able to be completed (as in ”Done” Done) in 1 to 3 days and suggests 5 to 15 stories per sprint.
This would indicate a size of 10% to 20% of the Team’s Velocity would be a good size to aim for. So if the Team has a velocity of 20, ideally we should split stories down to a size of around 4 points as a maximum. Obviously, there will be cases where we cannot do this but would be a reasonable starting position.
Interestingly the Scrum Breakfast post – What is the Optimal Story Size suggests that the majority of Scrum Teams commit to 4 to 13 stories and the average story size is around 15%.
How to Split a User Story
This section looks at approaches to take to split the stories it’s based (by which I mean plagiarised) heavily on Agilistic – 10 useful strategies for breaking down large user stories and Agile for All – Patterns for Splitting User Stories.
Whenever a story is split, we must continue to ensure the new stories all meet the INVEST principals.
Vertically NOT Horizontally
It is not advisable to split stories horizontally – by horizontally I mean breaking a story up by the type of work needed an example of which would be splitting by application layer (frontend, backend, database) or development separate to testing.
Breaking up a story this way means that unless all the sub stories are completed no Business Value will be delivered. In addition splitting stories in this way makes it very hard for a Product Owner to prioritise the Backlog – Is the Database Story more or less important than the Frontend Story? It can also reinforce the separation of skills (Database Guy, Frontend Girl, Tester Guy, Coder Girl) that Scrum seeks to dissolve.
Breaking a story down in this way is best left to the team when they create their tasks when determining how they are going to complete the story.
Patterns to Breakdown a User Story (in no specific order (except the last one))
WORKFLOW STEPS
If the story involves any sort of workflow, we should be able to break the story down in the individual steps.
“As a customer, I can pay for goods in my shopping basket, so that I receive my products at home”
Could be broken down into steps:
“As a customer, I can log-in to my account, so that I don’t have to re-enter my personal information every time”
“As I customer, I can review and confirm my order, so that I can correct any mistakes before I pay”
“As a customer, I can pay for my order with a credit card, so that I can confirm my order”
“As a customer, I receive an email confirming my order, so I have proof or purchase”
BUSINESS RULES
A story may need to implement a number of business rules and these should be split out.
“As a customer, I can pay for goods in my shopping basket, so that I receive my products at home”
We may be able to identify (from acceptance criteria) stories which can be tackled separately:
“As the store owner, I can add additional P&P where the order is less than £20”
“As a store owner, I can decline orders from customer outside the UK”
“As a store owner, I can reserve ordered products, so customers see a more realistic stock level”
“As a store owner, I can cancel orders for which I have not received payment within 48 hours, to release stock”.
Any validation a story may have can often be a candidate to split out.
GREEN vs RED PATH
There will often be a Green (everything goes well) and several Red (something isn’t right) paths through a piece of functionality. We can look to split the story into these separate paths.
“As a customer, I can log-in to my account, so that I can access my information”
Can be split into:
GREEN
“As a customer, I can log-in to my account, so that I can access my information”
RED
“As a customer, I can reset my password if necessary, so I can log-in”
“As a customer, I can register a new account, so I can log in”
“As a store owner, I can block customers who incorrectly to log in 3 times, so that I can protect the site”
MANAGE CRUD
The word “Manage” in a story is a strong indicator the story will have multiple operations (Create, Retrieve, Update, and Delete). These operations can clearly be broken out.
“As a customer, I can manage my account, so that my details are correct”
Could break down to:
“As a customer, I can create an account, so that I don’t have to re-enter my details each time”
“As a customer, I can view my account details, so that I can check the details are up to date”
“As a customer, I can edit my account details, so that I keep the details up to date”
MAJOR EFFORT
It may be possible to break a story down where one story (the first) will contain most of the effort and the subsequent stories are additions to the first story.
“As a customer, I can pay for my order with a credit card, so that I can confirm my order”
Could be split down to:
“As a customer, I can pay for my order with VISA, so that I can confirm my order”
“As a customer, I can pay for my order with MC, so that I can confirm my order (given that VISA has already been implemented)”
“As a customer, I can pay for my order with AMEX, so that I can confirm my order (given that VISA has already been implemented)”
VARIATIONS IN DATA
We can split stories based on the data they return or the parameters they may handle.
So for a Data Retrieval story, we could take:
“As a customer, I want to be able to view my orders, so that I can see what I have ordered”
And this could be broken down into steps which add complexity at each stage
“As a customer, I want to view all my orders” – A simple unordered list
“As a customer, I want to view all my orders by date” – Date ordered list
“As a customer, I want to view my orders 10 at a time” – Pagination
“As a customer, I want to view my open orders”
… and so on.
And for a Search story
“As a customer I can search for products so I can view and order them”
Can be split
“As a customer I can search for products by product number…”
“As a customer I can search for products by product name (exact match)…”
“As a customer I can search for products by product name (fuzzy match)…”
“As a customer I can search for products by price…”
“As a customer I can search for products by type…”
… and so on.
PERFORMANCE
A large part of the effort to complete a story can giving a fast response, but the basic implementation may not be that hard. In this case it makes sense to split the story into “It Works” and “It Works Fast”.
“As a customer, I can search for a product”
Could be broken down into
“As a customer, I can search for a specific product (slow show a searching animation)” – It Works
“As a customer, I can search for a specific product (fast in under X seconds)” – It Works Fast
This may be an occasion where we could split the second part horizontally.
TEST SCENARIOS
We may have a large story where it’s hard to break the story down based purely on functionality alone. In this case, we could consider how the functionality is to be tested. Each test scenario could then become a story in its own right.
“As a store owner, I need to track stock levels, so I can fulfill orders”
Could be broken into Test Scenarios such as:
Test 1 – If stock is at Zero an alert is sent
Test 2 – If stock is less than X units an alert is sent
Test 3 – if stock is Zero, it cannot be ordered
Test 4 – If stock is in a basket it should not be counted as in stock
Test 5 – If an item is ordered by a customer the stock level should be adjusted
Test 6 – When a new stock arrives the stock level should be adjusted
Test 7 – Stock levels can be manually updated after stock takes
Each test can then become a story in its own right.
This pattern can help apply other patterns as we automatically end up with business rules and Red and Green flows and potentially Data variations.
And finally BREAK OUT A SPIKE
A story may be large because we do not fully understand the implementation. If this is a case it may be worthwhile to create a time boxed Design Spike story.
“As a customer, I can pay for my order with VISA, so that I can confirm my order”
We may not know how we implement credit card processing so we can break it down into
“Investigate VISA credit card processing”
“Implement credit card processing”
In the investigate story the acceptance criteria should be the question that needs answering. Once we have answers to the stories we should stop.
Which Pattern to Use?
Agile for All – Patterns for Splitting User Stories suggests two useful Rules of Thumb for choosing patterns.
- The pattern that lets you deprioritise or throw away a story. Think of the 80/20 rule!
- The pattern that produces more equally sized small stories – 8 points to 4 x 2 is better than a 5 and a 3.
Summary
We need to stick to the INVEST principals when splitting stories and look to split vertically (by function) rather than horizontally (by architecture).
Splitting stories will be an additional overhead on the team but will produce benefits. We can use one or more of the described patterns to help us drive the process.
We should always bear in mind that splitting a story may increase the total story points in the backlog – an 8 point story is unlikely to split into just four 2 point stories.
We should strive to make sure our stories are no larger than 40% of the team’s velocity and preferably only around 10-20% of the velocity.
Good stories should be small. This makes then clearer, easier to prioritise and estimate, quicker to implement and so faster to deliver value.
Some additional stuff
Agilistic – 10 useful strategies for breaking down large user stories
Agile for All – Patterns for Splitting User Stories
A Useful Flowchart from Agile for All
Mike Cohn on Splitting Epics