PadhaikoAll subjects

Software Requirements Engineering

Software Engineering (ENCT 352)

Open in the Padhaiko app

3.1 Requirement engineering process

Definition

Requirements Engineering (RE)

Requirements Engineering (RE) is the systematic process of discovering, analyzing, documenting, validating, and managing the services a software system must provide and the constraints under which it must operate.

The requirements engineering process is typically structured as an iterative sequence of core activities (often supported by ongoing requirements management):

Requirements Engineering Process FlowText
+-------------+    +------------------+    +---------------+    +---------------+
| Feasibility | -> | Elicitation and  | -> | Specification | -> |  Validation   |
|    Study    |    |    Analysis      |    |    (SRS)      |    |  & Sign-off   |
+-------------+    +------------------+    +---------------+    +---------------+
                         ^                        |                     |
                         |____ Requirements ______|_____________________|
                               Management & Negotiation (Iterate as needed)
  1. Inception & Feasibility Study: Establishes basic problem understanding, stakeholders, and whether the system is technically, economically, and operationally feasible within budget and schedule.
  2. Elicitation (Requirements Gathering): Discovering requirements from stakeholders through interviews, questionnaires, observation/ethnography, workshops (JAD), prototyping, and document analysis.
  3. Elaboration & Analysis: Refining raw requirements to resolve conflicts, eliminate ambiguity, classify priorities, and build conceptual models (scenarios, data flows, domain classes).
  4. Negotiation: Reconciling competing stakeholder demands, budgets, and timelines through win-win trade-offs.
  5. Specification: Recording agreed requirements clearly and consistently in a formal Software Requirements Specification (SRS) or structured backlog.
  6. Validation: Reviewing and checking the SRS for completeness, consistency, realism, and testability via requirement reviews, prototyping, and test-case generation.
  7. Requirements Management: Tracking requirement changes, maintaining traceability matrices, and controlling scope creep throughout the lifecycle.

3.2 SRS (Structure, characteristics, users)

Definition

Software Requirements Specification (SRS)

A Software Requirements Specification (SRS) is a formal, structured technical contract between the customer and the development organization that completely describes what the software will do without prematurely prescribing how it will be implemented internally.

Structure of an SRS (IEEE Std 830 / ISO/IEC/IEEE 29148)

Standard IEEE 830 SRS Document Outline
SectionContents
1. IntroductionPurpose, document conventions, intended audience, product scope, and references
2. Overall DescriptionProduct perspective, major product functions, user classes/characteristics, operating environment, design/implementation constraints, assumptions and dependencies
3. Specific RequirementsExternal interfaces (UI, hardware, software, comms), detailed functional requirements, non-functional requirements (performance, security, reliability), and logical database requirements
Appendices & IndexGlossary, analysis models, and requirement traceability matrices (RTM)

Eight Characteristics of a Good SRS (IEEE 830)

Primary Users of an SRS

Users of the SRS and How They Use It
Stakeholder / UserPurpose of Using the SRS
System Customers / ClientsVerify that the specified behavior matches their business needs and approve changes
Project ManagersEstimate project cost, effort, team allocation, and milestone schedules
Software Designers & DevelopersUnderstand exact system behavior, interfaces, and constraints to architect and code the solution
Test / QA EngineersDerive system and acceptance test plans directly from verifiable requirements
Maintenance EngineersUnderstand intended functionality and constraints when diagnosing bugs or planning enhancements

3.3 Functional and non-functional requirements

AspectFunctional RequirementsNon-Functional Requirements
Core FocusDefine what the system must do—inputs, outputs, computations, and behaviorsDefine how well the system performs—quality attributes, constraints, and standards
ScopeSpecific features, services, or use casesOften system-wide properties across multiple features
Failure ImpactMissing feature or wrong output for a specific operationSystem becomes unusable, insecure, slow, or non-compliant overall
Examples"The system shall allow students to download semester fee receipts in PDF format.""95% of search queries shall respond within under concurrent users."

