Grade by Grade
B. Software Development · Software Development: Managing a Team Software Project

Requirements, User Stories and the Scope Document

B1.1About 75 minutes
Learning goals
  • I can gather requirements from a client using interviews, observation, existing documents and prototypes.
  • I can tell functional from non-functional requirements and write both so that they can be tested.
  • I can write user stories with acceptance criteria in the Given / When / Then form.
  • I can prioritize requirements with the MoSCoW method.
  • I can write a software scope document with objectives, in-scope and out-of-scope items, deliverables, constraints, assumptions and sign-off.

Words to know

requirement
A statement of something the software must do or a quality it must have, written so that it can be tested.
functional requirement
What the system does: an action or calculation, such as "record a return and show the late fee".
non-functional requirement
How well the system does it, or limits it must respect: speed, usability, accessibility, security, privacy, the platform it runs on.
user story
A short requirement from a user's point of view: "As a <role>, I want <goal> so that <reason>."
acceptance criteria
Concrete, testable conditions that must be true for a requirement to count as done, often written as Given / When / Then.
MoSCoW
A way to prioritize requirements: Must have, Should have, Could have, Won't have (this time).
scope document
The planning document that says what the project will and will not deliver, under which constraints, and how the client will accept it.
scope creep
The uncontrolled growth of a project as extra features are added without changing the schedule or plan.

Building the right thing

There is an old cartoon, passed around software offices for decades, about a tree swing. It shows what the customer described, what the analyst wrote down, what the programmer built and what the customer really needed: a different swing in every panel. It is funny because it is true. Many failed projects did not fail because of bad code. They failed because the team built the wrong thing very well.

The first planning deliverable, then, is a clear agreement about what the software must do. The curriculum asks you to create a software project plan by producing a software scope document and determining the tasks, deliverables and schedule. This lesson covers the scope document and the requirements inside it; the next two lessons cover tasks, deliverables and the schedule.

Gathering requirements (elicitation)

Requirements are not handed to you; you have to dig them out. Good analysts use several methods, because each one catches things the others miss:

  • Interviews. Talk with the client and with real users. Start with open questions ("Walk me through what happens when someone borrows snowshoes."), then narrow down ("What if they want to borrow two pairs?"). Repeat back what you heard.
  • Observation. Watch the current process. The LendIt team watched the front desk on a busy Saturday and saw that volunteers, not staff, handle most loans, which changed the usability requirements.
  • Existing documents. Read the loan binder, the fee rules and the membership form. They reveal data you must store and rules you must follow.
  • Surveys. Useful when there are many users; they give numbers ("8 of 10 volunteers have used a laptop at work").
  • Prototypes. A paper sketch of a screen or a rough program often gets better feedback than any question, because people react to what they can see.

Also look for constraints from outside: laws and policies. For example, Canada's privacy laws expect organizations to collect only the personal information they need, and Ontario's accessibility law (the AODA) sets accessibility standards for many organizations' websites and services. These become non-functional requirements.

Functional and non-functional requirements

A functional requirement describes something the system does: an input, a calculation, an output, a rule. A non-functional requirement describes how well it must do it, or a limit it must respect: performance, usability, accessibility, reliability, security, privacy, the platform.

Each requirement gets an ID (R1, R2, ... for functional, N1, N2, ... for non-functional) so that later documents can refer to it: "test T14 checks R3". Here is LendIt's list after Priya and Jordan interviewed Denise.

