1 of 35

Requirements &

Writing User Stories

2 of 35

Requirements size aligns with technological and economic changes

Large requirements (large requirements specifications or formal specs) -- needed for situations where coding, linking, building, are expensive. (still true for aircraft)

Medium requirements (use cases) -- came in when coding, linking, building and shipping became cheaper, but were NOT free

Tiny requirements (stories) -- an option finally when coding, testing, shipping are effectively free (now, humans are the most expensive element)

Story!

Peruvian Taxes System

3 of 35

Requirements: Starting point

When computation was expensive, people took a long time planning their implementation, and that involved writing lengthy requirements.

Another reason was that systems were applied to high-risk problems, so fully specifying the requirements was important.

Hence:

Requirements used to be very very large documents

And used to be written very formally

Actually they still are, in situations where life is at risk!

4 of 35

First came big requirements

5 of 35

Thinking about big requirements

  • Very difficult for a client to play out the behaviour based on the description because the description is so in-depth
  • These are long, almost legalese documents that take a long time to convert into a specification or detailed design.

6 of 35

Then came medium requirements

7 of 35

And on...

8 of 35

And on!

9 of 35

Thinking about medium requirements

  • Still difficult for a client to play out the behaviour based on the description because the description is so in-depth
  • Still interconnected -- they would refer to one another! “Buy Something” might refer over to “Procure goods”

10 of 35

Then came smaller requirements

11 of 35

Then PICTORIAL requirements:

  • use case diagrams show packaging and decomposition of use cases not their content
  • each ellipse is a use case
    • only top-level services should be shown
    • not their internal behaviour
  • actors can be other systems
  • the system (black outline) can be an actor in other use case diagrams
  • are not enough by themselves
    • must individually document use cases

12 of 35

Thinking about smaller requirements

  • STILL difficult for a client to play out the behaviour based on the description because the description is so in-depth, and now leaving room for ambiguity … what do each of the behaviours really look like in the end?
  • This still contributes to a mismatch between client expectations and what the developer does
  • Does not link problem domain to solution domain explicitly

13 of 35

DEEP DIVE:

USER STORIES

14 of 35

USER STORIES

Role Goal Benefit

Sometimes just called the “User Story”

Definitions of Done

Sometimes called Acceptance Criteria

Engineering Tasks

15 of 35

Finally tiny requirements

RGB: As a shopper, I want to be able to buy something and then see it in my purchased list so that I can spend money on the site.

Definition of done: User clicks the button buy, and it appears in their purchased items, and is shipped to their home and the user will see the money deducted from their account

RGB: When I’m told that I’m not approved for purchase by the system, I want to be able to click “request approval” and then receive confirmation that the approval request has been sent

Definition of done: User is seeing “not approved, and clicks “request approval”, and then user’s ID appears in the list of approval requests, and an email is sent back to the user that their request is in processing

16 of 35

Engineering Tasks

User stories are then broken down by developers into engineering tasks.

These are NOT from a user perspective -- they are just things that need to be done to get the work completed (finish the parser; investigate the JSON library; set up the database; setup mocks for testing; etc)

Based on those tasks, the developers estimate how much time the story will take.

17 of 35

Thinking about tiny requirements

  • Beautiful linkage between problem domain and solution domain because definitions of done describe the solution succinctly
  • These are still legal documents!
  • They do not have hierarchy the way prior requirements did (though clusters of them might make sense)
  • Great way to distribute work between team members!

18 of 35

ROLE

GOAL

BENEFIT

DEFINITIONS

OF DONE

ENGINEERING

TASKS

Which users to test with

What behaviour to build

What tests to specify

Informs

What needs to be done

STORY POINTS

Informs

# of hours it will take

Helps prioritize user stories

19 of 35

Role Goal Benefit Statement

Have a Role (the specific type of user expressing the need)

Have a Goal (the behaviour desired)

Have a Benefit (the outcome of the behaviour)

RGB statement:

As a customer,

I want to be able to buy something

and then get it

  • As a user, I want to search for contacts so I can message them.
  • As a customer, I want to search for product items, so I can buy them.
  • As an employer, I want to post a job on the website so people can apply for it.

20 of 35

Not Role Goal Benefit statements:

  • implement contact list view ContactListView.java

  • define the product table database schema

  • automate the job posting algorithm
  • Refactor the code to make it more readable

These are engineering tasks

21 of 35

Good definitions of done

These are your contracts with your clients

This is how you know you have completed a user story, and can mark it resolved

This is how you know whether you can test your user story (if you can’t, you need a different user story!!)

Definition of done: User clicks the button buy, and the item appears in their purchased items, and is shipped to their home.

22 of 35

User Stories: INVEST

  • Independent. IN CONTRAST with hierarchical requirements
  • Negotiable
  • Valuable to users or customers
  • Estimable
  • Small
  • Testable

(story points are the number of hours it will take one person)