Categories of Non-Functional Requirements (Sommerville)

  1. Product Requirements: Specify runtime behavior of the software itself:
    • Usability, Efficiency (performance & memory), Dependability (reliability, availability, fault tolerance), Security.
  2. Organizational Requirements: Stem from policies and procedures of the customer or developer organization:
    • Process standards, programming language/framework mandates, delivery method.
  3. External Requirements: Arise from factors external to the system and its development process:
    • Regulatory/legal compliance (data privacy, tax rules), interoperability standards, ethical/safety mandates.

3.4 Gathering requirements using use cases modeling and scenarios

A scenario is a real-life story describing how a specific user interacts with a system to accomplish a particular goal. Use-case modeling generalizes scenarios into structured interactions between external actors and the system.

Use-Case Diagram: University Course RegistrationText
          +-----------------------------------------------+
          |        Course Registration System             |
          |                                               |
  (O)     |   ( Browse Course Catalog )                   |
  /|\ ----+-> ( Enroll in Course ) --- <<include>> ---> ( Verify Prerequisites )
  / \     |          ^                                    |
Student   |          | <<extend>>                         |         (O)
          |   ( Join Waitlist )                           | <------ /|\  Payment
          |                                               |         / \  Gateway
          |   ( Pay Semester Tuition ) -------------------+-------->
          +-----------------------------------------------+

Relationships in Use-Case Diagrams

  1. Association: Solid line connecting an actor to a use case it participates in.
  2. <<include>>: Mandatory shared sub-behavior always executed as part of the base use case (arrow points from base to included use case).
  3. <<extend>>: Optional or conditional behavior inserted at an extension point under specific conditions (arrow points from extending use case to base).
  4. Generalization: Inheritance between actors (e.g., Postgraduate Student Student) or between use cases.

Standard Use-Case Description Template

Essential Elements of a Use-Case Specification
FieldDescription
Use Case ID & NameUnique identifier and active verb-noun title (e.g., UC-03: Enroll in Course)
Primary Actor(s)Role initiating the interaction
PreconditionsSystem state that must hold true before the use case starts
Main Success ScenarioNumbered happy-path interaction steps between actor and system
Alternative / Exception FlowsBranching paths for errors, cancellations, or edge cases (e.g., course full, prerequisite unmet)
PostconditionsGuaranteed system state after successful completion

3.5 Agile requirements engineering

Unlike traditional plan-driven projects that freeze a thick SRS upfront, Agile requirements engineering treats requirements as evolving, lightweight, collaborative conversations refined just-in-time before implementation.

3.5.1 User stories and acceptance criteria

Definition

User Story

A User Story is a concise, informal description of a software feature written from the end user's perspective in the Connextra template:

The 3 C's and INVEST Criteria

Acceptance Criteria

Acceptance criteria specify the concrete boundary conditions and test scenarios a story must satisfy to be marked Done. They are commonly written in Given–When–Then format:

User Story with Acceptance Criteria (Given-When-Then)Text
Story: "As a registered student, I want to drop a course before the add/drop deadline
        so that I am not billed for a course I will not attend."

Acceptance Criterion 1 (Successful Drop):
  GIVEN the student is enrolled in ENCT 352 and today is before the add/drop deadline
  WHEN the student clicks "Drop Course" and confirms
  THEN the enrollment status changes to Dropped and tuition balance is recalculated.

Acceptance Criterion 2 (Past Deadline):
  GIVEN the current date is after the add/drop deadline
  WHEN the student attempts to drop ENCT 352
  THEN the system blocks the drop and displays "Add/Drop deadline has passed."

3.5.2 Product backlog creation and prioritization

The Product Backlog is an ordered, living inventory of all user stories, bug fixes, technical debt items, and architectural enablers needed for the product. Items near the top are small and detailed (sprint-ready), while items near the bottom are larger, coarse-grained epics.

Common Prioritization Techniques

  1. MoSCoW Method: Classifies items into Must have (non-negotiable), Should have (important), Could have (desirable if time allows), and Won't have (this release).
  2. Value vs. Effort (2×2 Matrix): Prioritizes High Value / Low Effort ("quick wins") first and defers Low Value / High Effort items.
  3. WSJF (Weighted Shortest Job First): Ranks backlog items by maximizing economic value delivered per unit of effort:

