Requirements
Requirements
Lecture outline
• What are requirements?
• How can we gather requirements?
• How can we document requirements?
• Use cases
Software requirements
Requirements specify what to build
• tell “what” and not “how”
• tell the problem, not the solution
• reflect system design, not software design
“what vs. how”: it’s relative
• One person’s what is another person’s how.
– “One person’s constant is another person’s variable.”
[Perlis]
• Roles of requirements
– customers: show what should be delivered; contractual base
– managers: a scheduling / progress indicator
– designers: provide a spec to design
– coders: list a range of acceptable implementations / output
– QA / testers: a basis for testing, validation, verification
Classifying requirements
• The classic way to classify requirements:
– functional: map inputs to outputs
• "The user can search either all databases or a subset."
• "Every order gets an ID the user can save to account storage."
– nonfunctional: other constraints
• ilities: dependability, reusability, portability, scalability, performance,
safety, security
• "Our deliverable documents shall conform to the XYZ process."
• "The system shall not disclose any personal user information."
• Another way to classify them (S. Faulk, U. of Oregon)
– Behavioral (user-visible): about the artifact (often measurable)
• features, performance, security
– Development quality attributes: about the process (can be
subjective)
• flexibility, maintainability, reusability
General classes of requirements
Example requirements types:
Feature set
GUI
Performance
Reliability
Expansibility (support plug-ins)
Environment (HW, OS, browsers)
Schedule
Gather requirements from users
The #1 reason that projects succeed is user
involvement
– Standish Group survey of over 8000 projects
• There are things in the world not • There are things in the machine that
represented by a given machine don’t represent anything in the world
– Book sequels or trilogies
– Null pointers
– Pseudonyms
– Deleting a record
– Anonymous books
– Back pointers 14
Good or bad requirements? (and why?)
• The system will enforce 6.5% sales tax on Washington
purchases.
• The system shall display the elapsed time for the car to
make one circuit around the track within 5 seconds, in
hh:mm:ss format.
• The product will never crash. It will also be secure against
hacks.
• The server backend will be written using PHP or Ruby on
Rails.
• The system will support a large number of connections at
once, and each user will not experience slowness or lag.
• The user can choose a document type from the drop-down
list.
How do we specify requirements?
• Prototype
• Use Cases
• Feature List
• Paper UI prototype
Cockburn's requirements template
Alistair Cockburn’s suggested outline for functional requirements:
1. purpose and scope
2. terms / glossary
3. use cases (the central artifact of requirements)
4. technology used
5. other
5a. development process -
participants, values (fast-good-cheap),
visibility, competition, dependencies
5b. business rules / constraints
5c. performance demands
5d. security (now a hot topic), documentation
5e. usability
5f. portability
5g. unresolved / deferred
6. human issues: legal, political, organizational, training
Use cases
• A use case is an example behavior of the system
• A use case characterizes a way of using a system
• It represents a dialog between a user and the system, from
the user’s point of view
• It captures functional requirements
• Example:
– Jane has a meeting at 10AM; when Jim tries to schedule
another meeting for her at 10AM, he is notified about the
conflict
22
Do use cases capture these?
Which of these requirements should be
represented directly in a use case?
Library patron
Use case summary diagrams
It can be useful to create a list or table of primary
actors and their "goals" (use cases they start). The
diagram will then capture this material.
Actor Goal
Library Patron Search for a book
Check out a book
Return a book
Librarian Search for a book
Check availability
Request a book from
another library
Use case summary diagram 1
Library System
Check out
Search
Librarian
Reserve
Library Patron
Record new
Gen catalog
Use case summary diagram 2
Investment
System
2. Informal use case
Informal use case is written as a paragraph
describing the scenario/interaction
• Example:
– Patron Loses a Book
The library patron reports to the librarian that she has
lost a book.
The librarian prints out the library record and asks
patron to speak with the head librarian, who will
arrange for the patron to pay a fee.
The system will be updated to reflect lost book, and
patron's record is updated as well.
The head librarian may authorize purchase of a
replacement book.
Structured natural language
• I
– I.A
• I.A.ii
– I.A.ii.3
» I.A.ii.3.q
• Although not ideal, it is almost always better than
unstructured natural language
– Unless the structure is used as an excuse to avoid
content
• You will probably use something in this general
style
30
3. Formal use case
Goal Patron wishes to reserve a book using the online
catalog
Primary Patron
actor
Scope Library system
Level User
Precondition Patron is at the login screen
• Exercises:
– Come up with 4 use case names for such software, and draw a
UML use case summary diagram of the cases and their actors.
– Write a formal (complete) use case for the Customer Checks Out
a Movie scenario.
2. Write the success scenario
• Main success scenario is the preferred
"happy path”
– easiest to read and understand
– everything else is a complication on this