IDPriorityRequirement (the system shall...)
R1Mustlet staff add an item with a unique ID, a name and a category (snowshoes, skates, skis or game)
R2Mustrecord a loan of an available item to a member; the due date is 14 days after the loan date
R3Mustrecord a return and show the late fee: $0.25 per day late, to a maximum of $5.00
R4Mustlist every overdue item with the member number and the number of days late
R5Mustsave all items, members and loans to files and load them when the program starts
R6Shouldsearch items by part of the name, ignoring upper and lower case
R7Shouldrefuse a loan if the member already has 3 items out
R8Couldshow the 5 most-borrowed items this month
R9Won't (this version)let members book items online from home
N1Mustrun on the centre's laptop with Python 3 and no internet connection
N2Mustrespond to any menu choice within 1 second with 500 items and 2000 loans
N3Shouldbe usable by a new volunteer after a 15-minute training session
N4Muststore only a member's number and name (no address, phone or birth date)
N5Couldoffer the menus in French as well as English
LendIt's requirements after the client interview. R = functional, N = non-functional. Every requirement has an ID so that designs, code and tests can refer to it.

What makes a requirement good?

A good requirement is:

  • Testable: you can describe a test that passes or fails. "Fast" is not testable; "within 1 second with 500 items" is.
  • Unambiguous: only one reasonable reading. "Members can borrow a few items" could mean 2 or 5; "at most 3 items at once" cannot.
  • Necessary: someone actually needs it (it traces back to a stakeholder).
  • Feasible: it can be built with the time, skills and budget available.
  • About what, not how: "save all loans to files" leaves the design to the team; "use a CSV file with 6 columns" is a design decision, and belongs in the design document.

Watch for vague words: fast, easy, user-friendly, flexible, etc., and so on, quickly, nice. Each one hides a question you must ask the client.

Worked example

Example 1: From vague to testable