where . Higher WSJF items are scheduled first.

3.5.3 Story mapping basics

User Story Mapping (Jeff Patton) arranges user stories in a two-dimensional grid instead of a flat list, preserving the end-to-end user journey:

Two-Dimensional User Story MapText
BACKBONE (User Activities):   [ Browse Catalog ] ---> [ Select Course ] ---> [ Complete Checkout ]
                                      |                      |                       |
Release 1 (Walking Skeleton):   Search by code        Add to cart             Pay via card
---------------------------------------------------------------------------------------------------
Release 2 (Enhancements):       Filter by credits     Check prerequisites     Apply scholarship
---------------------------------------------------------------------------------------------------
Release 3 (Nice-to-have):       Course ratings        Auto-suggest schedule   Split-payment option

3.5.4 Continuous requirements refinement (Backlog grooming)

Backlog refinement (formerly backlog grooming) is a continuous collaborative activity in which the Product Owner and Development Team review upcoming Product Backlog items to keep the top of the backlog ready for future sprints.

Key refinement activities:


Worked Examples

Example 3.1

3.1

A university online exam portal has a non-functional availability requirement. Compare the maximum permitted annual unplanned downtime under two candidate Service Level Agreements (assume ):

  1. Availability ("three nines"), reported in hours per year.
  2. Availability ("four nines"), reported in minutes per year.

Part 1 — Annual Downtime for Availability: Unavailability fraction (). Total hours in days .

Part 2 — Annual Downtime for Availability:

Interpretation for SRS Drafting: Writing "The portal shall achieve annual availability (at most of downtime per year)" makes the non-functional requirement objective and verifiable against monitoring logs.

Answer:
  1. At availability, maximum annual downtime is .
  2. At availability, maximum annual downtime is .
Example 3.2

3.2

A Product Owner must prioritize three user stories in the Product Backlog using WSJF (Weighted Shortest Job First) on a Fibonacci-like scale ():

StoryBusiness ValueTime CriticalityRisk ReductionJob Size
US-1: Two-Factor Login
US-2: PDF Grade Sheet Export
US-3: Automated Fee Reminder

Compute the Cost of Delay and WSJF score for each story, and determine the optimal implementation order.

Compute Cost of Delay ():

  • US-1:
  • US-2:
  • US-3:

Compute WSJF Scores ():

  • US-1:
  • US-2:
  • US-3:

Rank Backlog Priority: US-3 has the highest WSJF () because it delivers high Cost of Delay () with small effort (), so it is scheduled first. US-1 and US-2 tie at (between tied items, smaller job size US-1 is typically preferred to deliver value sooner).

Answer:

, , . Optimal order: US-3 first, followed by US-1, then US-2.

Example 3.3

3.3

How to Answer a Past Exam Question: "Write a user story, three INVEST checks, and Given–When–Then acceptance criteria for an online library book-renewal feature."

1. Write the User Story in Standard Format: "As a university student, I want to renew an eligible borrowed library book online so that I can extend my borrowing period without visiting the library desk."

2. Demonstrate Three INVEST Checks:

  • Independent: Depends only on existing loan records, not on fine-payment gateway changes.
  • Valuable: Saves student travel time and reduces desk queue congestion.
  • Small & Testable: Fits within one sprint with clear pass/fail rules (renewal count limit and reservation check).

3. Provide Two Clear Acceptance Criteria (Happy Path + Edge Case):

  • Happy Path: GIVEN the student has fewer than renewals on the book and no pending hold exists, WHEN they select Renew, THEN the due date extends by days.
  • Edge Case: GIVEN another user has placed a reservation hold on the book, WHEN the student attempts to renew, THEN renewal is denied with message "Book is reserved by another patron."
Answer:

A complete answer pairs the As a / I want / so that user story with concrete INVEST justifications and both positive and negative Given–When–Then acceptance scenarios.


Exercises

Practice Exercises — Software Requirements Engineering

Question 1

Describe the requirements engineering process and explain the role of feasibility study, elicitation, specification, validation, and requirements management.

