|$ curl https://forge-ai.dev/api/markdown?path=docs/architecture/requirements
$cat docs/requirements-engineering.md
updated Today·35-45 min read·published

Requirements Engineering

ArchitectureRequirementsNFRIntermediate🎯Free Tools
Introduction

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

Use Choosing Architecture & SDLC after you can state drivers in the tables below.
Functional vs Non-Functional Requirements

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.

TypeExampleVerification
FunctionalUser can reset password via email linkAcceptance test / E2E
Performance NFRp95 checkout API < 200ms at 500 RPSLoad test
Security NFRPII encrypted at rest; admin actions auditedConfig review + tests
Availability NFR99.9% monthly for checkoutSLO + error budget
Maintainability NFRNew payment provider in ≤ 2 weeksArchitecture 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

Shipping all FRs while ignoring NFRs produces a feature-complete system that fails under load, fails audits, or cannot change.
Quality Attributes Deep Dive

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.

User Stories vs Use Cases
AspectUser storyUse case
FormAs a… I want… so that…Actor, precondition, main/alt flows
Best forIncremental backlog itemsComplex multi-step processes
RiskToo thin; missing rulesToo heavy; waterfall docs
Agile fitNativeUse 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.

story-with-ac.txt
TEXT
1Story: As a buyer, I want to apply a promo code so that I get a discount.
2
3AC:
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
INVEST for Stories
LetterMeaningArchitecture note
IIndependentReduce coupling so stories ship alone
NNegotiableDetails refine; NFRs still constrain
VValuableInclude enabler value, not only UI
EEstimableSpike if unknown
SSmallFits iteration; vertical slice
TTestableAC + NFR checks exist
MoSCoW Prioritization

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

Publish Won't lists. Architecture thrives when non-goals are clear — e.g., Won't: multi-region active-active in v1.
Acceptance Criteria

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 ACStrong AC
Works fastp95 < 200ms at 500 RPS in staging soak
Secure loginMFA required; lockout after 5 failures; no user enum
Can export dataCSV of last 90 days within 60s for ≤10k rows
PRD / FRD Shapes

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.
nfr-table.md
Markdown
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 |
How to Gather Requirements

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.

Tracing Requirements → Architecture Decisions

Every significant ADR should cite requirement IDs. This prevents orphan architecture and helps audits.

Requirement typeArchitecture implication
Strong consistency on money movementAvoid naive eventual systems; careful transaction boundaries; maybe monolith module first
Independent scale of search vs checkoutSeparate read path; caching; possible service extraction
Audit/rebuild of state over timeEvent log / event sourcing candidate
Swap payment vendors yearlyHexagonal ports for payment; anti-corruption layer
Team of 4, one productModular monolith over microservices
Multiple teams, clear domainsServices along bounded contexts
Spiky unpredictable loadServerless or autoscaling stateless tier
Sub-50ms hard realtimeCareful language/runtime; colocation; avoid cold starts
Multi-tenant isolation MustTenant-aware data model; noisy-neighbor controls
Air-gapped deployAvoid SaaS-only deps; packageable architecture
🔥

pro tip

If two requirements conflict (e.g., extreme agility vs extreme auditability), make the conflict explicit and resolve with stakeholder priority — architecture cannot invent free lunches.
More Mappings: Requirement → Style
If you must…Lean towardWatch out for
Ship fast with one teamModular monolith + Agile/DevOpsSkipping module boundaries
Prove layer discipline for auditsLayered architectureAnemic domain / business logic in UI
Keep domain pure of frameworksHexagonal / CleanOver-abstracted ports everywhere
Autonomous deploys per domainMicroservicesDistributed monolith
Decouple producers & consumersEvent-drivenDebugging & consistency
Optimize disparate read modelsCQRSDual-write complexity
Minimize idle infra costServerlessCold start & limits
Prioritize & Manage Change

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.
Requirements Checklist
requirements-ready.txt
TEXT
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
Common Mistakes
  • 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

A requirement that names a technology is usually a solution in disguise. Reframe to the underlying need, then choose technology in an ADR.

Community

Get help on Slack, Discord or VIP

Stuck on a guide? Join the community and ask.