Rewrite each of Denise's statements as a testable requirement. (a) "It should be easy for volunteers." (b) "Late fees, like we do now." (c) "It has to be quick."

  1. (a) Ask: easy for whom, measured how? Denise says new volunteers get about 15 minutes of training. Requirement N3: "A new volunteer can record a loan and a return without help after a 15-minute training session." Test: time a new volunteer.
  2. (b) Ask for the exact rule. The binder says 25 cents per day, and the centre never charges more than $5. Requirement R3: "$0.25 per day late, to a maximum of $5.00." Tests: 0 days late gives $0.00; 3 days gives $0.75; 20 days gives $5.00; 30 days gives $5.00.
  3. (c) Ask: quick doing what, with how much data? The centre has about 300 items and expects up to 2000 loan records in a few years. Requirement N2: "Respond to any menu choice within 1 second with 500 items and 2000 loans" (a safety margin above today's numbers).

Each vague wish became a requirement with a number in it, and each number came from asking the client, not from guessing.

User stories and acceptance criteria

Agile teams often write requirements as user stories, which keep the user and their reason in view:

As a role, I want goal so that reason.

A story is not finished until it has acceptance criteria: concrete examples that will become tests. A popular form is Given / When / Then: Given a starting situation, when something happens, then this is the result. Teams often write the story on the front of an index card and the criteria on the back.

Front: user story R4As a centre staff member,I want to see a list of overdue itemswith the member and days late,so that I can phone membersand get equipment back.Back: acceptance criteriaGiven SK-07 was due on Jan 11when today is Jan 15,then the list shows SK-07, member 1042,4 days late.Given nothing is overdue,then it says "No overdue items."Role, goal, reason on the front; testable examples on the back.
A user story card for R4. The front says who wants what and why; the back gives examples precise enough to become tests (January 11 to January 15 is 4 days).

Prioritizing with MoSCoW

There is never time for everything, so requirements are ranked with MoSCoW:

  • Must have: the release is useless or illegal without it.
  • Should have: important, but there is a workaround for a while (staff can scroll instead of search).
  • Could have: nice extras if time allows.
  • Won't have (this time): agreed to be out of this version. Writing these down is just as important as the Musts, because it prevents arguments later.

A common guideline is to keep the Musts to well under the time available, so that surprises eat into the Coulds, not into the deadline.

Must8Should3Could2Won't1LendIt's 14 requirements by priorityversion 1.0 cannot ship without these
LendIt has 8 Musts (R1 to R5, N1, N2, N4), 3 Shoulds (R6, R7, N3), 2 Coulds (R8, N5) and 1 Won't (R9). The Musts define the minimum the team must deliver.

The scope document

The scope document (sometimes called a project charter or statement of work) pulls this together. It is short, usually one to three pages, and the client signs it. A typical scope document has these sections:

  1. Background: the problem, in the client's words.
  2. Objectives: what success looks like.
  3. Stakeholders.
  4. In scope: the requirements that will be delivered.
  5. Out of scope: what will not be delivered.
  6. Deliverables: every item that will be handed over.
  7. Constraints: time, people, budget, technology.
  8. Assumptions: things believed to be true that, if wrong, would change the plan.
  9. Acceptance: how the client will decide that the project is finished.
  10. Sign-off.

Model: LendIt's scope document

LendIt Scope Document, version 1.0 · Prepared by Priya Sharma (PM) for Denise Tremblay, Maple Grove Community Centre · Week 1

1. Background. The centre lends winter equipment and games. Loans are kept in a paper binder; about one item in ten is returned late and some are lost.

2. Objectives. Record every loan and return; show overdue items at a glance; calculate late fees consistently.

3. Stakeholders. Denise (client, approves the project); front-desk staff and volunteers (users); members (borrowers); the team; the teacher.

4. In scope. Requirements R1 to R7 and N1 to N4 (all Must and Should items).

5. Out of scope. Online booking by members (R9), card payments, text or email reminders, a web or phone app.

6. Deliverables. LendIt program (source and a ready-to-run folder); test plan and test report; user guide and quick-reference card; one training session; support plan; project review report.

7. Constraints. Six weeks of class time; four team members; budget $0 (free software only); must run on the centre's laptop with Python 3, without internet.

8. Assumptions. Each item has a unique label ID (for example SS-01); members have a 4-digit member number; one laptop at the front desk.

9. Acceptance. Denise accepts version 1.0 when every Must requirement passes its acceptance test in front of her.

10. Sign-off. Client: ________ Date: ________ · Project manager: ________ Date: ________

IN SCOPE (version 1.0)add items (R1)record loans, 14-day due date (R2)returns and late fees (R3)overdue list (R4)save and load files (R5)search, 3-item limit (R6, R7)OUT OF SCOPEonline booking (R9)payments by cardtext-message remindersChange request:"Add skate sizes?"decided by thechange process,not slipped inAnything not inside the fence is not promised. Scope creep = features sneaking in unplanned.
The scope is a fence. Requirements inside it are promised; things outside are not. A new idea (like skate sizes) is a change request that goes through the change process (see the lesson on keeping a project on track) instead of being slipped in.

Checking requirements with a program

Requirements are data too. This script checks a few of LendIt's requirements for two common faults: vague words and missing acceptance tests (Won't items do not need one). It also counts the priorities.

VAGUE = ["fast", "easy", "user-friendly", "quickly", "nice", "etc"]
reqs = [
("R3", "Must", "Show the late fee when an item is returned.",
"Returned 3 days late: fee $0.75"),
("R4", "Must", "List overdue items quickly.", ""),
("R6", "Should", "Search items by part of the name, ignoring case.",
"Searching shoe finds Snowshoes (adult)"),
("R8", "Could", "Print a nice monthly report.", ""),
("R9", "Won't", "Members book items online.", ""),
]
counts = {}
for rid, priority, text, test in reqs:
counts[priority] = counts.get(priority, 0) + 1
words = text.lower().replace(".", " ").replace(",", " ").split()
vague = [w for w in VAGUE if w in words]
if vague:
print(rid, "uses vague words:", ", ".join(vague))
if test == "" and priority != "Won't":
print(rid, "has no acceptance test")
for p in ["Must", "Should", "Could", "Won't"]:
print(p, counts.get(p, 0))

Output: R4 uses vague words: quickly / R4 has no acceptance test / R8 uses vague words: nice / R8 has no acceptance test / Must 2 / Should 1 / Could 1 / Won't 1 (one line each)