Core RE Stages:

  1. Feasibility Study: Assesses technical, economic, and operational viability before major investment.
  2. Elicitation & Analysis: Collects stakeholder needs (interviews, workshops, observation, prototypes) and resolves conflicts.
  3. Specification (SRS): Documents agreed requirements unambiguously as functional and non-functional requirements.
  4. Validation: Verifies via reviews and test cases that the SRS reflects true user needs and is testable.
  5. Requirements Management: Controls requirement changes and preserves traceability across the software lifecycle.
Answer:

The RE process iterates through feasibility study, elicitation/analysis, specification, validation, and requirements management to ensure the software solves the right problem within realistic constraints.

Question 2

What is an SRS? State the IEEE 830 structure of an SRS, list its eight desirable characteristics, and name four distinct user groups of the SRS.

SRS Definition and IEEE 830 Structure: An SRS is a formal specification of what the software must do. Under IEEE 830, it comprises: (1) Introduction, (2) Overall Description, (3) Specific Requirements, and Appendices/Index.

Eight Characteristics and Four User Groups:

  • Characteristics: Correct, Unambiguous, Complete, Consistent, Ranked for importance/stability, Verifiable, Modifiable, Traceable.
  • Users: Customers/clients, project managers, software designers/developers, and QA/test engineers (plus maintenance engineers).
Answer:

An SRS specifies external system behavior and constraints across Introduction, Overall Description, Specific Requirements, and Appendices. It should be correct, unambiguous, complete, consistent, ranked, verifiable, modifiable, and traceable, serving customers, managers, developers, testers, and maintainers.

Question 3

Distinguish between functional and non-functional requirements with two concrete examples of each, and explain how to make a vague non-functional requirement testable.

Functional vs. Non-Functional Requirements:

  • Functional Requirements state specific services/functions (e.g., "The system shall generate a monthly payroll slip"; "Users shall reset forgotten passwords via email OTP").
  • Non-Functional Requirements constrain system-wide qualities such as performance, security, or availability (e.g., "Passwords shall be hashed using Argon2id"; "Page load time shall be under for of requests").

Making NFRs Testable: Replace subjective adjectives ("fast", "secure", "reliable") with measurable thresholds, workloads, and evaluation criteria (response-time percentiles, throughput RPS, availability percentages, encryption standards).

Answer:

Functional requirements define what the system does; non-functional requirements define how well it performs and constraints it obeys. Vague NFRs become testable when stated with measurable thresholds, workloads, and objective verification metrics.

Question 4

Explain use-case modeling in requirements gathering. Differentiate between <<include>> and <<extend>> relationships with a small library management example.

Use-Case Modeling Overview: Use-case modeling captures functional interactions between external actors and the system to achieve a user goal, documented visually in a use-case diagram and textually via main/alternative scenarios.

<<include>> vs. <<extend>>:

  • <<include>> (Mandatory Reuse): Base use case always invokes the included use case (e.g., Issue Book <<include>> Verify Membership Card).
  • <<extend>> (Optional/Conditional Behavior): Extending use case runs only under specific conditions (e.g., Pay Late Fine <<extend>> Return Book only when the book is overdue).
Answer:

Use-case modeling describes actor-system interactions toward user goals. <<include>> represents mandatory sub-behavior always executed by the base use case, whereas <<extend>> represents optional/conditional behavior triggered only under specific conditions.

Question 5

Compare Story Mapping and Backlog Refinement (Grooming) in agile requirements engineering, and prioritize the following three backlog stories using WSJF:

Story Mapping vs. Backlog Refinement:

  • Story Mapping organizes user stories into a 2D grid (user workflow left-to-right, release priority top-to-bottom) to visualize the end-to-end journey and slice MVP releases.
  • Backlog Refinement is the ongoing process of splitting epics, clarifying acceptance criteria, re-estimating, and re-ordering top backlog items to keep them sprint-ready (DEEP).

WSJF Calculations:

  • Story A:
  • Story B:
  • Story C:
Answer:

Story mapping visualizes end-to-end user journeys into release slices, whereas backlog refinement continuously prepares and prioritizes individual stories. WSJF scores are Story B () > Story C () > Story A (), so the priority order is B, then C, then A.

← The Software ProcessArchitectural Design →