Non-Functional Requirements
Chapter Eleven
Syllabus topic Module 1, "Requirement Engineering: ... Non-functional requirements".
Pages 63 to 67 of 499
In one line
A non-functional requirement states how well the system must do what it does, how fast, how securely, how reliably, how easily and on what, and it is only a requirement when it carries a number and a way to check it.
In the wording to use when asked: a non-functional requirement specifies a quality attribute or constraint on the system's operation, such as performance, reliability, security, usability or portability, stated with a measurable criterion and a method of verification, as distinct from a functional requirement, which specifies a behaviour.
Why they decide whether a system is used
A system can do every right thing and still fail. An ordering page that takes twenty seconds to load at 12:14, when everyone is ordering, does exactly what FR-7 says and is useless. A system that stores passwords in plain text does what FR-2 says and is a liability. A counter screen that needs typing during the rush does what FR-15 says and will be abandoned by the second day.
Non-functional requirements are also where student projects are weakest, because they are easy to write badly. "The system shall be fast, secure and user-friendly" appears in thousands of project reports and means nothing, because nobody can test it. This chapter is about writing ones that can be tested.
A map of qualities: ISO/IEC 25010
You do not have to invent the list of qualities a system can have. The international standard ISO/IEC 25010 defines a product quality model for software. Its current edition, ISO/IEC 25010:2023, replaced the 2011 edition, and ISO describes its model as "composed of nine characteristics", each divided into sub-characteristics. (The 2011 edition had eight, so a textbook written from it lists a slightly different set.) The nine, with the questions they ask of a system like yours:
| Characteristic | The question it asks | Some of its sub-characteristics |
|---|---|---|
| Functional suitability | does it do the right things, correctly and completely? | completeness, correctness, appropriateness |
| Performance efficiency | is it fast enough, with the resources available, at the load expected? | time behaviour, resource utilisation, capacity |
| Compatibility | does it work beside, and with, other systems? | co-existence, interoperability |
| Interaction capability | can its users use it, including users with disabilities? | learnability, operability, user error protection, inclusivity |
| Reliability | does it keep working, and recover when it does not? | faultlessness, availability, fault tolerance, recoverability |
| Security | does it protect information and resist attack? | confidentiality, integrity, authenticity, accountability, resistance |
| Maintainability | can it be understood, changed and tested? | modularity, analysability, modifiability, testability |
| Flexibility | can it be moved, installed and adapted? | adaptability, scalability, installability |
| Safety | can it avoid putting people or property in danger? | operational constraint, risk identification, fail safe |
Functional suitability is the functional requirements themselves, seen as a quality. The other eight are where non-functional requirements come from. Use the table as a checklist: go down it for your project, and for each characteristic either write a requirement or write why none is needed. For a canteen system, safety needs none, and saying so shows the question was asked.
Non-Functional Requirements
Turning a quality into a requirement
A quality becomes a requirement when you can answer five questions about it:
- Which quality? Name the characteristic.
- Measured how? Seconds, per cent, taps, pixels, attempts, hours.
- To what target? The number that separates pass from fail.
- Under what conditions? How many users, on what device, over what network, at what time.
- Verified how? Which test, in which chapter of your plan, will prove it.
Watch the difference:
| Untestable | Testable |
|---|---|
| The system shall be fast | With 100 students ordering in the same minute on the lab server, 95 per cent of menu and order requests are answered within 1 second |
| The system shall be secure | Passwords are stored only as salted scrypt hashes with the cost settings of the OWASP Password Storage Cheat Sheet |
| The system shall be user-friendly | A one-item order takes no more than 4 taps from the menu page |
| The system shall be available | The service restarts itself within 10 seconds after a crash, and starts when the server boots |
| The system shall work on phones | Every page is usable at a width of 320 CSS pixels without sideways scrolling |
Two details in the first testable row matter. "95 per cent" instead of "all" admits that at a moment of load a few requests will be slower, and sets a limit on how many. "On the lab server" fixes the conditions: the same system is faster on a powerful machine and slower on a weak one, so a performance requirement without its conditions cannot be checked.
Borrow numbers from standards
For some qualities, somebody has already done the hard work of choosing testable numbers, and you should use theirs rather than inventing your own.
Accessibility has the Web Content Accessibility Guidelines, WCAG 2.2, a W3C Recommendation. Its success criteria are precise:
| WCAG 2.2 success criterion | Level | What it requires |
|---|---|---|
| 1.4.3 Contrast (Minimum) | AA | text has a contrast ratio of at least 4.5:1 against its background, 3:1 for large text |
| 1.4.10 Reflow | AA | content works without scrolling in two dimensions at a width equivalent to 320 CSS pixels |
| 2.5.8 Target Size (Minimum) | AA | a pointer target, such as a button, is at least 24 by 24 CSS pixels, with some exceptions |
| 2.1.1 Keyboard | A | all functionality can be operated through a keyboard |
| 3.3.2 Labels or Instructions | A | labels or instructions are provided when content requires input |
Each of these is a requirement you can quote, with a number, and test. Level A is the minimum; level AA is the level most organisations aim for.
Non-Functional Requirements
Password storage has the OWASP Password Storage Cheat Sheet, which Chapter 31 uses. Performance has no universal standard number, so your target must come from your own problem, as the worked team's did from its load estimate in Chapter 6.
The worked project: non-functional requirements
The worked team went down the ISO list and wrote twelve requirements. Every one says how it will be verified, and every one was verified; the last column says where.
| ID | Characteristic | Requirement | Verified in |
|---|---|---|---|
| NFR-1 | performance efficiency: time behaviour | with 100 students ordering in the same minute on the lab server, 95 per cent of menu and order requests are answered within 1 second, and none fails | load test, Chapter 63 |
| NFR-2 | performance efficiency: capacity; reliability | when many students order the last k portions of an item at the same moment, exactly k orders are accepted | concurrency test, Chapters 45 and 63 |
| NFR-3 | security: confidentiality | passwords are stored only as salted scrypt hashes with settings from the OWASP Password Storage Cheat Sheet, and are never logged | unit tests and code review, Chapters 46 and 51 |
| NFR-4 | security: authenticity | the sign-in cookie cannot be read by page scripts, is not sent with another site's form posts, is sent only over HTTPS when the site uses HTTPS, and lasts 8 hours | integration tests, Chapter 53 |
| NFR-5 | security: confidentiality, integrity | each role can do only what the SRS allows it, and no student can see or change another student's order | integration and security tests, Chapters 53 and 65 |
| NFR-6 | security: resistance | after 5 failed sign-ins for one email address from one network address within 15 minutes, further attempts are refused for the rest of that window | integration test, Chapter 53 |
| NFR-7 | interaction capability: operability | every page is usable at 320 CSS pixels wide without sideways scrolling (WCAG 2.2 SC 1.4.10), a one-item order takes no more than 4 taps from the menu page, and every counter action is a single tap, with no typing | measured in the browser, Chapter 54 |
| NFR-8 | interaction capability: inclusivity | every input has a visible label; text contrast is at least 4.5:1 (SC 1.4.3); tap targets are at least 24 by 24 CSS pixels (SC 2.5.8); every action works from a keyboard (SC 2.1.1) | measured, Chapter 54 |
| NFR-9 | compatibility; flexibility | works in current Chrome, Firefox, Safari and Edge, and in the team's Android app | system testing, Chapters 54 and 59 |
| NFR-10 | reliability: recoverability | the service restarts itself within 10 seconds of a crash, and starts when the server boots | server tests, Chapter 60 |
| NFR-11 | maintainability: testability, analysability | the whole automated test suite runs with one command, and the README lets a new developer run the system within 30 minutes | Chapters 50 and 69 |
| NFR-12 | flexibility: installability | runs on Windows, macOS and Linux with Node.js 22 or later and MySQL 8.0 or later | installation on the team's machines, Chapter 39 |
Non-Functional Requirements
Some notes on how they arrived at these.
NFR-1 is the load estimate of Chapter 6 made into a promise. The team estimated a peak of about 7 orders a minute and set the requirement at 100, about fourteen times more, because the estimate might be wrong and the cost of a slow rush is high.
NFR-2 came from a question nobody asked in an interview. Ganesh had said two students sometimes claim the same plate. Farhan asked what happens if they both press Place order for the last portion at the same instant. The answer depends entirely on how the stock is updated, and the requirement makes sure somebody tests it.
NFR-7's 320 pixels is WCAG's number, not the team's. Their first draft said 360, the width of a common phone. Reading WCAG 2.2, they found SC 1.4.10 sets 320, and adopted it: a published number is easier to defend than a guessed one.
The team measured NFR-8 before writing it. They computed the contrast of every text colour in their stylesheet with the formula WCAG gives for relative luminance, and the weakest pair, the red of an error message on white, was 6.47:1, comfortably above 4.5:1. A requirement you already know you meet is a strong one to put in front of an examiner.
Safety was considered and left out, in writing. Nothing the canteen system does can put a person or property in danger, and the SRS says so under safety, so the reader knows the question was asked.
Do this for your project
- Go down the nine ISO/IEC 25010 characteristics. For each, write a requirement or a sentence saying why none is needed.
- For each requirement answer the five questions: quality, measure, target, conditions, verification.
- Take numbers from standards where they exist: WCAG 2.2 for accessibility, the OWASP cheat sheets for security.
- Take performance numbers from your own load estimate, with a margin.
- Add a "verified in" column and make sure your test plan in Module 2 contains every test it names.
- Where you can, measure before you promise.
Mistakes that cost marks
Adjectives instead of numbers. Fast, secure, reliable, user-friendly, scalable: none is testable without a number and a condition.
A target with no conditions. "Within 1 second" on what machine, with how many users?
A non-functional requirement no test ever checks. It is a claim in the SRS the examiner can ask you to demonstrate.
Non-Functional Requirements
Security as one line. Security is several different requirements about passwords, sessions, access and attack, each tested differently.
Accessibility forgotten. Many examiners now ask about it, and WCAG 2.2 gives you ready-made, testable requirements.
Quick revision
- A non-functional requirement says how well; it needs a number and a way to verify it.
- ISO/IEC 25010:2023 has nine characteristics: functional suitability, performance efficiency, compatibility, interaction capability, reliability, security, maintainability, flexibility, safety. The 2011 edition had eight.
- Five questions: which quality, measured how, to what target, under what conditions, verified how.
- Borrow numbers: WCAG 2.2 (contrast 4.5:1, reflow at 320 CSS px, targets 24 by 24 CSS px, keyboard, labels); the OWASP cheat sheets for security.
- Performance targets come from your own load estimate, with a margin.
- Every requirement has a "verified in" entry that leads to a real test.
Questions you must be able to answer
1. Distinguish functional and non-functional requirements with one example of each from the worked project. A functional requirement states a behaviour: the system shall let a student cancel their own order while it is placed. A non-functional requirement states how well the system behaves: with 100 students ordering in the same minute, 95 per cent of menu and order requests are answered within 1 second.
2. What is ISO/IEC 25010, and how is it used when writing requirements? The international standard that defines a product quality model for software; its 2023 edition has nine characteristics, each with sub-characteristics. It is used as a checklist: for each characteristic the team either writes a measurable requirement or records why none is needed.
3. Rewrite "the system should be user-friendly" as testable requirements. For example: a one-item order takes no more than 4 taps from the menu page; every page is usable at 320 CSS pixels wide without sideways scrolling; every input has a visible label; every counter action is a single tap.
4. Why does NFR-1 say 95 per cent and name the lab server? Because under load a few requests are always slower, so the requirement limits how many may be, and because performance depends on the machine and the load, so a target without its conditions cannot be tested or reproduced.
5. Which WCAG 2.2 success criteria did the worked project adopt, and what does each require? 1.4.3, text contrast of at least 4.5:1; 1.4.10, no two-dimensional scrolling at 320 CSS pixels wide; 2.5.8, pointer targets of at least 24 by 24 CSS pixels; 2.1.1, all functions operable from a keyboard; and labels for every input, as 3.3.2 requires.
The rest of this subject
These notes are cut from the University's printed syllabus. Open the syllabus itself for the same subject.