Computer Engineering is coming soon

We're still writing and reviewing the notes for every subject, and we'll open it when every subject is ready. Meanwhile you can practise aptitude, ask Aria about any subject, or see the branches that are ready.

Eliciting requirements and use cases

Concise student notes on how to gather software requirements and write/use use cases, with definitions, steps, worked examples and exam guidance.

Drafted with Aria, reviewed by the AiCanCode.org team · Updated . How we write and check our notes. Spotted an error? Use Give Feedback at the bottom of the page.

Why it matters

Requirements are what a system must do and how it must behave. Requirements elicitation is the disciplined activity of talking to people and studying the environment to discover those requirements; engineers and analysts use it to produce a clear, testable SRS (Software Requirements Specification) and useful use cases that guide design, testing and project planning.

Key ideas

Start with definitions (I define each term before using it):

  • Requirements elicitation: the process of discovering the needs and constraints of stakeholders for a proposed software system. Use this term to describe all activities that find, record and confirm requirements.
  • Stakeholder: any person, group or organization with an interest in the system (users, managers, regulators, maintainers). A stakeholder may be a user or not.
  • Functional requirement: a statement of a function or behaviour the system must provide (for example, "the system shall allow a user to create an account").
  • Non-functional requirement: a constraint on how the system performs functions (for example, performance, security, usability, reliability). Also called quality attributes.
  • Use case: a description of how an actor interacts with the system to achieve a goal. It captures sequences of steps (scenarios) and alternatives.
  • Actor: an external role that interacts with the system. An actor represents a role (e.g., "Customer"), not a specific person or device.
  • Scenario: one possible sequence of interactions (steps) between actor(s) and system to accomplish a use case goal.
  • Precondition: a condition that must be true before the use case begins.
  • Postcondition: the state that must be true after the use case completes successfully.
  • Primary actor: the actor that initiates the use case to achieve a goal.
  • Secondary actor: an actor that the system interacts with to help the primary actor (e.g., payment gateway).
  • Include relationship: a relationship where one use case always uses the behaviour of another. Use it to avoid repeating steps.
  • Extend relationship: a relationship where optional or conditional behaviour extends a base use case at specific extension points.
  • System boundary: a box in a use case diagram that separates actors (outside) from use cases (inside); it defines what belongs to the system.
  • Use case specification: a textual template describing one use case (name, brief description, actors, pre/postconditions, main flow, alternate flows, exceptions).
  • Requirement traceability: linking requirements to design, code and tests so each requirement can be followed through the lifecycle.
  • UML: Unified Modeling Language, a standard for diagrams including use case diagrams.

