4.5.3 · HinglishSoftware Engineering

Requirements — functional vs non-functional, user stories, acceptance criteria

2,031 words9 min readRead in English

4.5.3 · Coding › Software Engineering


1. Requirements exist kyon karte hain (WHY)

Ek galat assumption ko fix karne ki cost roughly exponentially badhti hai jitna late pakdi jaye:

jahaan = stage (requirements → design → code → test → production). Requirements stage par fix karne ki cost hai, jo production mein ban jaati hai. WHY this matters: requirements likhna is curve ke sabse steep hisse ke against sasta leverage hai.


2. Functional vs Non-Functional (core split)

Aspect Functional Non-functional
Answers WHAT it does HOW WELL
Example "User can reset password" "Reset email arrives in < 5 s, 99% of time"
Failure looks like Feature missing Feature present but too slow/insecure
Verified by feature test benchmark / load / pen-test
Figure — Requirements — functional vs non-functional, user stories, acceptance criteria

3. User Stories (WHAT — humans ke liye packaged)


4. Acceptance Criteria ("done" ki testable definition)

Ek popular HOW-format hai Given-When-Then (Gherkin):


5. Galtiyan (Steel-manned)


6. Yeh sab kaise fit hote hain (HOW workflow chalta hai)

  1. Stakeholders se baat karo → raw needs collect karo.
  2. Har need ko FR (verbs) aur NFR (measurable qualities) mein split karo.
  3. User-facing FRs ko user stories (role/goal/benefit) ki form mein package karo, unhe INVEST rakho.
  4. Har story ke liye, acceptance criteria (Given-When-Then) likho — edge cases aur koi bhi NFR thresholds including.
  5. Estimate karo, benefit se prioritise karo (80/20), banao, phir story ko "done" tab hi verify karo jab saare AC pass ho jaayein.

Flashcards

Functional requirement kaunsa ek sawaal answer karta hai?
WHAT system ko karna chahiye (ek behaviour/feature, ek "verb").
Non-functional requirement kaunsa ek sawaal answer karta hai?
HOW WELL — ek measurable quality/constraint (speed, security, availability...).
3-part user story template doh.
As a , I want , so that .
User story mein "so that " kyun hota hai?
Yeh value batata hai, prioritisation/80-20 filter ki tarah kaam karta hai aur cost justify karta hai.
INVEST acronym ka matlab kya hai?
Independent, Negotiable, Valuable, Estimable, Small, Testable.
Acceptance criterion kya hota hai?
Ek specific pass/fail condition jo ek story ko accept hone ke liye meet karni chahiye ("definition of done").
Gherkin AC format ke teen keywords batao.
Given (context), When (action), Then (expected outcome).
Non-functional thresholds aksar kahan concrete bante hain?
Acceptance criteria mein, measurable numbers ke roop mein (e.g. "≤ 2 s for 95th percentile").
Performance ko non-functional ke roop mein alag kyun karein feature ke hisse ki jagah?
Ek feature fully present ho sakta hai phir bhi bahut slow ho; yeh split ek measurable target aur alag test (load test) force karta hai.
"As a user I want a Redis cache so pages load fast" mein kya galat hai?
Yeh ek solution (how) batata hai, goal nahi; stories problem space mein rehni chahiye aur design open chhodni chahiye.
FURPS+ tumhe kya check karne ki yaad dilata hai?
Functionality, Usability, Reliability, Performance, Supportability + security/scalability/legal NFRs.
Requirements error ko production mein fix karna itna zyada expensive kyun hota hai?
Cost roughly exponentially har stage ke saath badhti hai; ek galat assumption design, code, aur tests mein propagate ho jaata hai.

Recall Feynman: ek 12-saal ke bacche ko samjhao

Socho tum apne dost se sandwich banane ko kehte ho. Functional = kya daalna hai: "bread, cheese, ham." Non-functional = kaise chahiye: "1 minute mein ready, zyada salty nahi, triangles mein kata hua." User story tum ho yeh kehte hue ki kyun: "Main ek bhooka baccha hoon jo cheese & ham chahta hoon taaki class mein bhookha naa rahoon." Acceptance criteria woh tarika hai jisse dost prove karta hai ki sahi hai: "Given tumne mujhe bread diya, jab finish hoon, tab cheese AUR ham hai, bread jali nahi hai, aur ek minute se kam laga." Agar inme se koi bhi fail ho, sandwich 'done' nahi hai — chahe theek lagta ho!

Connections

  • Software Development Life Cycle — requirements pehla SDLC phase hain.
  • Agile and Scrum — user stories product backlog mein rehti hain.
  • Test-Driven Development — acceptance criteria automated tests ban jaate hain.
  • Software Design — design woh how answer karta hai jo stories deliberately omit karti hain.
  • Stakeholder Analysis — har story mein <role> yahaan se aata hai.
  • Estimation and Story Points — INVEST ka "Estimable/Small" hissa.

Concept Map

justified by

splits into

splits into

is the

is the adverb in

categorised by

packaged as

constrains

made testable by

verified by

Requirements = written agreement on done

Cost grows exponentially if caught late

Functional = WHAT it does

Non-functional = HOW WELL

Verb vs Adverb test

FURPS+ menu of qualities

User stories

Acceptance criteria

Feature and benchmark tests