The script turns each text into lower-case words, replacing full stops and commas with spaces so that "quickly." becomes "quickly". A word is flagged only if it matches a vague word exactly, so "fastest" would not be caught. A program cannot judge every requirement, but it can catch the easy mistakes before a human review.

Just for fun

A client once asked for a program that "does everything". The intern delivered print("everything"). Every requirement was technically met. Nobody was happy. (This is why requirements need acceptance criteria.)

Hands-on activity

Project step 2: Interview your client and write your scope document

You need: your client (a family member, coach or club leader), paper, and your project folder.

  1. Prepare 8 to 10 interview questions: 3 or 4 open questions ("Walk me through how you do this now.") and the rest specific ("What is the most you would ever need to store?").
  2. Interview your client for 15 to 20 minutes. Take notes. At the end, read your notes back and ask "Did I get that right?"
  3. If you can, observe the current process (the paper list, spreadsheet or habit your program will replace) and look at any existing documents.
  4. Write 8 to 15 requirements with IDs, at least 3 of them non-functional. Mark each with a MoSCoW priority. Include at least one Won't.
  5. Write 2 user stories with Given / When / Then acceptance criteria.
  6. Write your scope document using the LendIt model, and ask your client to sign it.
  7. Save it as docs/scope.md (or .txt) in your project folder.

What to look for: no vague words without numbers; a clear out-of-scope list; constraints that are true for you (your real weeks and hours); a client signature.

Your turn

1

Classify as functional (F) or non-functional (NF): (a) record a return; (b) respond within 1 second; (c) store no birth dates; (d) list overdue items; (e) run without internet.

2

Name four ways to gather requirements.

3

Rewrite as a testable requirement: "Members can't borrow too much."

4

Write R6 (search) as a user story.

5

Using R3, write two Given / When / Then acceptance criteria.

6

What does the "W" in MoSCoW mean, and why is it useful?

7

Why does every requirement get an ID?

More practice: warm-up

1

What does MoSCoW stand for?

2

Give the three parts of a user story.

3

Name two vague words to avoid in requirements.

4

Who signs the scope document?

5

What is scope creep?

More practice: on your own

1

Is "Use a CSV file with columns id, name, category" a good requirement? Explain.

2

Write an assumption and a constraint for your own (or an imagined) project, and explain the difference.

3

Denise asks, in week 3, for the program to send email reminders. Using the scope document, how should Priya respond?

4

In the requirement-checking script, R6's text is changed to "Search items easily by name." What is printed about R6? Explain.

5

Write N2 as Given / When / Then.

Challenge

1

LendIt has 8 Musts, 3 Shoulds, 2 Coulds and 1 Won't. Halfway through the project the team is two days behind. Using MoSCoW, explain what they should do and what they must not do.

2

Improve the script so that it also flags requirements whose text contains no digit, but only when the priority is Must. Write the extra lines.

3

A requirement says "The system shall store only a member's number and name." Explain why this is a requirement and not just a design choice, and how you would test it.

Check your understanding

Quiz

1.

Which is a non-functional requirement?

2.

Which requirement is testable?

3.

In MoSCoW, what does a "Won't" requirement mean?

4.

Which belongs in the scope document's "out of scope" section for LendIt?

5.

Which is the correct shape of a user story?

6.

Why should requirements be gathered with more than one method?

For parents and teachers

Big idea: B1.1 asks students to create a software project plan, starting with a scope document. This lesson covers gathering requirements, writing them so they can be tested, prioritizing them (MoSCoW) and writing the scope document that the client signs.

How to help: Be (or recruit) the client and let your teen interview you. Answer honestly, including "I don't know", and let them ask follow-up questions. Then read their scope document and sign it only if you understand exactly what you will get. Ask "How will you know that's done?" for any requirement without a number.

Common difficulties:

  • Writing design decisions ("use a list") as requirements. Requirements say what; designs say how.
  • Leaving out the out-of-scope list. It is the part that prevents arguments later.
  • Vague words (easy, fast). Each one should become a number agreed with the client.