munotes®

Non-Functional Requirements

Get access to whole semester resourcesSemester Pass

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:

CharacteristicThe question it asksSome of its sub-characteristics
Functional suitabilitydoes it do the right things, correctly and completely?completeness, correctness, appropriateness
Performance efficiencyis it fast enough, with the resources available, at the load expected?time behaviour, resource utilisation, capacity
Compatibilitydoes it work beside, and with, other systems?co-existence, interoperability
Interaction capabilitycan its users use it, including users with disabilities?learnability, operability, user error protection, inclusivity
Reliabilitydoes it keep working, and recover when it does not?faultlessness, availability, fault tolerance, recoverability
Securitydoes it protect information and resist attack?confidentiality, integrity, authenticity, accountability, resistance
Maintainabilitycan it be understood, changed and tested?modularity, analysability, modifiability, testability
Flexibilitycan it be moved, installed and adapted?adaptability, scalability, installability
Safetycan 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.

munotes.in63

Non-Functional Requirements

Turning a quality into a requirement

A quality becomes a requirement when you can answer five questions about it:

  1. Which quality? Name the characteristic.
  2. Measured how? Seconds, per cent, taps, pixels, attempts, hours.
  3. To what target? The number that separates pass from fail.
  4. Under what conditions? How many users, on what device, over what network, at what time.
  5. Verified how? Which test, in which chapter of your plan, will prove it.

Watch the difference:

UntestableTestable
The system shall be fastWith 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 securePasswords are stored only as salted scrypt hashes with the cost settings of the OWASP Password Storage Cheat Sheet
The system shall be user-friendlyA one-item order takes no more than 4 taps from the menu page
The system shall be availableThe service restarts itself within 10 seconds after a crash, and starts when the server boots
The system shall work on phonesEvery 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 criterionLevelWhat it requires
1.4.3 Contrast (Minimum)AAtext has a contrast ratio of at least 4.5:1 against its background, 3:1 for large text
1.4.10 ReflowAAcontent works without scrolling in two dimensions at a width equivalent to 320 CSS pixels
2.5.8 Target Size (Minimum)AAa pointer target, such as a button, is at least 24 by 24 CSS pixels, with some exceptions
2.1.1 KeyboardAall functionality can be operated through a keyboard
3.3.2 Labels or InstructionsAlabels 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.

munotes.in64

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.

IDCharacteristicRequirementVerified in
NFR-1performance efficiency: time behaviourwith 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 failsload test, Chapter 63
NFR-2performance efficiency: capacity; reliabilitywhen many students order the last k portions of an item at the same moment, exactly k orders are acceptedconcurrency test, Chapters 45 and 63
NFR-3security: confidentialitypasswords are stored only as salted scrypt hashes with settings from the OWASP Password Storage Cheat Sheet, and are never loggedunit tests and code review, Chapters 46 and 51
NFR-4security: authenticitythe 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 hoursintegration tests, Chapter 53
NFR-5security: confidentiality, integrityeach role can do only what the SRS allows it, and no student can see or change another student's orderintegration and security tests, Chapters 53 and 65
NFR-6security: resistanceafter 5 failed sign-ins for one email address from one network address within 15 minutes, further attempts are refused for the rest of that windowintegration test, Chapter 53
NFR-7interaction capability: operabilityevery 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 typingmeasured in the browser, Chapter 54
NFR-8interaction capability: inclusivityevery 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-9compatibility; flexibilityworks in current Chrome, Firefox, Safari and Edge, and in the team's Android appsystem testing, Chapters 54 and 59
NFR-10reliability: recoverabilitythe service restarts itself within 10 seconds of a crash, and starts when the server bootsserver tests, Chapter 60
NFR-11maintainability: testability, analysabilitythe whole automated test suite runs with one command, and the README lets a new developer run the system within 30 minutesChapters 50 and 69
NFR-12flexibility: installabilityruns on Windows, macOS and Linux with Node.js 22 or later and MySQL 8.0 or laterinstallation on the team's machines, Chapter 39
munotes.in65

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

  1. Go down the nine ISO/IEC 25010 characteristics. For each, write a requirement or a sentence saying why none is needed.
  2. For each requirement answer the five questions: quality, measure, target, conditions, verification.
  3. Take numbers from standards where they exist: WCAG 2.2 for accessibility, the OWASP cheat sheets for security.
  4. Take performance numbers from your own load estimate, with a margin.
  5. Add a "verified in" column and make sure your test plan in Module 2 contains every test it names.
  6. 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.

munotes.in66

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.

munotes.in67

The rest of this subject

These notes are cut from the University's printed syllabus. Open the syllabus itself for the same subject.

Issue
Done!