Coursify

SOFTWARE ENGINEERING

Functional and Nonfunctional Requirements

This section focuses on two fundamental categories of software requirements and explains how to specify them clearly and measure them effectively.

Learning Goals

  • Define functional requirements and nonfunctional requirements with software-specific examples.
  • Differentiate between functional and nonfunctional requirement statements based on observable criteria.
  • Write at least three functional requirements from a simple system description.
  • Write at least three measurable nonfunctional requirements covering performance, security, usability, or reliability.
  • Evaluate whether a requirement statement is testable, measurable, and unambiguous.

In software engineering, requirements form the bedrock of the development lifecycle. A requirement is a description of how a system must behave, a service it must perform, or a constraint on its operation . These requirements are traditionally documented in a Software Requirements Specification (SRS) to align stakeholders, developers, and testers.

Requirements are broadly divided into two foundational categories:

  1. Functional Requirement (FR) — representing what the system must do.
  2. Nonfunctional Requirement (NFR) — representing how well the system must perform those behaviors .

The Architectural Relationship

While functional requirements describe the active business logic, nonfunctional requirements act as systemic constraints that cross-cut and shape the entire software architecture .

Footnotes

  1. Non-functional requirement - Wikipedia - Detailed explanation of non-functional requirements and quality attributes in systems engineering. 2

  2. Functional and Non Functional Requirements - GeeksforGeeks - Comparison of functional and non-functional requirements with software-specific examples.

Functional vs Non-functional Requirements Explained

Deep Dive: Functional Requirements (FR)

Functional requirements define the specific actions, calculations, data processing steps, and workflows that a system must execute . They are highly dynamic and map directly to user interactions.

Common Categories of Functional Requirements:

  • Authentication & Authorization: "The system shall verify user credentials against the database and assign roles."
  • Data Entry & Validation: "The system shall validate that the user's email address contains an '@' symbol before submitting the registration form."
  • Reporting & Analytics: "The system shall generate a monthly PDF financial report on the first day of every month."

Deep Dive: Nonfunctional Requirements (NFR)

Nonfunctional requirements, often referred to as "quality attributes" or the "-ilities" , do not provide direct functional utility to the user in isolation. Instead, they specify the operational criteria and environmental constraints under which the functional requirements must run .

Key Categories of Nonfunctional Requirements:

  • Performance
  • Security
  • Reliability
  • Usability
  • Quality Attribute
  • Scalability

Footnotes

  1. Functional and Non Functional Requirements - GeeksforGeeks - Comparison of functional and non-functional requirements with software-specific examples.

  2. Nonfunctional Requirements: Examples, Types and Approaches - AltexSoft - Comprehensive guide on quality attributes, NFR specifications, and measurable metrics in software engineering.

  3. Non-functional requirement - Wikipedia - Detailed explanation of non-functional requirements and quality attributes in systems engineering.

The 'Shall' Convention