STEPWISE REFINEMENT. (US->DoD->ET)

Each level is as precise as it can be for its level.

Bad Sample MT question:

T/F: It’s okay for US’s to be kind of vague because definitions of done will clarify them.

User story: As a customer, I want to be able to buy something and then get it

Definition of done: User clicks the button buy, and it appears in their purchased items, and is shipped to their home.

Engineering Tasks: Developer level tasks like refactor, set up database, set up framework, get the server up and running...

23 of 35

I: Independent

User stories should be independent of one another, but obviously they’re not implemented in a vacuum.

User requirements used to be hierarchical like this:

Edit Feature

Put red squiggles under misspelled words

Change text font

Copy and Paste Text

To implement the “Buy Something” feature, you would have to implement all the sub features. Only then would the product be done and ready to ship

That hierarchy vanished, leaving independent user stories

Put red squiggles under misspelled words

Change Text Font

Copy and Paste Text

Each of these user stories can be implemented independently. They may be prioritised differently, and their engineering tasks may build on each other, but they can be thought of without thinking of them as a collection. The product can ship with one of these, without having to have the rest.

24 of 35

N: Negotiable

Users didn’t used to have a lot of bargaining power when talking about the requirements specifications for their systems. This was mainly down to the fact that the requirements were very difficult to read. Users would not be able to play out what the eventual look of a feature would be -- they would assume they knew, and they might well be wrong. At the time the finished product was released, there were often unpleasant surprises.

Negotiable means that clients have to be able to fully understand and critique how a feature will look in the end. This means that they are clearly written. The time estimates also have to be present so a customer can decide whether the amount of time spent on a particular story is worth it to them.

25 of 35

V: Valuable

You MUST be providing value to a customer. They are the ones paying for the development effort. Extra stuff like “cleaning up the documentation so you’ll have an easier time later” either needs to be thrown out, or put into an engineering task and revealed to the customer so that they can negotiate whether it’s valuable to them.

26 of 35

E: Estimable

This is one where I think they kind of just needed the letter “E”, but it generally works. Estimable means that the user story should be written in a precise enough way that a developer can estimate how long it will take. This is a value hugely to the developer because projects can run over time if requirements are vague. “Not realising what they really wanted” is not an option here, because the work must be estimable.

27 of 35

S: Small

This is in direct contrast to “Big”. Which is how requirements used to be. They used to be WHOLE FEATURES that spanned the entire lifetime of the product. So ALL of the “Edit” feature, for instance, would chunk in at once from the user’s perspective, and so “Edit” was one massive requirements document, with a thousand sub-requirements that might take a year to complete.

Now, stories are added incrementally to products (in clusters, but you get the idea), and so they are small enough to fit within the work span of a couple of weeks. If it’s larger than that, you need to split it up.

28 of 35

T: Testable

This is how you know you’re done, and that you’ve built what you said you were going to build. You need to know how to test, what to test, and what it means when all those tests pass (and this refers to either user or unit tests). Some things are NOT testable. For instance “Make the user happy” is not testable. You can’t actually measure whether someone is happy. “Help the user select x things in y seconds” is testable. You can see whether, on average, over a certain population, users are generally able to be able to come through with that timing.

29 of 35

Let’s examine:

  • Independent -- This is independent.
  • Negotiable: IF we have separated the behaviour of searching and messaging, then yes because you can assess the technical approach to realising this behaviour. Otherwise, maybe not! Because you might think it’s just a search feature, but thinks it’s both search and message
  • Valuable to users or customers: yes - this a central feature.
  • Estimable: yup - this is fine.
  • Small: Okay. Would need to look at engineering tasks to ensure that this fits within a sprint
  • Testable: Yes! Because we could ask a user to do it, and check whether a message box appeared.

Architectural context: email system with a database of contacts.

User story: As a user, I want to search for contacts so I can message them.

Definitions of done: user can enter a name into a text box and then see a message button [and shows the list of contacts matching the search with buttons next to each one]

30 of 35

Let’s examine:

  • Independent
  • Negotiable
  • Valuable to users or customers
  • Estimable
  • Small
  • Testable

User story: As an employer, I want to post a job on the website so people can apply for it.

31 of 35

32 of 35

33 of 35

34 of 35

Write a user story for Checkpoint 1. Remember you need a Role, a Goal, a Benefit. And it needs to be independent, estimable, testable, etc.

35 of 35

Examinable skills from this lecture:

Write user stories with the correct format, and meaning

Write unambiguous definitions of done

Identify why some user stories are not good user stories (because they are ambiguous, or too large, or not testable, for instance -- INVEST principles)

Explain why, as professionals, definitions of done are important

Explain how definitions of done drive test suites

Explain the difference between a story and a task, and identify which is which

Explain how requirement lengths are motivated to some extent by technological and economic concerns

Explain how user stories relate the problem domain to the solution domain to capture client expectations

Requirements and Writing User Stories