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:
- Functional Requirement (FR) — representing what the system must do.
- 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
-
Non-functional requirement - Wikipedia - Detailed explanation of non-functional requirements and quality attributes in systems engineering. ↩ ↩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
-
Functional and Non Functional Requirements - GeeksforGeeks - Comparison of functional and non-functional requirements with software-specific examples. ↩
-
Nonfunctional Requirements: Examples, Types and Approaches - AltexSoft - Comprehensive guide on quality attributes, NFR specifications, and measurable metrics in software engineering. ↩
-
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 under peak load').
Differentiating FRs and NFRs: Observable Criteria
To distinguish between functional and nonfunctional requirements, engineers use several observable criteria:
- 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) .
- 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 to load) .
- Measurement: FRs are binary (either the feature exists or it does not). NFRs are evaluated along a continuous spectrum using quantitative metrics.
Footnotes
-
Functional and Non Functional Requirements - GeeksforGeeks - Comparison of functional and non-functional requirements with software-specific examples. ↩
-
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:
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 (): where is the Mean Time Between Failures and is the Mean Time To Repair . A typical requirement might state: "The system shall achieve availability ()."
- Throughput (): where is the number of processed transactions and is the time interval. For example: "The system shall support a minimum throughput of (TPS)."
Footnotes
-
Nonfunctional Requirements: Examples, Types and Approaches - AltexSoft - Comprehensive guide on quality attributes, NFR specifications, and measurable metrics in software engineering. ↩
-
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 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
-
Functional and Non Functional Requirements - GeeksforGeeks - Comparison of functional and non-functional requirements with software-specific examples. ↩
Evaluating Requirement Quality
- 1Step 1
Select a draft requirement from the SRS. For example: 'The system's search function should be fast and secure.'
- 2Step 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.
- 3Step 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).
- 4Step 4
Specify the exact conditions under which the metric applies. For example: 'under a peak load of 500 concurrent users'. Formulate the mathematical boundary:
- 5Step 5
Combine the elements into an unambiguous, testable statement: 'The search function shall return results within of the query submission, tested under a simulated load of up to 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)
- 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."
- LMS-FR-02 (Catalog Search): "The system shall allow users to search for books by entering the title, author, or ISBN."
- 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)
- LMS-NFR-01 (Performance): "The catalog search query shall return matches and render results on screen within for a database containing up to book records."
- 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 ."
- LMS-NFR-03 (Reliability): "The system shall maintain a mean time between failures () of at least of continuous operation."
The Requirements Engineering Lifecycle
Elicitation
Phase 1Gather needs from stakeholders using interviews, surveys, workshops, and observation to extract raw user stories."
Analysis & Classification
Phase 2Differentiate between functional capabilities and nonfunctional constraints. Group quality attributes into performance, security, and usability categories."
Specification
Phase 3Translate informal needs into formal, measurable 'shall' statements within the Software Requirements Specification (SRS) document."
Validation & Verification
Phase 4Review requirements against quality attributes (testability, ambiguity) to ensure they can be objectively tested during system integration."
Requirements Analysis Deep-Dive FAQs
Knowledge Check
Which of the following represents a valid, measurable nonfunctional requirement for system performance?