In professional requirements engineering, functional requirements are traditionally written using the word shall (e.g., 'The system shall...'), while nonfunctional requirements specify system-wide constraints or quality metrics (e.g., 'The system's response time shall not exceed 200 ms200\text{ ms} under peak load').

Differentiating FRs and NFRs: Observable Criteria

To distinguish between functional and nonfunctional requirements, engineers use several observable criteria:

  1. Scope of Impact: FRs are usually localized to specific modules or actions (e.g., a checkout button). NFRs are global and cross-cutting, affecting the entire system architecture (e.g., database encryption) .
  2. Failure Mode: If an FR fails, a specific feature is broken (e.g., cannot reset password). If an NFR fails, the system may still work but becomes unusable, insecure, or slow (e.g., page takes 30textseconds30\\text{ seconds} to load) .
  3. Measurement: FRs are binary (either the feature exists or it does not). NFRs are evaluated along a continuous spectrum using quantitative metrics.

Footnotes

  1. Functional and Non Functional Requirements - GeeksforGeeks - Comparison of functional and non-functional requirements with software-specific examples.

  2. Non-functional requirement - Wikipedia - Detailed explanation of non-functional requirements and quality attributes in systems engineering.

Characteristics of Functional Requirements

  • Goal: Define system behavior and direct features.
  • Source: Derived directly from user stories and business logic.
  • Testing: Validated via functional testing (unit, integration, system, acceptance testing).
  • Example: 'The system shall allow the user to export search results to a CSV file.'
  • Mathematical representation of system state transformation: f(InputState)OutputStatef(\text{InputState}) \rightarrow \text{OutputState}

Writing Measurable Nonfunctional Requirements

A common pitfall in software engineering is writing vague NFRs. Statements like "The system must be fast" or "The portal should be highly secure" are subjective and untestable. To make NFRs measurable, we must specify precise metrics and thresholds .

Mathematical Modeling of Nonfunctional Metrics

Let's express some key NFR metrics mathematically:

  • Availability (AA): A=fractextMTBFtextMTBF+textMTTRtimes100A = \\frac{\\text{MTBF}}{\\text{MTBF} + \\text{MTTR}} \\times 100\\% where textMTBF\\text{MTBF} is the Mean Time Between Failures and textMTTR\\text{MTTR} is the Mean Time To Repair . A typical requirement might state: "The system shall achieve 99.999.9\\% availability (Age0.999A \\ge 0.999)."
  • Throughput (TT): T=fracNtT = \\frac{N}{t} where NN is the number of processed transactions and tt is the time interval. For example: "The system shall support a minimum throughput of Tge1500texttransactionspersecondT \\ge 1500\\text{ transactions per second} (TPS)."

Footnotes

  1. Nonfunctional Requirements: Examples, Types and Approaches - AltexSoft - Comprehensive guide on quality attributes, NFR specifications, and measurable metrics in software engineering.

  2. Non-functional requirement - Wikipedia - Detailed explanation of non-functional requirements and quality attributes in systems engineering.

Cost of Fixing Requirements Defects Across Lifecycle

Relative cost factor of correcting a requirements error at different development phases (relative to the Requirements Phase = 1x)

The chart above illustrates why getting requirements right—and making them testable—is critical. A defect introduced during the requirements phase that escapes to maintenance can cost up to 150times150\\times more to fix than if it were resolved immediately .

To avoid these costly errors, every requirement must be evaluated against strict quality parameters:

  • Testability
  • Ambiguity

Footnotes

  1. Functional and Non Functional Requirements - GeeksforGeeks - Comparison of functional and non-functional requirements with software-specific examples.

Evaluating Requirement Quality

  1. 1
    Step 1

    Select a draft requirement from the SRS. For example: 'The system's search function should be fast and secure.'

  2. 2
    Step 2

    Look for subjective words like 'fast', 'secure', 'user-friendly', or 'efficient'. These words have different meanings to different stakeholders. In our example, 'fast' and 'secure' are highly ambiguous.

  3. 3
    Step 3

    Translate subjective terms into measurable physical units. Replace 'fast' with a concrete response time metric (e.g., milliseconds). Replace 'secure' with specific cryptographic standards (e.g., TLS 1.3, AES-256).

  4. 4
    Step 4

    Specify the exact conditions under which the metric applies. For example: 'under a peak load of 500 concurrent users'. Formulate the mathematical boundary: ResponseTime500 ms under load L500 users\text{ResponseTime} \le 500\text{ ms} \text{ under load } L \le 500\text{ users}

  5. 5
    Step 5

    Combine the elements into an unambiguous, testable statement: 'The search function shall return results within 500 ms500\text{ ms} of the query submission, tested under a simulated load of up to 500500 concurrent users.'

Avoid Vague Quantifiers

Never use words like 'approximately', 'minimize', 'maximize', or 'as fast as possible' in requirement statements. If you cannot write a test case with a binary pass/fail outcome for the requirement, it is not testable!

Application: Requirements for a Library Management System (LMS)

To solidify these concepts, let's look at a practical scenario. Suppose we are building a digital Library Management System (LMS).

Scenario-Based Functional Requirements (FRs)

  1. LMS-FR-01 (Book Checkout): "The system shall allow registered members to check out books by scanning the book's barcode, provided the member has no outstanding overdue fines."
  2. LMS-FR-02 (Catalog Search): "The system shall allow users to search for books by entering the title, author, or ISBN."
  3. LMS-FR-03 (Overdue Notification): "The system shall automatically generate and email an overdue notice to members exactly 24 hours after their checkout period expires."

Scenario-Based Nonfunctional Requirements (NFRs)

  1. LMS-NFR-01 (Performance): "The catalog search query shall return matches and render results on screen within 1.5textseconds1.5\\text{ seconds} for a database containing up to 100,000100,000 book records."
  2. LMS-NFR-02 (Security): "All member passwords stored in the database shall be salted and hashed using the bcrypt algorithm with a work factor of 1212."
  3. LMS-NFR-03 (Reliability): "The system shall maintain a mean time between failures (textMTBF\\text{MTBF}) of at least 720texthours720\\text{ hours} of continuous operation."

The Requirements Engineering Lifecycle

Elicitation

Phase 1

Gather needs from stakeholders using interviews, surveys, workshops, and observation to extract raw user stories."

Analysis & Classification

Phase 2

Differentiate between functional capabilities and nonfunctional constraints. Group quality attributes into performance, security, and usability categories."

Specification

Phase 3

Translate informal needs into formal, measurable 'shall' statements within the Software Requirements Specification (SRS) document."

Validation & Verification

Phase 4

Review requirements against quality attributes (testability, ambiguity) to ensure they can be objectively tested during system integration."

Requirements Analysis Deep-Dive FAQs

Knowledge Check

Question 1 of 4
Q1Single choice

Which of the following represents a valid, measurable nonfunctional requirement for system performance?