Goals and assumptions used in typical university answers:

  1. Elicitation must be iterative: you rarely get correct and complete requirements in one pass. Assume multiple stakeholder meetings and prototypes.
  2. Prioritise requirements (e.g., MoSCoW: Must, Should, Could, Won't) so scope and schedule can be set.
  3. Use cases focus on goals and user-visible behaviour; they are not step-by-step UI scripts.

What to draw in diagrams (describe exactly so you can reproduce by hand):

  • Use case diagram for a system: draw a rectangle labelled with the system name (system boundary). Outside the rectangle, draw stick-figure actors and label them. Inside, draw ovals for use cases and label each. Draw lines from actors to the use cases they participate in. Use dashed arrows labelled <<include>> or <<extend>> for those relationships. For example, actor "Customer" connects to use case "Place Order"; dashed arrow from "Place Order" to "Validate Payment" with <<include>>. Arrow direction: <<include>> arrows point from the base use case to the included use case; <<extend>> arrows point from the extending use case to the base use case. Do not connect actors to the system boundary; connect actors to relevant use cases.

How to write a clear use case (step-by-step):

  1. Name: short verb-noun phrase (e.g., "Purchase Book").
  2. Brief description: 1–2 sentence goal.
  3. Primary actor and other actors.
  4. Preconditions and postconditions.
  5. Main success scenario (happy path) as numbered steps between actor and system.
  6. Alternate scenarios and exception handling with step numbers referencing the main flow where they diverge.
  7. Special requirements (non-functional) and assumptions.

Elicitation techniques (define and when to use):

  • Interview: one-to-one discussion to gather detailed needs. Use early and for key stakeholders.
  • Workshop: group session to discover shared needs and resolve conflicts. Use when stakeholders must reach agreement.
  • Observation (shadowing): watch users perform tasks in the real environment. Use when practices are tacit and hard to explain.
  • Prototyping: build a quick mock-up to validate understanding. Use for UI-heavy systems or ambiguous requirements.
  • Questionnaire: structured questions to reach many stakeholders. Use when stakeholders are many and geographically distributed.
  • Document analysis: study existing manuals, logs and forms.
  • Brainstorming: generate many ideas quickly; use early to elicit possibilities.

Validation: after elicitation, produce an SRS, review with stakeholders, and create traceability links so each use case maps to specific requirements and tests.

Formulas

List of use-case template fields (syntax to remember) — each line is a field and what it means:

UseCase: <Name> — the clear name of the use case.

PrimaryActor: <ActorName> — who initiates the use case.

Goal: <Short description> — the goal the use case achieves.

Trigger: <event> — the event that starts the use case (e.g., "Customer chooses Checkout").

Preconditions: <conditions> — required true state before start.

Postconditions: <conditions> — guaranteed state after successful end.

MainFlow: — numbered steps describing the normal interaction.

AlternateFlows: — branches from numbered steps with descriptions.

Exceptions: — failure cases and system responses.

SpecialRequirements: — non-functional constraints relevant to this use case.

Includes: <OtherUseCase> / Extends: <OtherUseCase> — relationships where needed.

Use these fields in any standard use case text template.

Worked examples

Example 1 — From interviews to requirements and a use case (online bookstore).

Context: You interviewed a bookstore manager and customers.

Step 1 (elicitation): Interview notes produced these needs: customers want to search books, add to cart, pay online, view order history; manager wants order reports and inventory update.

Step 2 (write 5 clear requirements):

  1. FR1: "The system shall allow a registered customer to search books by title, author or ISBN." (functional)
  2. FR2: "The system shall allow a customer to add books to a shopping cart and adjust quantities." (functional)
  3. FR3: "The system shall process payments using a third-party payment gateway and store payment status." (functional)
  4. NFR1: "Search queries shall return the first page of results within 2 s under normal load." (non-functional: performance)
  5. NFR2: "Customer personal data shall be stored encrypted at rest." (non-functional: security)

Step 3 (use case specification for "Purchase Book"):

  • UseCase: Purchase Book
  • PrimaryActor: Customer
  • Goal: Customer successfully buys one or more books.
  • Preconditions: Customer is logged in and has at least one item in the cart.
  • Postconditions: Order recorded; payment status stored; inventory reduced.
  • MainFlow:
    1. Customer chooses to checkout.
    2. System requests shipping and payment details.
    3. Customer provides details.
    4. System sends payment request to PaymentGateway (secondary actor).
    5. PaymentGateway confirms payment.
    6. System records order and updates inventory; system shows confirmation.
  • AlternateFlows:
    • 4a. If payment is declined, system shows error and allows retry or cancel.
  • SpecialRequirements: Payment processing must use SSL/TLS; data stored encrypted.

Example 2 — Create a use case diagram by hand (ATM Withdraw).

Text to draw: Draw a rectangle labelled "ATM System". Outside left draw actor stick figure labelled "Customer". Inside the rectangle draw three ovals labelled "Withdraw Cash", "Check Balance", "Print Receipt". Draw a line from Customer to all three ovals. Draw another actor outside right labelled "Bank" and draw association lines from "Bank" to the use cases that communicate with it (e.g., "Withdraw Cash" and "Check Balance"). Do not draw associations to the system boundary or dependency arrows between actors and use cases. If "Print Receipt" is optional, show a dashed <<extend>> arrow from "Print Receipt" to "Withdraw Cash" with an extension point "after transaction".

Model answer for a typical long question (exam style): "Explain steps in eliciting requirements and show how to produce a use case" — give an iterative plan: stakeholder identification, select techniques, prepare questions/prototype, run sessions, document requirements, review and validate, produce use case diagrams and specs, and link requirements to tests.

Common mistakes

  • Writing vague non-testable requirements: avoid words like "user-friendly" without measurable criteria.
  • Happy-path-only use cases: forgetting alternate and exception flows.
  • Skipping preconditions and postconditions in use case specs.
  • Not iterating: treating the first elicitation session as final.
  • Mixing UI steps (click this menu) into use case steps that should stay at goal level.

For your exam

Question types you will see: short definitions (define a stakeholder, define use case), short notes (compare interviews and observation), process steps (list and explain elicitation steps), diagram tasks (draw a use case diagram with actors and include/extend), and long questions asking you to produce a use case specification from a scenario. Full-marks answers include clear definitions, a correct diagram drawn as instructed (label system boundary, actors, ovals, include/extend), and a complete use case specification including pre/postconditions and alternate flows. For process questions, explain iterative validation and traceability.

Quick check

  1. What is the difference between a functional and a non-functional requirement?
  2. Name three elicitation techniques and when to use each.
  3. In a use case spec, what is the use of preconditions and postconditions?

Answers: 1) Functional = what system must do; non-functional = constraints/qualities. 2) Interview (detailed with key stakeholders), Observation (when tasks are tacit), Prototyping (when UI or unclear requirements exist). 3) Preconditions state what must be true before the use case starts; postconditions state the guaranteed state after success.

Finished this topic? Mark it so your progress, study plan and readiness keep up.

Stuck on something here?