Requirements Engineering
Requirements engineering is the discipline of discovering, analyzing, specifying, validating, and managing what a system must do and how well it must do it. It is the primary input to architecture. Patterns chosen without requirements are fashion; patterns chosen against measured quality attributes are engineering.
This page is the spine of the Architecture & SDLC section. Master it before committing to monoliths, microservices, event-driven designs, or process models. You will learn functional vs non-functional requirements, specification shapes, prioritization, validation, and how each requirement type drives architectural decisions.
info
Functional requirements (FR) describe behavior: inputs, outputs, business rules, workflows. Non-functional requirements (NFR) — also called quality attributes — describe qualities of that behavior: performance, security, scalability, maintainability, availability, usability, compliance.
| Type | Example | Verification |
|---|---|---|
| Functional | User can reset password via email link | Acceptance test / E2E |
| Performance NFR | p95 checkout API < 200ms at 500 RPS | Load test |
| Security NFR | PII encrypted at rest; admin actions audited | Config review + tests |
| Availability NFR | 99.9% monthly for checkout | SLO + error budget |
| Maintainability NFR | New payment provider in ≤ 2 weeks | Architecture fitness / drill |
Stakeholders often state NFRs vaguely ("make it fast and secure"). Your job is to make them measurable, prioritized, and owned. Unmeasurable NFRs cannot drive architecture — they only drive arguments.
warning
Performance & efficiency
Latency percentiles, throughput, resource cost per request. Drives caching, async boundaries, data model shape, and sometimes CQRS.
Scalability
Growth dimensions: users, data, tenants, regions. Drives stateless services, sharding readiness, modular boundaries for future extraction.
Availability & resilience
Uptime SLOs, RTO/RPO, degradation modes. Drives redundancy, bulkheads, multi-AZ, graceful degradation.
Security & privacy
Authn/z, encryption, threat model, data retention. Drives trust boundaries, zero-trust service auth, audit logs.
Maintainability & evolvability
Time-to-change, onboarding time, modularity. Drives hexagonal boundaries, ADRs, fitness functions.
Observability
Ability to diagnose. Drives structured logging, tracing, metrics standards as architectural constraints.
Usability & accessibility
Task success, WCAG. Drives frontend architecture and design system constraints.
Compliance
Regulatory controls and evidence. Drives SDLC gates, traceability, data residency architectures.
| Aspect | User story | Use case |
|---|---|---|
| Form | As a… I want… so that… | Actor, precondition, main/alt flows |
| Best for | Incremental backlog items | Complex multi-step processes |
| Risk | Too thin; missing rules | Too heavy; waterfall docs |
| Agile fit | Native | Use selectively for clarity |
Stories need acceptance criteria to be testable. Use cases shine when multiple actors and alternate flows must be unambiguous (billing disputes, KYC). Both can coexist: use cases as reference, stories as delivery slices.
| 1 | Story: As a buyer, I want to apply a promo code so that I get a discount. |
| 2 | |
| 3 | AC: |
| 4 | - Given a valid unused code, total updates before payment |
| 5 | - Given an expired code, show error; total unchanged |
| 6 | - Given a code limited to new users, reject for returning users |
| 7 | - Audit log records code, user id, order id |
| Letter | Meaning | Architecture note |
|---|---|---|
| I | Independent | Reduce coupling so stories ship alone |
| N | Negotiable | Details refine; NFRs still constrain |
| V | Valuable | Include enabler value, not only UI |
| E | Estimable | Spike if unknown |
| S | Small | Fits iteration; vertical slice |
| T | Testable | AC + NFR checks exist |
MoSCoW ranks scope: Must, Should, Could, Won't (this time). Apply to FRs and NFRs. A Must NFR (e.g., PCI controls) can outrank a Should feature.
- Must: release is invalid without it (legal, safety, core journey).
- Should: important but workaround exists short-term.
- Could: nice-to-have if capacity remains.
- Won't: explicit deferral — prevents silent scope creep.
best practice
Acceptance criteria turn intent into verification. Prefer Given/When/Then or checklist form. Include failure paths and audit/security expectations where relevant. For NFRs, acceptance is a measurable test or operational objective.
| Weak AC | Strong AC |
|---|---|
| Works fast | p95 < 200ms at 500 RPS in staging soak |
| Secure login | MFA required; lockout after 5 failures; no user enum |
| Can export data | CSV of last 90 days within 60s for ≤10k rows |
Product Requirements Documents (PRD) and Functional Requirements Documents (FRD) vary by org. A practical shape for architecture-ready specs:
- Problem, goals, non-goals, success metrics.
- Users/personas and primary scenarios.
- FR list with priorities and AC.
- NFR table with metrics, measurement method, owner.
- Constraints: team, budget, timeline, compliance, existing systems.
- Open questions and decision log links (ADRs).
- Rollout / migration / analytics plan.
| 1 | | ID | Quality | Metric | Target | Measure | Priority | |
| 2 | |----|---------|--------|--------|---------|----------| |
| 3 | | NFR-1 | Latency | p95 checkout | <200ms | k6 weekly | Must | |
| 4 | | NFR-2 | Availability | Monthly uptime | 99.9% | SLO | Must | |
| 5 | | NFR-3 | RPO | Data loss window | ≤5 min | Backup drill | Should | |
Interviews & workshops
Structured questions; separate wants from needs; capture conflicts between stakeholders.
Observation & analytics
Watch real workflows; instrument funnels; discover shadow processes.
Prototypes & spikes
Buy information when users cannot articulate needs abstractly.
Compliance inputs
Legal/security questionnaires become NFRs and constraints.
Ops & support
Ticket themes reveal reliability and UX requirements.
Validate continuously: walkthroughs, prototype tests, contract examples, and executable acceptance tests. Invalidated requirements should update the backlog and potentially supersede ADRs.
Every significant ADR should cite requirement IDs. This prevents orphan architecture and helps audits.
| Requirement type | Architecture implication |
|---|---|
| Strong consistency on money movement | Avoid naive eventual systems; careful transaction boundaries; maybe monolith module first |
| Independent scale of search vs checkout | Separate read path; caching; possible service extraction |
| Audit/rebuild of state over time | Event log / event sourcing candidate |
| Swap payment vendors yearly | Hexagonal ports for payment; anti-corruption layer |
| Team of 4, one product | Modular monolith over microservices |
| Multiple teams, clear domains | Services along bounded contexts |
| Spiky unpredictable load | Serverless or autoscaling stateless tier |
| Sub-50ms hard realtime | Careful language/runtime; colocation; avoid cold starts |
| Multi-tenant isolation Must | Tenant-aware data model; noisy-neighbor controls |
| Air-gapped deploy | Avoid SaaS-only deps; packageable architecture |
pro tip
| If you must… | Lean toward | Watch out for |
|---|---|---|
| Ship fast with one team | Modular monolith + Agile/DevOps | Skipping module boundaries |
| Prove layer discipline for audits | Layered architecture | Anemic domain / business logic in UI |
| Keep domain pure of frameworks | Hexagonal / Clean | Over-abstracted ports everywhere |
| Autonomous deploys per domain | Microservices | Distributed monolith |
| Decouple producers & consumers | Event-driven | Debugging & consistency |
| Optimize disparate read models | CQRS | Dual-write complexity |
| Minimize idle infra cost | Serverless | Cold start & limits |
Requirements change. Manage them:
- Single backlog (or synchronized backlogs) with clear ordering.
- Change impact analysis for Must NFRs and baseline architectures.
- Version requirements in regulated contexts; link to tests and releases.
- Kill outdated requirements explicitly — do not leave zombies.
| 1 | [ ] Problem and non-goals written |
| 2 | [ ] FRs have AC and priority |
| 3 | [ ] NFRs measurable with method + owner |
| 4 | [ ] Constraints listed (team, compliance, legacy) |
| 5 | [ ] Conflicts between stakeholders resolved or escalated |
| 6 | [ ] Trace IDs assigned for architecture-relevant items |
| 7 | [ ] Validation plan exists (tests, reviews, prototypes) |
| 8 | [ ] First ADRs can cite requirement IDs |
- Only documenting FRs; NFRs appear as panic during launch week.
- Acceptance criteria that restate the story title.
- Prioritizing by HiPPO (highest paid person's opinion) without MoSCoW evidence.
- Architecture decided in a slide before requirements workshop.
- Requirements that prescribe implementation ('use Kafka') instead of need ('decouple billing from checkout with durable async').
danger
Community
Get help on Slack, Discord or VIP
Stuck on a guide? Join the community and ask.