Skip to content

Quality Attributes, Functional & Non-Functional Requirements ​

"The quality of a system is the degree to which the system satisfies the stated and implied needs of its various stakeholders, and thus provides value." — ISO/IEC 25010 quality model, as quoted on the ISO/IEC 25000 portal (iso25000.com)

Summary: a requirement says either what the system does (functional) or how well, how fast, how safely and how cheaply it does it (quality attributes, usually called non-functional requirements). The second kind decides the architecture, and it only helps when it is written as a measurable scenario and checked by an automatic test. Focus: functional versus non-functional versus constraint, the ISO/IEC 25010:2023 model with every sub-characteristic, quality attribute scenarios, latency percentiles, availability nines, RPO and RTO, SLI, SLO and error budgets, trade-offs, utility trees and ATAM, fitness functions, requirements smells, user stories, use cases, job stories and Gherkin, with Go and Laravel tests. Learning goal: take a vague sentence such as "the checkout must be fast and reliable", turn it into measured scenarios with owners and budgets, decide which quality wins when two collide, and encode each number as a test that fails the build.

This page is the complete reference for the first design question: what must the system be good at? It covers where the vocabulary comes from (McCall, Boehm, ISO 9126, ISO 25010, the SEI scenario template, ATAM, evolutionary architecture), every term practitioners use, how to write and verify measurable requirements, and how the same requirement changes meaning when the system grows from one process to many services. It does not re-teach its neighbours: the split between architecture and design is on Software Architecture vs Software Design, the step-by-step design workflow is on The Design Process, coupling and cohesion as design-level quality are on Design Quality, network latency and partial failure are on Distribution of Components, retries and circuit breakers are on Error Handling & Fault Tolerance, and threat modelling is on Security by Design.

Page map ​

If you are looking forGo to
The whole topic in a few tablesEverything in one minute
Why quality requirements exist and what they tradeWhy it exists
McCall, Boehm, ISO 9126, ISO 25010, SEI, ATAM, FordWhere it comes from
Functional vs non-functional vs constraintFR vs NFR, Constraints
Every ISO/IEC 25010:2023 characteristic and sub-characteristicThe 25010 model
Source, stimulus, artifact, environment, response, measureQuality attribute scenario
p95, p99, nines, RPO, RTO, throughput, capacityMeasurable NFRs
SLI, SLO, SLA, error budgetSLI, SLO, SLA and error budget
Performance vs maintainability, security vs usability, consistency vs availabilityTrade-off pairs
Utility tree, ATAM, risks, sensitivity pointsPrioritising
Fitness functionsFitness functions
Vague, unverifiable, solution-in-requirementRequirements smells
User story, use case, job story, acceptance criteria, GherkinStories and use cases, Acceptance criteria
NFR as a test in Go and LaravelGo, Laravel
Monolith, microservices, distributedIn architecture
A complete requirements documentWorked example
Wrong beliefs, cheat sheet, self-check, every termMisconceptions, Cheat sheet, Self-check, Glossary

Everything in one minute ​

The three kinds of "must". Every row is unpacked in the concepts section.

KindIn plain wordsTiny exampleIf you get it wrong
Functional requirement (FR)What the system does"A shopper can pay for a cart"Wrong product
Quality attribute / non-functional requirement (NFR)How well it does it"95% of payments finish in under 300 ms"Right product that is slow, fragile or insecure
ConstraintA decision already made for you"Must run on our existing PostgreSQL 16 cluster"Rework, legal trouble, rejected release

The quality vocabulary in one table.

TermIn plain wordsTiny exampleWhat goes wrong without it
Quality attributeA property such as speed, safety or changeabilityAvailabilityTeams argue about adjectives
Quality attribute scenarioOne measurable story about a quality"Node crashes at peak, traffic recovers in 30 s""Make it reliable"
Response measureThe number that judges the responsep95 under 300 msNobody can say pass or fail
SLIA measured indicatorShare of requests under 300 msOpinions instead of data
SLOTarget for an SLI over a window99.9% over 30 daysEndless reliability work or none
SLASLO with a contract and a penaltyRefund if under 99.5%Surprise bills
Error budgetAllowed unreliability: 100% minus the SLO43 minutes per 30 days at 99.9%Releases blocked by fear
RPO / RTOData you may lose / time to be backRPO 5 min, RTO 30 minBackups that nobody can restore in time
Utility treeTree from "quality" down to concrete, ranked scenariosPerformance, then Latency, then the p95 scenarioGold-plating every attribute
Fitness functionAn automatic check that an architectural property still holdsCI fails if domain imports net/httpSlow erosion nobody notices

Availability in nines (30-day month, full outage time you may spend):

TargetNinesPer 30 daysPer year
99%two7 h 12 min3 d 15 h 36 min
99.9%three43 min 12 s8 h 45 min 36 s
99.95%three and a half21 min 36 s4 h 22 min 48 s
99.99%four4 min 19 s52 min 34 s
99.999%five26 s5 min 15 s

Why it exists ​

A system is judged by two questions: does it do the right things, and does it do them well enough? The first is easy to see in a demo. The second only shows up on the worst day: the sale, the outage, the audit, the year-three change request. Quality attribute requirements make that worst day a design input instead of a surprise. They also expose the fact that qualities fight each other, so someone must choose before the code exists.

Without explicit quality requirementsWith measured quality requirements
"Fast" means whatever the loudest person feels"Fast" is p95 under 300 ms at 200 requests per second
Architecture is chosen by fashionArchitecture is chosen by the ranked scenarios it must satisfy
Conflicts surface in productionConflicts surface in a workshop, with a record of who chose what
Tests check behaviour onlyTests also check latency, structure and recovery
Cheap to write downCosts a few hours of discussion per attribute
Risk: the system passes every demo and fails the first MondayRisk: over-specifying qualities nobody needs (gold plating)
1 Sourceof stimuluswho or what2Stimulusevent3 Artifactthe part that is hit4 Environment (dashed)5 Responsewhat it does6 Responsemeasurehow we judgeEnvironment: normal load, degraded, startup, peakconditions that hold when the stimulus arrivesSource: 200 shoppers (users)Stimulus: submit POST /ordersArtifact: checkout serviceEnvironment: normal operation, 200 req/sResponse: order stored, 201 returnedMeasure: p95 under 300 ms, p99 under 800 ms

The picture is the six-part scenario you will use throughout: a source sends a stimulus to an artifact that is in some environment; the artifact responds; a response measure says whether that was good enough. Every quality requirement on this page can be drawn this way.

The analogy we reuse on this page: building a house. The floor plan lists the rooms: a kitchen, two bedrooms. That is the functional requirement. "The walls must keep the noise from the road below 35 dB", "the roof must carry snow", "the extension must be possible without moving the staircase" are quality attributes; they decide the walls, the beams and where the staircase goes, and they are expensive to change after the walls are up. "Must be built on this plot, under the city's height limit" is a constraint: nobody negotiates it with the architect.

Three common misunderstandings, up front ​

  1. "Non-functional means optional or secondary." It means "not a function". Missing latency or security makes the product unusable, however many functions it has.
  2. "Quality attributes are a checklist to tick." They are in tension. You choose a few that win, state numbers for them, and accept that others lose.
  3. "We will tune performance at the end." Performance, availability and security are mostly decided by structure: where the network is, where the data lives, who trusts whom. The end is too late to change those.

Where it comes from ​

McCall, 1977, and Boehm, 1978. The first quality trees came from US defence-funded studies: Jim McCall's factors (correctness, reliability, efficiency, integrity, usability, maintainability, flexibility, testability, portability, reusability, interoperability) and Barry Boehm's software quality characteristics tree. We did not read these originals; they are cited here from the standard secondary literature, and the ISO models below descend from them.

ISO/IEC 9126, 2001, and ISO/IEC 25010, 2011. The ISO 9126 model (functionality, reliability, usability, efficiency, maintainability, portability) was replaced by the SQuaRE series. ISO/IEC 25010:2011 split quality into product quality (eight characteristics) and quality in use. The iso25000.com portal, which mirrors the standard's text, defines the purpose of the model:

"The quality model determines which quality characteristics will be taken into account when evaluating the properties of a software product." — ISO/IEC 25000 portal, page on ISO/IEC 25010

ISO/IEC 25010:2023. The current edition has nine characteristics. Compared with 2011, usability became interaction capability, portability became flexibility (and now holds scalability), and safety is new. Within security, resistance is new; within reliability, maturity became faultlessness. The page we read (iso25000.com, which republishes the model; the standard itself is paid and the iso.org page returned HTTP 403) lists only the 2023 structure, so the 2011 comparison is from the widely documented change list, not from that page.

Bass, Clements and Kazman. Software Architecture in Practice (2nd edition, 2003) argues that attribute definitions are not operational: "It is meaningless to say that a system will be modifiable. Every system is modifiable with respect to one set of changes and not modifiable with respect to another." Its fix is the six-part scenario:

"A quality attribute scenario is a quality-attribute-specific requirement. It consists of six parts." — Bass, Clements, Kazman, Software Architecture in Practice, 2nd ed., section 4.3 (chapter text as hosted by UBC course pages)

Kazman, Klein, Clements, 2000. The SEI technical report ATAM: Method for Architecture Evaluation (CMU/SEI-2000-TR-004) adds the utility tree and the evaluation workshop:

"Utility trees provide a top-down mechanism for directly and efficiently translating the business drivers of a system into concrete quality attribute scenarios." — Kazman, Klein, Clements, CMU/SEI-2000-TR-004, section 5.3

Ford, Parsons and Kua, 2017. Building Evolutionary Architectures introduced fitness functions. Thoughtworks summarises the idea:

"Fitness functions describe how close an architecture is to achieving an architectural aim." — Thoughtworks, Fitness function-driven development

Google SRE, 2016. The SRE book gives the operational vocabulary: SLI, SLO, SLA and error budget.

The concepts, one by one ​

Each block follows the same order: plain words, the usual wrong belief, a precise definition, a timeline, real scenarios, what product or tool provides it, and the fix.

Functional vs non-functional requirements Must-know ​

In plain words: a functional requirement is a thing the system does (send an invoice); a non-functional requirement is a quality of how it does anything (the invoice arrives within a minute, only the customer can read it, we can change the template in a day).

Common misunderstanding: "Non-functional requirements are separate from features, so a separate team or phase can handle them." The same sentence often contains both. "The system sends the invoice within one minute" is a function with a quality; the quality will shape queues, retries and capacity, so it belongs in the feature's acceptance criteria, not in a later hardening phase.

Definition: Wikipedia (secondary source) defines an NFR as "a requirement that specifies criteria that can be used to judge the operation of a system, rather than specific behaviours", contrasted with functional requirements "that define specific behavior or functions". The same article notes the alternative names cross-functional requirements and, in architecture, architectural characteristics. Many authors dislike the word "non-functional" and prefer quality requirements; this page uses both.

text
     Sentence                                              Parts
1    "Users can export their orders as CSV."               FR
2    "Export of 100,000 rows finishes in 20 s (p95)."      NFR (time behaviour) attached to FR 1
3    "Only the order owner can export."                    FR or NFR (confidentiality)? both; test it as a behaviour
4    "Exports must be written to the EU bucket."           constraint (legal)

Real scenarios: an export button that works and times out for large customers; a login that works and leaks account existence through error messages; a search that works and cannot be changed without a rewrite.

Question to classify a sentenceIf yes
Can I demo it with one request and one answer?Mostly functional
Does it need a number, a load, a failure or a time period to judge?Quality attribute
Did someone outside the team already decide it?Constraint
Would the answer change if hardware, load or attackers changed?Quality attribute

Fix: write every FR with its quality in the same acceptance criteria, and move system-wide qualities (availability, retention, audit) to a short list of scenarios that every feature inherits.

The ISO/IEC 25010:2023 product quality model Must-know ​

In plain words: ISO's checklist of nine qualities a software product can have, each with named parts, so you do not forget one and so two teams mean the same thing by "reliability".

Common misunderstanding: "ISO 25010 says what to build." It is a vocabulary and a measurement frame. It tells you which qualities exist; you still decide which three matter for your product and how to measure them.

Definition: product quality is the degree to which the system satisfies stated and implied needs. The model has nine characteristics and, in the portal's listing, 40 sub-characteristics. The definitions below are paraphrased from the portal text we read; the standard itself is paid.

Product quality model (ISO/IEC 25010:2023)1. Functional suitability· functional completeness· functional correctness· functional appropriateness2. Performance efficiency· time behaviour· resource utilization· capacity3. Compatibility· co-existence· interoperability4. Interaction capability· appropriateness recognizability· learnability · operability· user error protection· user engagement · inclusivity· user assistance· self-descriptiveness5. Reliability· faultlessness· availability· fault tolerance· recoverability6. Security· confidentiality · integrity· non-repudiation· accountability · authenticity· resistance7. Maintainability· modularity · reusability· analysability· modifiability· testability8. Flexibility· adaptability· scalability· installability· replaceability9. Safety· operational constraint· risk identification· fail safe· hazard warning· safe integration
CharacteristicSub-characteristicIn plain wordsExample check
1. Functional suitabilityFunctional completenessThe functions cover all the tasks and goals users haveEvery user story in the release exists
1. Functional suitabilityFunctional correctnessResults are accurateTax computed to the cent
1. Functional suitabilityFunctional appropriatenessFunctions help to do the task without detoursCheckout in 3 steps, not 9
2. Performance efficiencyTime behaviourResponse time and throughput meet requirementsp95 under 300 ms
2. Performance efficiencyResource utilizationCPU, memory, storage, network, energy used stay within needUnder 2 GB RSS per pod
2. Performance efficiencyCapacityMaximum limits (users, records, volume) meet requirements5 million orders per table
3. CompatibilityCo-existenceWorks next to other products sharing the environment without harming themDoes not starve the co-located cron job
3. CompatibilityInteroperabilityCan exchange information with other systems and use itReads the partner's OpenAPI feed
4. Interaction capabilityAppropriateness recognizabilityUsers can tell whether it fits their needLanding page states the purpose
4. Interaction capabilityLearnabilityLearnt within a stated timeNew agent productive in 2 hours
4. Interaction capabilityOperabilityEasy to operate and controlKeyboard shortcuts for frequent actions
4. Interaction capabilityUser error protectionPrevents users from making operation errorsConfirmation before deleting a project
4. Interaction capabilityUser engagementThe interface is inviting and encourages continued useClear progress feedback
4. Interaction capabilityInclusivityUsable by people of various backgrounds, abilities, languagesRight-to-left layout, screen reader labels
4. Interaction capabilityUser assistanceUsable by the widest range of capabilities to reach goalsLarge-text mode, captions
4. Interaction capabilitySelf-descriptivenessShows the right information so use is obvious without manualsField help beside the input
5. ReliabilityFaultlessnessPerforms without fault under normal operationZero defects in the nightly run
5. ReliabilityAvailabilityOperational and accessible when needed99.9% monthly
5. ReliabilityFault toleranceKeeps working despite hardware or software faultsOne of three nodes can die
5. ReliabilityRecoverabilityAfter a failure, recovers directly affected data and returns to the desired stateRPO 5 min, RTO 30 min
6. SecurityConfidentialityData accessible only to those authorisedNo card number in logs
6. SecurityIntegrityState and data protected from unauthorised change or deletionSigned webhooks, row-level audit
6. SecurityNon-repudiationActions can be proven to have happenedSigned approval records
6. SecurityAccountabilityActions traced uniquely to an entityPer-user audit log
6. SecurityAuthenticityIdentity of a subject or resource can be provenMFA, mTLS
6. SecurityResistanceKeeps operating while under attackRate limiting under a login flood
7. MaintainabilityModularityParts are discrete, so one change hits few othersA change in billing touches only billing
7. MaintainabilityReusabilityAn asset can be used in more than one systemShared auth library
7. MaintainabilityAnalysabilityImpact of a change and causes of failure can be assessedTraces link a request across services
7. MaintainabilityModifiabilityCan be changed without introducing defects or lowering qualityNew tax rule in one day
7. MaintainabilityTestabilityTest criteria can be set and checked90% of rules covered by fast unit tests
8. FlexibilityAdaptabilityCan be adapted to or moved to other hardware, software or environmentsRuns on ARM and x86
8. FlexibilityScalabilityHandles growing or shrinking workloads or adapts capacityDouble traffic with double nodes
8. FlexibilityInstallabilityCan be installed and uninstalled in a specified environmentOne Helm chart
8. FlexibilityReplaceabilityCan replace another product for the same purpose in the same environmentDrop-in for the old queue
9. SafetyOperational constraintKeeps operation within safe parameters when a hazard appearsInsulin pump caps dose
9. SafetyRisk identificationIdentifies event sequences that could endanger life, property or the environmentDetects sensor drift
9. SafetyFail safeSwitches itself to a safe mode on failureBrakes lock on control loss
9. SafetyHazard warningWarns of unacceptable risks in time to reactAlarm before overheating
9. SafetySafe integrationMaintains safety during and after integration with other componentsPlugin cannot disable the interlock

The diagram puts a few sub-characteristics on one line only to save space; in the table each is a row of its own. The count is 3 + 3 + 2 + 8 + 4 + 6 + 5 + 4 + 5 = 40.

Real scenarios: a payment API mostly needs reliability, security, performance efficiency; a design tool mostly interaction capability and compatibility; a medical device safety first; an internal reporting job maintainability and recoverability.

Product typeTop three characteristicsUsually low priority
Payments APISecurity, reliability, performance efficiencyInteraction capability beyond the dashboard
Mobile consumer appInteraction capability, performance efficiency, flexibilityNon-repudiation
Data pipelineReliability (recoverability), maintainability, capacityInclusivity
Embedded medicalSafety, reliability, securityScalability
Internal CRUD toolMaintainability, functional suitability, installabilityResistance

Fix: copy the table into a spreadsheet, mark each row "matters / does not matter / unknown" with the product owner, and write scenarios only for the "matters" rows.

Quality attribute scenario Must-know ​

In plain words: one sentence-sized story, "when this happens to that part of the system under these conditions, the system does this, and we judge it by that number".

Common misunderstanding: "A scenario is a user story for qualities." Not quite: a user story names a person and a benefit; a scenario names any source (a user, an attacker, a crashing node, a developer) and ends in a measurable response.

Definition: Bass, Clements and Kazman give six parts, and we quote their definitions (2nd ed., section 4.3):

PartTheir wordingTypical values
Source of stimulus"some entity (a human, a computer system, or any other actuator) that generated the stimulus"Shopper, attacker, scheduler, failing disk, developer
Stimulus"a condition that needs to be considered when it arrives at a system"Request, crash, attack, change request
Environment"The system may be in an overload condition or may be running when the stimulus occurs"Normal, peak, degraded, startup, maintenance
Artifact"Some artifact is stimulated. This may be the whole system or some pieces of it"Service, database, queue, UI, build
Response"the activity undertaken after the arrival of the stimulus"Serve, fail over, reject, log, deploy
Response measure"it should be measurable in some fashion so that the requirement can be tested"Latency percentile, recovery time, effort in person-days

The authors also separate general scenarios (system independent) from concrete scenarios (this system). Use general ones as prompts in a workshop, concrete ones in the requirements document.

text
     Time     Event                                           Part
1    10:00    200 shoppers submit POST /orders                source + stimulus
2    10:00    system at normal load, one replica degraded     environment
3    10:00    checkout service stores the order, returns 201  artifact + response
4    10:05    p95 = 270 ms, p99 = 640 ms                      response measure: pass (limits 300/800)

Real scenarios: six concrete scenarios across attributes:

AttributeSourceStimulusArtifactEnvironmentResponseMeasure
Performance (time behaviour)200 shoppersPOST /ordersCheckout serviceNormal loadOrder stored, 201 returnedp95 under 300 ms, p99 under 800 ms
Availability (fault tolerance)HardwareOne of three app nodes diesApp tierPeak loadLoad balancer drains node, others serveNo more than 0.1% failed requests, recovery in 30 s
RecoverabilityOperator errorDROP TABLE ordersPrimary databaseBusiness hoursRestore with point-in-time recoveryRPO 5 min, RTO 30 min
Security (integrity)AttackerTampers with price in the request bodyCheckout APINormalServer recomputes price, rejects mismatch100% of tampered requests rejected, audit entry written
ModifiabilityProduct managerAdd a new payment providerPayment moduleDevelopmentNew adapter added, no change to checkout coreUnder 3 person-days, 0 changes outside payment/
TestabilityDeveloperRuns unit tests on a laptopPricing rulesDevelopmentTests run without databaseSuite under 20 s

What provides it: the scenario itself is a document. The checking is done by tools: load tests (k6, Gatling, vegeta, Locust), chaos tools (Chaos Mesh, Litmus, AWS Fault Injection Service), static analysis (go-arch-lint, Deptrac, Pest arch tests), restore drills.

Fix: write the scenario first, then the test that can fail. See the Go and Laravel sections.

Measurable NFRs Must-know ​

In plain words: a quality counts as a requirement only when you can say which measurement would prove you wrong.

Common misunderstanding: "Average response time is a good performance requirement." Averages hide the slow tail. The Google SRE book states it directly: "We generally prefer to work with percentiles rather than the mean (arithmetic average) of a set of values." Its example: a typical request is served in about 50 ms while 5% of requests are 20 times slower, and an alert on the average would never fire.

Definition: the families of measures you will meet:

FamilyMeasureNotes
Latencyp50, p95, p99, p99.9 of response timeState the percentile, the window and where it is measured (client or server)
ThroughputRequests, messages, transactions per secondPair with a latency limit; throughput alone can be met by queueing forever
AvailabilityShare of successful requests, or uptime share"Nines"; define what counts as a failure
Error rateFailed requests divided by all requestsHTTP 5xx, timeouts; decide whether 4xx counts
DurabilityProbability data survivesRPO is the practical form
RecoveryRTO, MTTR, MTBFRTO: time to be back; RPO: how much recent data you may lose
CapacityMaximum users, rows, bytes before degradationTest the cliff, not only the average
EfficiencyCPU, memory, I/O, cost per requestTies NFRs to the cloud bill
MaintainabilityLead time for change, change failure rate, time to onboardDORA-style delivery metrics are indirect proxies
SecurityTime to patch criticals, share of endpoints with authz tests, MFA coveragePair with penetration-test findings
TermDefinitionExample
p9595% of requests are at or below this latencyp95 = 300 ms: 1 in 20 may be slower
p9999% at or belowOften 3 to 10 times p50
RPO (Recovery Point Objective)Maximum tolerable data loss, measured in time5 minutes of orders
RTO (Recovery Time Objective)Maximum tolerable time to be back in service30 minutes
MTTRMean time to recover (or repair)20 minutes this quarter
MTBFMean time between failures90 days
ThroughputWork completed per unit of time800 orders per second
ConcurrencyWork in flight at once400 open requests
UtilisationShare of a resource in useCPU 65%

Two formulas make the numbers honest. Little's law: in a stable system, the average number of requests in flight equals the arrival rate times the average time each spends in the system (L = λ × W). With 800 requests per second and 250 ms each, about 200 are in flight, so a pool of 100 connections cannot hold. Tail amplification: if one call is slow 1% of the time and a page makes 100 independent calls, the chance that at least one is slow is 1 minus 0.99 to the 100th power, about 63%. That is why p99 of a dependency becomes p50 of the page.

Availability maths:

LayoutFormulaExample
Serial (all must work)a₁ × a₂ × … × aₙThree services at 99.9% each: 99.7% (about 2 h 10 min per month)
Parallel (any one works)1 − (1 − a)ⁿTwo independent replicas at 99.9%: 99.9999%
Serial with parallel partsCombineLoad balancer 99.99% × (two app nodes in parallel) × database 99.95%

Parallel only holds if failures are independent. Two replicas in the same rack, on the same deploy, share fate.

text
     Dependency chain per request                   Availability
1    gateway            99.99%
2    checkout service   99.9%
3    payments service   99.9%
4    inventory service  99.9%
5    ---------------------------------------------
6    product            0.9999 x 0.999^3 = 99.79%   -> about 1.5 h of failures per 30 days

PostgreSQL percentile in SQL (works on a request log table; percentile_cont is an ordered-set aggregate in PostgreSQL):

sql
-- p50, p95, p99 latency per route over the last hour
SELECT route,
       percentile_cont(0.50) WITHIN GROUP (ORDER BY duration_ms) AS p50,
       percentile_cont(0.95) WITHIN GROUP (ORDER BY duration_ms) AS p95,
       percentile_cont(0.99) WITHIN GROUP (ORDER BY duration_ms) AS p99,
       count(*) AS requests
FROM   request_log
WHERE  logged_at > now() - interval '1 hour'
GROUP  BY route
ORDER  BY p99 DESC;

-- availability SLI: share of non-5xx requests over 30 days
SELECT 1.0 - (count(*) FILTER (WHERE status >= 500))::numeric / count(*) AS availability
FROM   request_log
WHERE  logged_at > now() - interval '30 days';

What provides it: Prometheus histograms (histogram_quantile), OpenTelemetry metrics, Datadog, Grafana, Laravel Pulse and Horizon for queue wait time. Percentiles cannot be averaged across hosts; aggregate buckets, not percentiles.

Fix: for each NFR write metric, percentile or ratio, window, load, where measured. A line missing one of those five is still a wish.

SLI, SLO, SLA and error budget Must-know ​

In plain words: the SLI is the thermometer, the SLO is the temperature you promise, the SLA is the contract with a refund, and the error budget is how much you are allowed to miss before you must stop shipping new things.

Common misunderstanding: "The SLO is 100% because every failure matters." 100% is not achievable, and it freezes delivery. The SRE book says in its risk chapter "100% is probably never the right reliability target: not only is it impossible to achieve, it's typically more reliability than a service's users want or notice", and states that "the error budget provides a clear, objective metric that determines how unreliable the service is allowed to be within a single quarter."

Definition: the SRE book chapter defines an SLO as "a target value or range of values for a service level that is measured by an SLI", and prefers explicit statements such as "99% (averaged over 1 minute) of Get RPC calls will complete in less than 100 ms (measured across all the backend servers)." The SLA is the contract around SLOs with consequences; the same chapter notes SREs do not usually construct SLAs because they are "closely tied to business and product decisions".

text
     Quarter day   Event                                      Budget (SLO 99.9%, 1,000,000 requests/day expected)
1    day 1         Budget for 90 days = 0.1% of 90M = 90,000 failed requests
2    day 12        Bad deploy fails 40,000 requests            remaining 50,000 (55%)
3    day 13        Policy: pause risky releases above 50% burn  -> only fixes ship
4    day 40        Another incident spends 55,000              remaining -5,000: SLO missed
5    day 41        Freeze features until budget recovers or SLO is renegotiated

Real scenarios: a product team wants to ship twice a day; SRE says reliability is at 99.95% against a 99.9% target, so budget exists and the release goes ahead. A different quarter the budget is gone and the team spends the sprint on reliability.

ItemWho owns itWhere it lives
SLI definitionEngineering and productMonitoring config in git
SLO valueProduct management with engineeringService README, dashboards
SLABusiness, legalContract
Error budget policyEngineering leadershipTeam handbook, release tooling

What provides it: Prometheus + Alertmanager multi-window burn-rate alerts, Sloth or Pyrra to generate SLO rules, Google Cloud Monitoring SLO service, Datadog SLOs, OpenSLO as a spec. Error budgets are a deep topic of their own; the SRE book chapters Service Level Objectives, Embracing Risk and the workbook's Implementing SLOs are the primary sources.

Fix: pick one availability SLI and one latency SLI per user journey, choose targets from what users tolerate and what you can afford, publish the budget, and write down what happens when it runs out. The Go function BudgetRemaining is in the snippets.

Trade-off pairs Must-know ​

In plain words: you cannot max out every quality at once. Making one better usually makes another worse, and the architect's job is to choose on purpose and write down why.

Common misunderstanding: "A good architecture satisfies all qualities." The ATAM report defines this precisely: "A tradeoff point is a property that affects more than one attribute and is a sensitivity point for more than one attribute", with the example that changing the level of encryption affects both security and performance. Good architecture picks which quality is sacrificed, knowingly.

Definition: a trade-off pair is two attributes where a decision that helps one tends to hurt the other.

PairWhy they collideDecision that moves itWhere to pick the side
Performance vs maintainabilityHand-tuned hot paths, caches, denormalised data and inlined code are fast and hard to changeCaching layer, denormalising, custom serialisationOptimise only the scenarios in the utility tree; keep a benchmark proving the need
Security vs usabilityEach extra check (MFA, short sessions, strong passwords) adds frictionMFA policy, session lifetime, step-up authenticationRisk-based: strong for money movement, light for browsing
Consistency vs availability (during partitions)If replicas cannot talk, you either refuse writes or accept divergenceQuorum settings, single-leader vs multi-leaderSee Eventual Consistency in Databases and Replication & Failover
Consistency vs latencyWaiting for more replicas costs round tripssynchronous_commit, read quorum, read-your-writes routingPer operation, not per system
Availability vs costEach extra nine needs redundancyMulti-AZ, multi-regionSLO derived from business loss per hour
Flexibility vs performanceGeneric layers add indirectionPlugin systems, ORMs, interpretersGeneric at the edge, specific in the hot path
Security vs performanceEncryption, hashing, validation cost CPU and timeTLS termination, hashing cost (bcrypt rounds, Argon2 memory)Tune to the attack model
Modifiability vs time to marketClean seams take longer nowModular monolith vs a single file of scriptsInvest where change is expected
Scalability vs simplicityDistribution adds failure modesMicroservices vs a monolithDelay distribution until a scenario demands it
Testability vs encapsulationTests want hooks that production code should not exposeInterfaces, dependency injectionTest through public behaviour first
text
     Step  Who                 Statement                                                          Quality moved
1    1     Product             "Orders must never be lost"                                        durability up
2    2     Architect           Write to the database and the queue in one transaction (outbox)    consistency up
3    3     Operations          Outbox relay adds up to 200 ms delay                               time behaviour down
4    4     Workshop            Accept 200 ms; record decision ADR-014 with the scenario           trade-off recorded
5    5     CI                  Fitness test: p95 of "order accepted" under 300 ms                 guard added

Real scenarios: a bank forcing MFA on login (security up, conversion down) but not on balance view; a product page cached for 60 seconds (performance up, price correctness down); a social feed using eventual consistency (availability up, read-after-write down).

What provides it: Architecture Decision Records (Michael Nygard's format) record the choice; ATAM or a lightweight scenario review finds it early; the fitness functions below keep the winner winning.

Fix: for every pair that appears in your top scenarios, write one ADR: "We choose X over Y for scenario S; we accept losing Z; we revisit when W."

Prioritising: utility tree and ATAM Important ​

In plain words: a utility tree turns the vague root "utility" into branches (performance, availability, security, modifiability), then concrete scenarios, and marks each with two letters: how important it is to the business and how hard it is for the architecture. The scenarios that are important and hard get the design attention.

Common misunderstanding: "ATAM is a heavy, multi-week ceremony." The report describes a full evaluation with many stakeholders, but the core ideas (a utility tree, scenario ranking, naming risks and trade-off points) work in a two-hour whiteboard session for a single service.

Definition: in the ATAM report's sample tree each leaf carries a pair such as (H,M); the report's figure shows leaves like "Minimize storage latency on customer DB to 200 ms", "Power outage at Site 1 requires traffic re-direct to Site 2 in under 3 secs" and "Add CORBA middleware in under 20 person-months". Two mechanisms elicit scenarios: utility trees (top-down, a few architects) and facilitated brainstorming (bottom-up, all stakeholders).

UtilityPerformanceAvailabilityModifiabilitySecurityLatencyp95 of POST /orders under 300 ms at 200 req/simportance, difficulty: (H,M)ThroughputBlack Friday: 10x orders per hour, no queue over 10 simportance, difficulty: (H,H)Node failureLose 1 of 3 app nodes: no failed requests, recovery under 30 simportance, difficulty: (H,M)Data lossPrimary database lost: RPO 0 s, RTO under 15 minimportance, difficulty: (H,H)New featureAdd a payment provider in under 3 person-daysimportance, difficulty: (M,M)PlatformUpgrade the framework major version in under 2 weeksimportance, difficulty: (L,M)ConfidentialityCard data never stored; no PAN in logs (scan finds 0)importance, difficulty: (H,L)IntegrityTampered price in request is rejected 100% of the timeimportance, difficulty: (M,L)ATAM reads the tree top-down and starts with the (H,H) and (H,M) leaves

The ATAM has nine steps in three phases. We read them from the report:

PhaseStepWhat happens
Presentation1Present the ATAM to stakeholders
Presentation2Present business drivers
Presentation3Present the architecture
Investigation and analysis4Identify architectural approaches
Investigation and analysis5Generate the quality attribute utility tree
Investigation and analysis6Analyse architectural approaches for the high-priority scenarios
Testing7Brainstorm and prioritise scenarios with the whole stakeholder group (voting)
Testing8Analyse architectural approaches again against the highly ranked scenarios
Reporting9Present results

The method's outputs have a precise vocabulary:

OutputMeaning (SEI report)Example
RiskAn architecturally important decision that has not been made, or one that is problematic"Undecided whether the cache is shared across tenants"
Non-riskA decision judged sound for the scenario"Retries use exponential backoff with jitter"
Sensitivity point"a property of one or more components ... that is critical for achieving a particular quality attribute response"Number of encryption bits for confidentiality
Trade-off pointA property that is a sensitivity point for more than one attributeEncryption level: security up, latency down
text
     Step  Activity                                                       Output
1    1     Business drivers: "fast checkout, never lose an order"        Two top qualities
2    2     Utility tree: 8 leaf scenarios, rate (importance, difficulty) 2 leaves are (H,H)
3    3     Walk the (H,H) leaf: "DB loss, RPO 0, RTO 15 min"             Risk: no cross-region replica yet
4    4     Walk (H,M) leaf: "p95 300 ms at 200 rps"                      Sensitivity point: connection pool size
5    5     Record trade-off: sync replication vs write latency           Trade-off point -> ADR

Real scenarios: a start-up picks Postgres plus a queue for a seed-stage product after ranking scenarios; a platform team evaluates whether to split a monolith by checking that the split improves the (H,H) scenarios and does not worsen availability.

Fix: keep the tree on one page, rate with H, M, L on importance and difficulty, and review it each quarter. Scenarios rated (L,L) are not worth a design discussion.

Fitness functions Important ​

In plain words: a fitness function is an automated test for an architectural quality. It fails the build when the system drifts away from what the design needs.

Common misunderstanding: "Fitness functions are a framework you must install." They are an idea. Any test, benchmark, linter rule, alert or chaos experiment that returns pass or fail on a quality attribute is a fitness function.

Definition: Ford, Parsons and Kua define an evolutionary architecture as one that "supports guided, incremental change as the first principle across multiple dimensions" (Thoughtworks' quotation), and the fitness function is the guide. Thoughtworks adds that they "describe how close an architecture is to achieving an architectural aim" and that they apply to monoliths and microservices alike. The book also classifies them (we summarise it from secondary descriptions; check the book before relying on the exact terms):

AxisChoicesExample
ScopeAtomic (one attribute) vs holistic (several together)Import check vs load test with security headers
TriggerTriggered (CI, release) vs continual (always running in production)Unit test vs production SLO alert
ResultStatic (fixed pass or fail) vs dynamic (depends on context)Maximum cyclomatic complexity vs latency budget that scales with load
TimingAutomated vs manualPipeline vs quarterly security review
text
     Commit  Fitness function                                    Result
1    c101    domain imports no infrastructure package             pass
2    c102    p95 /quote under 50 ms (benchmark in CI)             pass
3    c103    dev adds database/sql import in domain/order.go      FAIL: "domain must not depend on infrastructure"
4    c104    developer moves the query to the repository         pass
5    c105    new dependency raises binary to 120 MB (limit 100)   FAIL: size budget

Real scenarios: "no cycles between modules" (modularity); "no endpoint without an authorisation test" (security); "p95 of checkout under 300 ms in the nightly load test" (performance); "cold start under 500 ms" (flexibility); "any service that exposes metrics follows the naming guide" (operability); "dependency licences are allowed" (compliance).

QualityFitness functionGoLaravel
ModularityLayers only point inwardgo-arch-lint, go/parser import testDeptrac, Pest arch()
Time behaviourLatency budgettesting plus percentile helperPest test with Benchmark::value
MaintainabilityCyclomatic complexity capgocyclo, golangci-lintPHPStan, PHP_CodeSniffer complexity rules
SecurityKnown vulnerabilities fail CIgovulncheckcomposer audit
TestabilityCoverage floor on domaingo test -coverPHPUnit coverage
ResilienceKill a pod in staging, SLO holdsChaos Mesh jobSame, any language

What provides it: go test, govulncheck, golangci-lint, go-arch-lint, Pest, PHPStan, Larastan, Deptrac, k6, GitHub Actions, GitLab CI. See code below.

Fix: convert each top scenario's response measure into a test or an alert, put the test in CI, and treat a red fitness function like a red unit test.

Requirements smells: vague, unverifiable, solution-in-requirement Important ​

In plain words: some words in a requirement are warning signs that nobody can test it ("fast", "user-friendly", "as far as possible", "use Redis").

Common misunderstanding: "A vague requirement is fine because we will clarify it later." Femmer et al. (arXiv 1611.08847) note that bad requirements quality "can cause expensive consequences during the software development lifecycle, especially if iterations are long and feedback comes late." Clarifying in development costs more than clarifying in the sentence.

Definition: a requirements smell is a word or phrase that hints at a quality defect, in the same spirit as code smells; the paper derives them from the ISO 29148 language criteria. The first five rows follow the paper's smell list; the last four are common additions that are not from the paper:

SmellDefinition (paper)BadBetter
Subjective languageWords whose semantics are "not objectively defined, such as user friendly, easy to use, cost effective""The checkout must be user-friendly""A new shopper completes checkout in under 90 s without help (usability test, 5 of 5 users)"
Ambiguous adverbs and adjectivesUnspecific by nature, such as "almost always, significant and minimal""Pages must load quickly""Product page p95 under 800 ms on 4G"
LoopholePhrases that make a requirement hold "only to a certain, imprecisely defined extent": "As far as possible""Inputs are validated as far as possible""All fields are validated against the schema; unknown fields are rejected"
Open-ended, non-verifiable termsPhrases like "etc.", "and so on", "including but not limited to""Supports CSV, XLSX, etc.""Supports CSV and XLSX; other formats are out of scope for v1"
Superlative and comparative"best", "faster" with no baseline"Faster than the old system""p95 at most 70% of the current 420 ms"
Solution in requirementNames a technology instead of the need"Use Redis for sessions""Session reads under 5 ms p99; sessions survive a node restart" (the choice of Redis is a design decision)
Missing measureA quality with no number"Highly available""99.9% monthly availability, measured as non-5xx at the load balancer"
Untestable negative"Never fails""The system never loses data""RPO 5 min; restore drill passes quarterly"
Compound requirementSeveral "and" statements in one"Secure, fast and scalable"Three separate scenarios
Passive voice with no actorWho does it?"The data is encrypted""The service encrypts data at rest with AES-256-GCM using keys managed in KMS"
text
     Review  Sentence                                                 Smell found                      Rewrite
1    r1      "The API must be fast and easy to integrate."            ambiguous adjective + subjective  "p95 under 200 ms; OpenAPI 3.1 spec and a sandbox"
2    r2      "Store sessions in Redis."                               solution in requirement           "Sessions survive a rolling deploy; read p99 under 5 ms"
3    r3      "Validate input where appropriate."                      loophole                          "Reject any request that does not match the schema"
4    r4      "Support payments, refunds, etc."                        open-ended                        "v1: payments and full refunds"

What provides it: peer review with a smell list; the Go function in snippets as a pre-commit check; research prototypes such as Smella from the cited paper. Tools only point; a human rewrites.

Fix: for every smell ask three questions: who is the actor, what number would prove it, and is this a need or already a solution?

User stories, use cases and job stories Important ​

In plain words: three ways to write what users want. A user story is a one-line promise to discuss; a use case is a step-by-step interaction with alternatives; a job story describes a situation and a motivation instead of a persona.

Common misunderstanding: "A user story is the requirement." Cohn: "That sentence is a reminder to have a conversation; the full requirement emerges through the conversation that follows." The story is a token for the requirement; the acceptance criteria and the scenarios are the requirement.

Definition:

AspectUser storyUse caseJob story
Template"As a [type of user], I [need/want/am required] to [do something], so that [reason or benefit]." (Mike Cohn)Goal, actors, preconditions, main success scenario, extensions, postconditions (Cockburn; we describe it from general knowledge, the source page was not available)"When [situation], I want to [motivation], so I can [expected outcome]." (Alan Klement; summarised by Cohn and Intercom)
FocusWho and whyThe interaction between actor and systemThe situation and the job
SizeSmall, fits a sprintLarger, documents flows and alternativesSmall, like a story
StrengthPlanning, conversationCompleteness, error flowsAvoids invented personas
WeaknessShallow alone; stories hide NFRsHeavy; can be shelf-wareLess known to stakeholders
NFR homeAcceptance criteriaSpecial requirements sectionOutcome clause
Best withAgile backlogRegulated or integration-heavy workProduct discovery

Cohn on job stories: the situation "follows the word when in the template and provides context on when the story is being performed or perhaps what triggered the story" with examples such as "When an order is submitted…". Intercom's argument is that user stories have "three big problems": they use personas, couple implementation with motivations and outcomes, and "ignore context, situations, and anxieties".

text
     Format        Same requirement
1    User story    As a shopper, I want to pay by card so that my order is confirmed.
2    Job story     When I am on a slow mobile connection at the checkout, I want my payment to be confirmed without a second click, so I can leave without worrying it was charged twice.
3    Use case      UC-3 Pay for cart. Actor: shopper. Main: 1 select card; 2 submit; 3 system charges; 4 system shows confirmation. Ext 3a: card declined, return to step 1.

Real scenarios: an internal agile team uses stories; a bank integrating with a payment network uses use cases with exception flows; a discovery team uses job stories to find opportunities.

What provides it: Jira, Linear, Azure DevOps hold stories; Cockburn's template or PlantUML use-case diagrams hold use cases; INVEST (independent, negotiable, valuable, estimable, small, testable; Bill Wake, 2003, from general knowledge) is a story-quality checklist.

Fix: write NFRs as acceptance criteria on stories only when they are specific to that story; write system-wide NFRs once as scenarios and link them from the stories.

Acceptance criteria and Gherkin Important ​

In plain words: acceptance criteria are the checks that say "this story is done". Gherkin is a plain-text format (Given, When, Then) that people can read and a test runner can execute.

Common misunderstanding: "Gherkin is for testers." The Cucumber reference says Gherkin uses keywords "to give structure and meaning to executable specifications"; its purpose is shared understanding between product, developers and testers, and only secondarily test automation.

Definition: a feature file has Feature, optional Background, one or more Scenario or Scenario Outline with Examples, and Rule blocks (added in later Gherkin versions) to group scenarios by business rule. The Cucumber reference says the free text under Feature is a place for "a brief explanation and a list of business rules (general acceptance criteria)".

KeywordRole
FeatureNames the capability
RuleGroups scenarios for one business rule
BackgroundSteps repeated before every scenario
ScenarioOne concrete example
Scenario Outline + ExamplesOne scenario with a data table
GivenContext, the state before
WhenThe action or event
ThenThe observable outcome
And, ButContinue the previous keyword
gherkin
Feature: Place an order
  As a shopper
  I want to pay for my cart
  So that the goods are reserved and shipped

  Background:
    Given a shopper with a cart of 2 items totalling 120.00 EUR

  Rule: Stock is reserved exactly once

    Scenario: Successful payment reserves stock
      Given every item is in stock
      When the shopper pays with a valid card
      Then an order is created with status "paid"
      And stock is reduced by 2 units

    Scenario: A retried request does not double-charge
      Given the shopper already paid with idempotency key "k-123"
      When the same request with key "k-123" is sent again
      Then the response is the original order
      And the card is charged exactly once

  Rule: Quality attribute scenarios are also scenarios

    Scenario Outline: Latency budget at normal load
      Given 200 concurrent shoppers at normal load
      When they submit POST /orders
      Then the <percentile> latency is below <limit> ms

      Examples:
        | percentile | limit |
        | 95th       | 300   |
        | 99th       | 800   |

Quality scenarios fit the same format (see the last Scenario Outline): the response measure becomes the Then and the load becomes the Given. Implementations: Cucumber (Ruby, JVM, JS), godog for Go, Behat for PHP, Pest and PHPUnit for Laravel without Gherkin when the team does not need non-programmers to read the files.

What provides it: godog (the official Cucumber implementation for Go), Behat with the Laravel extension, Cucumber.js with Playwright.

Fix: write the Gherkin before the code, keep scenarios at the level of business language (no CSS selectors), and put quality numbers in Examples tables so they can change without rewriting steps.

Constraints vs requirements Important ​

In plain words: a requirement is something you must achieve and may design freely to meet; a constraint is a fixed boundary on how you may design. Requirements are negotiable in priority; constraints are not, unless someone with authority changes them.

Common misunderstanding: "Constraints are bad requirements and should be removed." Constraints are legitimate and common; the smell is a requirement written as a constraint ("use microservices") without a reason.

Definition:

AspectRequirementConstraint
Who decidesStakeholders, negotiableOutside the team: law, contract, budget, existing platform
Tells youWhat outcome and how wellWhat you must not or must use
Design freedomMany ways to satisfyReduces the options
Changes viaBacklog and trade-offsEscalation or renegotiation
Example"Recover from regional outage in 30 min""Data of EU customers stays in the EU"
TestScenarioCompliance check, architecture test
TypeExamples
BusinessFixed launch date, budget cap, team of four
TechnicalMust run on PostgreSQL 16, Go 1.24 only, PHP 8.4 and Laravel 13
OrganisationalSingle on-call rota, no new language without approval
Legal and regulatoryGDPR residency, PCI DSS card-data scope, retention of invoices for 7 years
InterfaceMust call the bank's SOAP API

Real scenarios: a payment system must stay out of PCI scope, so card numbers never touch it (a constraint that becomes a design rule); a start-up is told "no on-call", which caps availability goals.

Fix: keep constraints in their own list with an owner and a reason, so you can say "this is a constraint because of the contract with X, expires in 2027".

Architecturally significant requirements Good to know ​

In plain words: among all requirements, a few change the architecture if you get them wrong. Those are architecturally significant requirements (ASRs). Find them first.

Common misunderstanding: "All NFRs are ASRs." Most are cheap to meet in any structure. An ASR is one with a high cost of change that has real business value and risk (the (H,H) leaves of the utility tree).

Definition: a requirement is architecturally significant when it is expensive to change later and it forces a structural decision: data placement, process boundaries, consistency model, trust boundary.

CandidateASR?Why
"Page loads in under 2 s" at 100 usersRarelyStraightforward in any stack
"Works offline for 24 hours and syncs later"YesNeeds a local store and conflict resolution
"Each tenant's data is isolated cryptographically"YesChanges keys, schema and operations
"Change tax rules without a deploy"YesRules become data, with an engine
"Colour of the button"NoLocal change

Fix: list at most five ASRs, rank them, and review any design against them first.

"Non-functional" is a poor name Good to know ​

In plain words: the word suggests "not about functions", but many qualities are exactly about functions (a function that is too slow is broken). Other names: quality attributes, quality requirements, cross-functional requirements, system qualities, architectural characteristics, the "-ilities".

Common misunderstanding: "Pick the right name and the argument is over." The names matter less than writing measurable scenarios.

Definition: this chapter uses quality attribute for the property (availability), quality attribute requirement or NFR for a stated target, and scenario for the testable form.

NameUsed by
Non-functional requirement (NFR)Requirements engineering, product teams
Quality attributeSEI, architecture literature
Architectural characteristicWikipedia and many architecture books for the same idea
Cross-functional requirementSome agile teams
"-ility"Casual: scalability, availability, maintainability

Fix: pick one name per organisation, put it in the glossary, move on.

Mechanics: from a sentence to a test ​

The pipeline Must-know ​

In plain words: talk to people, write scenarios, choose the few that matter, pick design moves (tactics) that satisfy them, then write the checks that keep them true.

text
     Stage            Input                      Output                           Artifact
1    Elicit           Stakeholder interviews     Raw wishes and constraints       Notes
2    Classify         Wishes                     FR / NFR / constraint            Requirements list
3    Scenario         NFRs                       Six-part scenarios               Scenario catalogue
4    Prioritise       Scenarios                  Ranked (importance, difficulty)  Utility tree
5    Decide           Top scenarios              Tactics and trade-offs           ADRs
6    Verify           Response measures          Tests, alerts, fitness functions CI and monitoring
7    Operate          SLIs                       SLO, error budget                Dashboard, policy

Tactics: design moves that buy a quality Important ​

In plain words: a tactic is a known design move that pushes one quality in a chosen direction. Bass et al. catalogue them per attribute; the names below are the standard ones, from the architecture literature (we did not read the catalogue chapters in this session, so verify names in the book before quoting).

Common misunderstanding: "A tactic is a pattern." A pattern is a bundle of many tactics with trade-offs; a tactic is one small move.

AttributeTacticWhat it doesCost
AvailabilityHeartbeat, redundancy, failoverDetect and replace failed nodesMoney, complexity
AvailabilityRetry with backoff and jitter, circuit breakerSurvive transient faultsDuplicate work, risk of retry storms
PerformanceCache, queue, parallelism, bounded queueReduce latency or protect capacityStaleness, complexity
PerformanceReduce chattiness, batchFewer round tripsCoupling
ModifiabilityInformation hiding, interfaces, dependency inversionLocalise changeIndirection
SecurityAuthenticate, authorise, encrypt, audit, limit exposureConfidentiality and integrityFriction, CPU
TestabilityDependency injection, record and replayIsolate the unitMore types
ScalabilityStateless services, sharding, async processingAdd capacity by adding nodesConsistency issues
RecoverabilityBackups, PITR, replicas, runbooksMeet RPO and RTOStorage, drills

Many of these have their own chapters: Error Handling & Fault Tolerance, Concurrency Design, Security by Design, the Dependency Inversion Principle, and in the database section Backup, PITR & Disaster Recovery.

Measuring honestly Important ​

In plain words: a latency number is only as good as how you measured it.

Common misunderstanding: "A load test on my laptop proves the SLO." It proves the code on your laptop at that load; it ignores network, noisy neighbours and production data volume.

PitfallEffectDefence
Averaging percentiles across hostsMeaningless numberAggregate histogram buckets
Coordinated omission (the load generator waits for slow replies and so sends fewer requests during stalls; named by Gil Tene, from general knowledge)Understates tail latencyOpen-model load (fixed arrival rate): k6 constant-arrival-rate, vegeta, wrk2
Warm caches onlyHides cold-start costMeasure cold and warm separately
Tiny data setPlans differ at scaleProduction-sized data
Client vs server timingDifferent numbersState where measured; the SRE book notes client-side latency is often more user-relevant
Single runNoiseRepeat, report variance
Shared CI runnersFlaky testsUse generous but finite budgets, retry once, trend over time

Go ​

A single module holds all Go snippets; run cd docs/snippets/design/quality-attributes-requirements/go && go vet ./... && go test ./....

Latency budget as a test ​

The scenario "p95 of GET /quote under 50 ms, p99 under 120 ms" becomes a Go test. The numbers are copied from the requirement; they are never "today's measurement plus 10%".

go
// Package handler is the system under test for the latency budget.
package handler

import (
	"net/http"
	"time"
)

// Quote answers GET /quote. The sleep stands in for a database read.
func Quote(w http.ResponseWriter, _ *http.Request) {
	time.Sleep(2 * time.Millisecond)
	w.Header().Set("Content-Type", "application/json")
	_, _ = w.Write([]byte(`{"price":1200}`))
}
go
package handler

import (
	"net/http"
	"net/http/httptest"
	"slices"
	"testing"
	"time"
)

// percentile uses the nearest-rank method on a sorted copy.
func percentile(samples []time.Duration, p float64) time.Duration {
	s := slices.Clone(samples)
	slices.Sort(s)
	rank := int(p/100*float64(len(s))+0.5) - 1
	rank = max(0, min(rank, len(s)-1))
	return s[rank]
}

// QAS: GET /quote, normal load, 95th percentile under 50 ms, 99th under 120 ms.
// The budget is taken from the requirement, never from today's measurements.
func TestQuoteLatencyBudget(t *testing.T) {
	const (
		runs   = 500
		p95Max = 50 * time.Millisecond
		p99Max = 120 * time.Millisecond
	)
	srv := httptest.NewServer(http.HandlerFunc(Quote))
	defer srv.Close()

	samples := make([]time.Duration, 0, runs)
	for range runs {
		start := time.Now()
		resp, err := http.Get(srv.URL)
		if err != nil {
			t.Fatal(err)
		}
		_ = resp.Body.Close()
		samples = append(samples, time.Since(start))
	}

	if got := percentile(samples, 95); got > p95Max {
		t.Errorf("p95 = %v, budget %v", got, p95Max)
	}
	if got := percentile(samples, 99); got > p99Max {
		t.Errorf("p99 = %v, budget %v", got, p99Max)
	}
}

Fitness function in CI: the domain stays pure ​

An ArchUnit-style rule using only the standard library: parse the import blocks of domain/*.go and fail if they name net/http, database/sql or any third-party module.

go
// Package domain holds business rules. The fitness test forbids it from
// importing transport or storage packages.
package domain

import "errors"

// Order is a minimal aggregate used by the fitness function.
type Order struct {
	ID    string
	Total int64
}

// Validate keeps the rule free of I/O.
func (o Order) Validate() error {
	if o.Total <= 0 {
		return errors.New("total must be positive")
	}
	return nil
}
go
// Package adapter may import anything; it is the outer layer.
package adapter

import (
	"net/http"

	"academy/quality-attributes-requirements/fitness/domain"
)

// Handle validates an order and answers with a status code.
func Handle(w http.ResponseWriter, _ *http.Request) {
	if err := (domain.Order{ID: "o-1", Total: 100}).Validate(); err != nil {
		http.Error(w, err.Error(), http.StatusUnprocessableEntity)
	}
}
go
package fitness

import (
	"go/parser"
	"go/token"
	"path/filepath"
	"strconv"
	"strings"
	"testing"
)

// Fitness function: "the domain package must stay free of I/O".
// It parses only the import blocks, so it runs in milliseconds in CI.
var forbidden = []string{"net/http", "database/sql", "os/exec", "github.com/"}

func TestDomainImportsNoInfrastructure(t *testing.T) {
	files, err := filepath.Glob("domain/*.go")
	if err != nil || len(files) == 0 {
		t.Fatalf("no domain files found: %v", err)
	}
	fset := token.NewFileSet()
	for _, f := range files {
		parsed, err := parser.ParseFile(fset, f, nil, parser.ImportsOnly)
		if err != nil {
			t.Fatal(err)
		}
		for _, imp := range parsed.Imports {
			path, _ := strconv.Unquote(imp.Path.Value)
			for _, bad := range forbidden {
				if strings.HasPrefix(path, bad) {
					t.Errorf("%s imports %q: the domain layer must not depend on infrastructure", f, path)
				}
			}
		}
	}
}

The same rule as configuration, for go-arch-lint (README: "Linter used to enforce some good project structure and validate top level architecture (code layers)"):

yml
version: 3
workdir: fitness
components:
  domain:  { in: domain }
  adapter: { in: adapter }
commonComponents:
  - domain
deps:
  adapter:
    mayDependOn:
      - domain
  # domain has no mayDependOn entry, so it may depend on nothing but the stdlib

Run it in CI with go-arch-lint check (verify the exact command against the version you install: the README documents a check command, and the config syntax shown follows the README example for version: 3).

Error budget arithmetic ​

go
// Package budget turns an availability target into minutes you can spend.
package budget

import "time"

// AllowedDowntime returns how long a service may be unavailable inside the
// window and still meet the availability target (0.999 means "three nines").
func AllowedDowntime(target float64, window time.Duration) time.Duration {
	return time.Duration((1 - target) * float64(window))
}

// BudgetRemaining returns the fraction of the error budget still unspent,
// given the measured good and total request counts for the window.
// A negative value means the SLO is already broken.
func BudgetRemaining(target float64, good, total int64) float64 {
	if total == 0 {
		return 1
	}
	allowedBad := (1 - target) * float64(total)
	actualBad := float64(total - good)
	if allowedBad == 0 {
		if actualBad == 0 {
			return 1
		}
		return -1
	}
	return 1 - actualBad/allowedBad
}
go
package budget

import (
	"math"
	"testing"
	"time"
)

func TestAllowedDowntime(t *testing.T) {
	month := 30 * 24 * time.Hour
	cases := []struct {
		target float64
		want   time.Duration
	}{
		{0.99, 7*time.Hour + 12*time.Minute},
		{0.999, 43*time.Minute + 12*time.Second},
		{0.9999, 4*time.Minute + 19*time.Second + 200*time.Millisecond},
	}
	for _, c := range cases {
		got := AllowedDowntime(c.target, month)
		if d := got - c.want; d > time.Second || d < -time.Second {
			t.Errorf("target %v: got %v, want about %v", c.target, got, c.want)
		}
	}
}

func TestBudgetRemaining(t *testing.T) {
	// 99.9% of 1,000,000 requests allows 1,000 bad ones; 250 bad leaves 75%.
	got := BudgetRemaining(0.999, 999_750, 1_000_000)
	if math.Abs(got-0.75) > 1e-9 {
		t.Errorf("got %v, want 0.75", got)
	}
}

A requirements smell linter ​

A 40-line pre-commit check that flags subjective language, vague adverbs, loopholes, comparatives and technology names. It is deliberately crude: it finds candidates for a human to rewrite.

go
// Package smells flags requirement wording that cannot be verified.
package smells

import (
	"regexp"
	"strings"
)

// Finding names one smell found in one requirement sentence.
type Finding struct {
	Smell string
	Match string
}

var rules = []struct {
	name string
	re   *regexp.Regexp
}{
	{"subjective language", regexp.MustCompile(`(?i)\b(user[- ]friendly|easy to use|intuitive|simple|robust|modern|flexible)\b`)},
	{"ambiguous adverb or adjective", regexp.MustCompile(`(?i)\b(fast|quickly|significant|minimal|almost always|reasonable|adequate|real[- ]time)\b`)},
	{"loophole", regexp.MustCompile(`(?i)\b(as far as possible|if possible|where appropriate|when necessary|etc\.?)\b`)},
	{"superlative or comparative", regexp.MustCompile(`(?i)\b(best|fastest|better|faster|more efficient|maximal)\b`)},
	{"solution in requirement", regexp.MustCompile(`(?i)\b(use|using|via|with) (redis|kafka|postgres(ql)?|mysql|kubernetes|microservices?|rabbitmq)\b`)},
}

// Check returns every smell found in the sentence.
func Check(requirement string) []Finding {
	var out []Finding
	for _, r := range rules {
		for _, m := range r.re.FindAllString(requirement, -1) {
			out = append(out, Finding{Smell: r.name, Match: strings.ToLower(m)})
		}
	}
	return out
}
go
package smells

import "testing"

func TestCheck(t *testing.T) {
	bad := "The checkout must be fast and user-friendly, using Redis, as far as possible."
	got := Check(bad)
	want := map[string]bool{
		"ambiguous adverb or adjective": false,
		"subjective language":           false,
		"solution in requirement":       false,
		"loophole":                      false,
	}
	for _, f := range got {
		want[f.Smell] = true
	}
	for smell, seen := range want {
		if !seen {
			t.Errorf("expected smell %q in %q", smell, bad)
		}
	}

	good := "95% of POST /orders requests complete in under 300 ms at 200 requests per second."
	if f := Check(good); len(f) != 0 {
		t.Errorf("unexpected findings for a measurable requirement: %v", f)
	}
}

The Go angle ​

NeedGo tool
Benchmarkstesting.B, go test -bench, benchstat to compare runs
Loadvegeta, k6, hey
Profilingpprof, go tool trace, runtime/metrics
Metricsprometheus/client_golang histograms, OpenTelemetry Go SDK
Structurego/parser, go-arch-lint, go list -deps, internal/ packages (compiler-enforced visibility)
Race and leak checksgo test -race, goleak
Vulnerabilitiesgovulncheck
Contract testsnet/http/httptest, testing/synctest (experimental flag in older Go releases) for deterministic time

internal/ is the cheapest fitness function Go offers: the compiler refuses imports from outside the parent tree, so modularity is enforced before any linter runs.

Laravel ​

Laravel 13 on PHP 8.4. PHP snippets were reviewed, not executed.

Latency budget as a Pest test ​

Illuminate\Support\Benchmark::value() returns the callback result and the duration in milliseconds (Laravel 13 helpers documentation). The budgets come from the scenario.

php
<?php

declare(strict_types=1);

namespace Tests\Feature;

use Illuminate\Support\Benchmark;

/**
 * QAS: GET /api/quote, normal load, 95th percentile under 50 ms,
 * 99th percentile under 120 ms. Budgets come from the requirement.
 */
function percentile(array $samples, float $p): float
{
    sort($samples);
    $rank = (int) round($p / 100 * count($samples)) - 1;

    return $samples[max(0, min($rank, count($samples) - 1))];
}

it('keeps GET /api/quote inside its latency budget', function () {
    $samples = [];

    // Warm up so route cache, opcache and the container do not skew run 1.
    $this->getJson('/api/quote')->assertOk();

    for ($i = 0; $i < 300; $i++) {
        // Benchmark::value() returns [result, milliseconds].
        [, $ms] = Benchmark::value(fn () => $this->getJson('/api/quote')->assertOk());
        $samples[] = $ms;
    }

    expect(percentile($samples, 95))->toBeLessThan(50.0);
    expect(percentile($samples, 99))->toBeLessThan(120.0);
})->group('budget'); // run with: php artisan test --group=budget

Architecture tests with Pest and Deptrac ​

Pest's arch() expectations (toUse, toOnlyUse, toBeReadonly, toBeUsed) check namespaces and usage. Deptrac, "a static code analysis tool for PHP that helps you communicate, visualize and enforce architectural decisions in your projects", reads deptrac.yaml and runs in CI as vendor/bin/deptrac analyse.

php
<?php

declare(strict_types=1);

// tests/Arch/ArchTest.php - Pest architecture tests (the ArchUnit idea for PHP).

arch('domain is free of the framework')
    ->expect('App\Domain')
    ->not->toUse(['Illuminate\Http', 'Illuminate\Support\Facades']);

arch('models only depend on the database layer')
    ->expect('App\Models')
    ->toOnlyUse(['Illuminate\Database', 'Illuminate\Support', 'App\Models']);

arch('controllers never reach into infrastructure directly')
    ->expect('App\Http\Controllers')
    ->not->toUse('App\Infrastructure');

arch('no debug leftovers')
    ->expect(['dd', 'dump', 'ray'])
    ->not->toBeUsed();

arch('value objects are immutable')
    ->expect('App\Domain\ValueObjects')
    ->toBeReadonly();
yaml
# deptrac.yaml - run in CI with: vendor/bin/deptrac analyse
deptrac:
  paths:
    - ./app
  layers:
    - name: Controller
      collectors:
        - type: classLike
          value: App\\Http\\Controllers\\.*
    - name: Application
      collectors:
        - type: classLike
          value: App\\Application\\.*
    - name: Domain
      collectors:
        - type: classLike
          value: App\\Domain\\.*
    - name: Infrastructure
      collectors:
        - type: classLike
          value: App\\Infrastructure\\.*
  ruleset:
    Controller:
      - Application
    Application:
      - Domain
    Infrastructure:
      - Domain
      - Application
    Domain: ~

Error budget in PHP ​

php
<?php

declare(strict_types=1);

namespace App\Reliability;

use DateInterval;

/**
 * Turns an availability SLO into minutes and tells you how much is left.
 */
final readonly class ErrorBudget
{
    public function __construct(private float $target) // 0.999 = "three nines"
    {
    }

    /** Seconds of full outage allowed inside the window. */
    public function allowedDowntimeSeconds(DateInterval|int $window): float
    {
        $seconds = $window instanceof DateInterval
            ? (new \DateTimeImmutable('@0'))->add($window)->getTimestamp()
            : $window;

        return (1 - $this->target) * $seconds;
    }

    /** 1.0 = untouched, 0.0 = spent, negative = SLO broken. */
    public function remaining(int $goodRequests, int $totalRequests): float
    {
        if ($totalRequests === 0) {
            return 1.0;
        }

        $allowedBad = (1 - $this->target) * $totalRequests;
        $actualBad = $totalRequests - $goodRequests;

        if ($allowedBad == 0.0) {
            return $actualBad === 0 ? 1.0 : -1.0;
        }

        return 1 - $actualBad / $allowedBad;
    }
}

The Laravel angle ​

NeedLaravel or PHP tool
Latency in testsBenchmark::value, Pest --group, Http::fake for stable dependencies
Throttling as a resistance NFRRateLimiter::for() and the throttle middleware (rate-limiting docs)
Queue wait timeLaravel Horizon, Queue::size, php artisan queue:monitor
Production metricsLaravel Pulse, OpenTelemetry PHP, Prometheus exporters
StructurePest arch(), Deptrac, Larastan levels
Securitycomposer audit, Policies and Gates tests
OctanePersistent workers lift throughput; test for memory leaks across requests
AcceptanceBehat, Pest feature tests ($this->postJson())

Solving the classic problems ​

ProblemSymptomSolutionCost
"Make it fast"Endless tuningScenario with percentile and load, then a CI budgetAn hour of negotiation per attribute
NFRs found in productionOutage on launch dayUtility tree and a premortem before designWorkshop time
Conflicting NFRsTeam arguesTrade-off ADR with an ownerA decision record
Gold platingFive nines for an internal toolDerive SLO from business loss per hourSaying no
DriftQuality slowly erodesFitness functions in CITest maintenance
Unowned qualities"Everyone's job"One owner per scenarioName on a page
Unmeasured SLODashboards with no thresholdsSLI definitions in code, burn-rate alertsObservability work
Shared-fate redundancyTwo replicas die togetherSeparate zones, deploys, credentialsCost

"The system must be fast and reliable" ​

text
     Step  Question                                   Answer (example)
1    1     Fast for whom, doing what?                 Shoppers submitting an order
2    2     How fast, at what percentile?              95% under 300 ms
3    3     At what load, where measured?              200 req/s, at the load balancer
4    4     Reliable meaning what?                     99.9% non-5xx per 30 days
5    5     What happens when we miss it?              Freeze risky releases (error budget policy)

"Everything is a priority" ​

Force-rank with two letters (importance, difficulty) and refuse more than three (H,H) leaves. If everything is highest priority, nothing is.

"We cannot test an NFR" ​

Every response measure has a test form: latency (benchmark), availability (SLI plus chaos), modifiability (a time-boxed change experiment or a dependency rule), security (a test that attacks), usability (a task-based test with five users).

Choosing ​

SituationFocus qualitiesTechniqueReason
New product, little knownModifiability, time to marketModular monolith, light scenariosCheap to change
Payments or ledgerIntegrity, auditability, availabilityStrict scenarios, ATAM-style review, immutable logMistakes cost money
Public APICompatibility, security, performanceVersioning policy, SLOs, rate limitsMany consumers
Real-time or gamingTime behaviour, capacityp99 budgets, load testsTails ruin the experience
Regulated (health, finance)Safety, security, complianceConstraints list, evidence for eachAudit
Internal toolMaintainability, installabilityFew scenariosLow risk
MobileInteraction capability, flexibilityUsability tests, device matrixUsers judge by feel
Data platformRecoverability, capacityRPO and RTO drillsData loss is the main risk

In architecture: from a single process to a distributed system ​

The same sentence, "the checkout is available 99.9%", means a different engineering task at each scale. Quality attributes do not shrink when you distribute; they split into per-component numbers that multiply.

Monolith: one process, one database ​

All qualities are decided by code structure and a few infrastructure choices. Availability is mostly the database plus the deploy process. Modifiability is module boundaries inside one repository. The fitness functions are import rules and benchmarks.

text
     Request path (monolith)                       Quality exposure
1    HTTP -> middleware -> controller               time behaviour (framework overhead)
2    controller -> service -> repository            modularity (import rules)
3    repository -> PostgreSQL (same host or VPC)    availability (one DB), recoverability (backups)
4    response                                        p95 measured here

Example: a Laravel shop with a single PostgreSQL. NFRs: p95 300 ms, 99.9% monthly, RPO 5 min. Design moves: connection pooling, an index, PITR with WAL archiving, Pest arch tests that keep App\Domain free of Illuminate\Http.

Modular monolith and multiple databases ​

Boundaries become the main modifiability tool. Each module has its own scenarios (the billing module: change tax rule in one day with no edit outside billing/) and its own budgets. A read replica adds a consistency trade-off: reports may lag.

MechanismQuality gainedQuality given up
Module facades and internal/ packagesModularity, modifiabilityA little indirection
One schema per moduleModularityCross-module joins
Read replica for reportsTime behaviour on the primaryStale reads (see Replication & Failover)
Deptrac or go-arch-lint per moduleEnforced boundariesCI minutes

Microservices: SLOs per service ​

Each service has its own SLIs and SLOs, and the composite availability is the product along the call path. Three 99.9% services in series give 99.7%; to keep the user-facing 99.9%, each hop needs about 99.97%, or the path needs fewer synchronous hops, caching or asynchronous messaging.

text
     Service        Own SLO   Called synchronously by checkout   Composite effect
1    gateway        99.99%    yes                                0.9999
2    checkout       99.95%    -                                  0.9994
3    payments       99.9%     yes                                0.9984
4    inventory      99.9%     yes                                0.9974
5    email          99.5%     no (async via queue)               unchanged
6    Result         user-facing target 99.9% is MISSED unless payments/inventory improve or one call becomes async
Design moveEffect on the budget
Make email asynchronousRemoves it from the serial chain; its failure no longer spends checkout's budget
Timeouts shorter than the caller's SLOPrevents tail latency from adding up
Per-dependency circuit breakerProtects availability, adds a degraded mode that must be specified
Per-service error budgetsTeams ship independently; see Distribution of Components
Contract tests as fitness functionsCompatibility survives independent deploys

Example flow: checkout calls payments (timeout 800 ms, 1 retry with jitter) and inventory (timeout 300 ms); a slow inventory p99 of 1.2 s breaks the checkout p99 unless the call has a deadline and a fallback ("reserve optimistically, confirm later").

Distributed data: replicas, caches and consistency choices ​

Quality attributes now include which consistency you offer. A consistency choice is a quality attribute scenario: "after a user changes their address, the next page shows the new one" is read-your-writes; "ranking updates within 5 minutes" is bounded staleness.

OperationChoiceQuality boughtQuality lost
Payment captureStrong consistency, single primaryIntegrityAvailability in a partition
Product catalogueCache for 60 s, replicasTime behaviour, availabilityFreshness
Like counterEventual, asynchronous aggregationThroughputExactness
Inventory reservationSingle partition owner, compare-and-setIntegrityCross-region latency
SessionSticky or replicated storeResilienceCost

See Eventual Consistency in Databases for the mechanics, and Backup, PITR & Disaster Recovery for RPO and RTO. Cross-region active-active raises latency to hundreds of milliseconds for any strongly consistent write: that number must appear in the scenario, not be discovered.

Scaling path: 1x, 10x, 100x ​

LoadTypical NFR focusDesign moveFitness function
1x (hundreds of requests per second)Correctness, modifiabilityMonolith, one database, backupsUnit tests, import rules
10xLatency, capacityCaching, read replicas, connection pooling, queuesLoad test in CI nightly, p95 budget
100xAvailability, cost, consistencySharding, service split, multi-AZ, backpressureSLO burn alerts, chaos drills, per-service budgets

Do not design for 100x at 1x: an unmeasured requirement is a guess. The scenario carries a growth assumption ("10x orders within 18 months") and a revisit date.

Worked requirements document: "Place order" ​

A complete, compact requirements document for one feature of an online shop, using everything above.

1. Context and goal. Shoppers pay for a cart; the system confirms, reserves stock and sends a receipt. Business driver: conversion and trust ("never charge twice, never oversell").

2. Stakeholders. Shopper, support, finance, warehouse, payment provider, security officer.

3. Functional requirements.

IDRequirementAcceptance (Gherkin file above)
FR-1A shopper can pay for a cart with a card"Successful payment reserves stock"
FR-2A retried request with the same idempotency key returns the original order"A retried request does not double-charge"
FR-3Stock is reserved exactly once per paid orderSame as FR-1
FR-4A receipt email is sent after paymentEmail sent within 1 minute (see NFR-5)
FR-5Support can see the order's historyRole check test

4. Quality attribute scenarios.

IDAttribute (25010)Scenario (source, stimulus, artifact, environment, response, measure)Priority
NFR-1Time behaviour200 shoppers submit POST /orders to the checkout service at normal load; it stores the order and returns 201; p95 under 300 ms, p99 under 800 ms(H,M)
NFR-2CapacityBlack Friday: 10x orders per hour; service scales out; no request waits in a queue over 10 s(H,H)
NFR-3Availability, fault toleranceOne of three app nodes dies at peak; load balancer removes it; failed requests at most 0.1% for 30 s(H,M)
NFR-4RecoverabilityOperator drops the orders table; restore with PITR; RPO 5 min, RTO 30 min(H,H)
NFR-5Time behaviour (asynchronous)After payment, receipt email enqueued; 99% sent within 60 s(M,L)
NFR-6IntegrityAttacker changes the price in the request; server recomputes; 100% rejected and audited(H,L)
NFR-7ConfidentialityNo PAN or CVV in logs or database (scan finds zero); card data handled only by the provider's hosted fields(H,L)
NFR-8ModifiabilityDeveloper adds a payment provider in under 3 person-days with no change outside payment/(M,M)
NFR-9TestabilityPricing rules unit tests run in under 20 s without a database(M,L)
NFR-10Interaction capability (inclusivity)A keyboard-only user completes checkout; WCAG 2.2 AA checks pass in CI(M,M)

5. SLOs for operation. Availability SLI: non-5xx share of POST /orders at the load balancer; SLO 99.9% over 30 days (error budget 43 min). Latency SLI: share of requests under 300 ms; SLO 95%.

6. Constraints. C-1: card data stays out of our systems (PCI DSS scope). C-2: PostgreSQL 16 on the existing cluster. C-3: EU customers' data stays in the EU. C-4: PHP 8.4 and Laravel 13; Go for the pricing service.

7. Out of scope. Subscriptions, multi-currency, gift cards.

8. Trade-offs recorded. ADR-1: outbox relay adds up to 200 ms to receipt delivery; accepted (NFR-5 allows 60 s). ADR-2: strong consistency for stock reservation in one region; cross-region orders pay extra latency.

9. Verification plan.

RequirementCheckWhere
NFR-1Latency budget test (Go TestQuoteLatencyBudget, Pest --group=budget), k6 nightlyCI
NFR-2k6 ramp to 10x on stagingWeekly
NFR-3Chaos experiment: kill one podMonthly
NFR-4Restore drill into scratch environmentQuarterly
NFR-6Feature test that tampers with the priceCI
NFR-7Log scanner for PAN regexCI
NFR-8, NFR-9Deptrac or go-arch-lint, test duration budgetCI
NFR-10axe-core in PlaywrightCI
SLOBurn-rate alertsProduction

Smell check of the original request "the checkout must be fast, secure and reliable, using Redis": three compound adjectives (ambiguous), one solution (Redis), no measures. The nine numbers above replace it.

Lab: from a smell to a failing build ​

bash
cd docs/snippets/design/quality-attributes-requirements/go
go vet ./... && go test ./...
# ok  academy/quality-attributes-requirements/budget
# ok  academy/quality-attributes-requirements/fitness
# ok  academy/quality-attributes-requirements/latency/handler
# ok  academy/quality-attributes-requirements/smells
  1. Break the latency budget. In latency/handler/handler.go change the sleep to 80 * time.Millisecond and run go test ./latency/.... Expected: p95 = 8x.xms, budget 50ms. Put the sleep back.
  2. Break the architecture. Add import _ "net/http" to fitness/domain/order.go and run go test ./fitness/.... Expected: domain/order.go imports "net/http": the domain layer must not depend on infrastructure.
  3. Run the smell linter. In smells/smells_test.go replace the good sentence with "The system should be fast, robust, etc." and read which smells fire (ambiguous adjective, subjective language, loophole).
  4. Spend an error budget. Call BudgetRemaining(0.999, 999_000, 1_000_000): allowed bad requests are 1,000 and actual bad are 1,000, so the budget is exactly spent and the result is about 0. Change the good count to 998,500 and the result is -0.5 (the SLO is broken, with 50% more failures than allowed).
  5. PHP side (if you have a Laravel app). Copy ArchTest.php into tests/Arch/, run ./vendor/bin/pest --filter=arch, then add use Illuminate\Http\Request; in a class under App\Domain and watch it fail.
  6. Write your own. Take one sentence from your current project, run it through the smell table, write a six-part scenario, and add one test.

Common misconceptions ​

BeliefReality
Non-functional means unimportantA system missing its qualities is unusable regardless of features
Average latency is enoughPercentiles expose the tail; averages hide 5% of users
100% availability is the goalIt is unachievable and blocks delivery; choose an SLO and spend the budget
Five nines means betterEach nine multiplies cost; derive the target from business loss
Qualities are independentThey trade off; every decision moves several
ISO 25010 tells you what to buildIt names qualities; you choose and measure them
We can add quality at the endStructure decides performance, availability and security
A user story is the requirementIt is a token for a conversation plus acceptance criteria
Microservices improve all qualitiesThey improve independent deployability and cost availability and latency
Fitness functions need a special toolAny automated pass or fail check on a quality is one
A constraint is a bad requirementConstraints are legitimate; unjustified ones are the smell
Redundancy always raises availabilityOnly if failures are independent

Cheat sheet ​

TopicWhat to remember
FR vs NFRWhat it does vs how well; attach the quality to the feature's acceptance criteria
ConstraintA fixed boundary decided elsewhere; record owner and reason
ISO 25010:2023Nine characteristics: functional suitability, performance efficiency, compatibility, interaction capability, reliability, security, maintainability, flexibility, safety
ScenarioSource, stimulus, artifact, environment, response, response measure
LatencyState percentile, window, load, place of measurement
Nines99.9% = 43 min per 30 days; 99.99% = 4 min 19 s
Serial availabilityMultiply; three 99.9% services give 99.7%
RPO / RTOData you can lose / time to be back
SLI, SLO, SLAMeasurement, target, contract
Error budget100% minus SLO; spend it on releases, stop when gone
Trade-offsName the winner and the loser in an ADR
Utility treeQuality, refinement, scenario, (importance, difficulty)
ATAM outputRisks, non-risks, sensitivity points, trade-off points
Fitness functionAutomated pass or fail on an architectural quality, in CI
SmellsVague words, loopholes, missing numbers, technology as requirement
StoriesUser story = promise to talk; use case = flows; job story = situation + motivation
GherkinGiven, When, Then, plus Rule, Background, Scenario Outline
ScalePer-service SLOs multiply; consistency is a quality choice

Self-check: questions & answers ​

Show:
  • Must-know asked in almost every interview
  • Important frequent; expected at senior level
  • Good to know extra depth that sets you apart

1 — Classify: "Only the account owner can download invoices", "Download of a 50 MB invoice bundle takes under 10 s at p95", "Invoices stay on EU servers". Must-know ​

Answer

Answer: The first is a functional rule (access control behaviour) that also expresses confidentiality; the second is a quality attribute (time behaviour) with a percentile; the third is a constraint (legal residency) decided outside the team.

2 — List the nine ISO/IEC 25010:2023 characteristics and name two sub-characteristics of reliability. Good to know ​

Answer

Answer: Functional suitability, performance efficiency, compatibility, interaction capability, reliability, security, maintainability, flexibility, safety. Reliability has faultlessness, availability, fault tolerance and recoverability.

3 — Name the six parts of a quality attribute scenario. Important ​

Answer

Answer: Source of stimulus, stimulus, artifact, environment, response, response measure.

4 — Why is "average latency under 200 ms" a weak requirement? Must-know ​

Answer

Answer: The mean hides the tail: 5% of requests can be many times slower without moving the average. State percentiles (p95, p99), load and where it is measured.

5 — How much downtime does 99.9% allow in 30 days, and what do three serial services at 99.9% give together? Must-know ​

Answer

Answer: 43 minutes 12 seconds; 0.999 cubed is about 99.7%, roughly 2 hours 10 minutes per 30 days.

6 — What is the difference between RPO and RTO? Must-know ​

Answer

Answer: RPO is how much recent data you may lose (time between the last recoverable point and the failure); RTO is how long you may take to be back in service.

7 — What does an error budget let a team do? Important ​

Answer

Answer: It turns the SLO into an allowed amount of unreliability; while budget remains, risky releases proceed; when it is spent, effort moves to reliability until it recovers.

8 — Give three trade-off pairs and one decision that moves each. Important ​

Answer

Answer: Performance vs maintainability: a hand-tuned cache; security vs usability: mandatory MFA on every login; consistency vs availability: choosing quorum reads or accepting stale replicas during a partition.

9 — What is a sensitivity point and what makes it a trade-off point? Good to know ​

Answer

Answer: A property critical to achieving a particular quality response (for example encryption strength for confidentiality). It is a trade-off point when it is a sensitivity point for more than one attribute (the same strength also affects latency).

10 — Which smells are in "The system must use Kafka and be user-friendly, etc."? Must-know ​

Answer

Answer: Solution in requirement (Kafka), subjective language (user-friendly), open-ended term (etc.); it also lacks any measure.

11 — Write a fitness function that keeps the domain layer free of HTTP in Go and in Laravel. Important ​

Answer

Answer: Go: a test that parses domain/*.go imports and fails on net/http (or go-arch-lint with no allowed dependencies). Laravel: Pest arch('domain')->expect('App\Domain')->not->toUse('Illuminate\Http') or a Deptrac ruleset where Domain has no allowed dependencies.

12 — When does a user story need a use case alongside it? Important ​

Answer

Answer: When the interaction has many alternative or error flows, regulation requires completeness, or several systems exchange messages; the story stays as the planning token.

Glossary ​

TermDefinition
Functional requirementWhat the system does
Non-functional requirement (NFR)A requirement about how well the system does it; also quality requirement or cross-functional requirement
Quality attributeA named property such as availability, security or modifiability
ConstraintA fixed boundary on the design decided outside the team
ISO/IEC 25010Product and in-use quality model of the SQuaRE series; 2023 edition has nine characteristics
Characteristic / sub-characteristicA top-level quality and its parts in ISO 25010
Functional suitabilityISO characteristic: completeness, correctness, appropriateness of functions
Performance efficiencyISO characteristic: time behaviour, resource utilization, capacity
CompatibilityISO characteristic: co-existence and interoperability
Interaction capabilityISO characteristic (formerly usability) covering learnability, operability, inclusivity and more
ReliabilityISO characteristic: faultlessness, availability, fault tolerance, recoverability
SecurityISO characteristic: confidentiality, integrity, non-repudiation, accountability, authenticity, resistance
MaintainabilityISO characteristic: modularity, reusability, analysability, modifiability, testability
FlexibilityISO characteristic (formerly portability): adaptability, scalability, installability, replaceability
SafetyISO characteristic: operational constraint, risk identification, fail safe, hazard warning, safe integration
Quality attribute scenarioSix-part, measurable description of a quality requirement
Source of stimulusEntity that generates the stimulus in a scenario
StimulusCondition that arrives at the system
ArtifactThe part of the system that is stimulated
EnvironmentConditions when the stimulus arrives (normal, overload, degraded)
ResponseWhat the system does
Response measureThe metric that judges the response
Latency percentile (p50, p95, p99)Latency below which that share of requests fall
Tail latencyThe slowest few percent of requests
ThroughputWork completed per unit of time
Little's lawIn-flight work equals arrival rate times time in system
AvailabilityShare of time or requests in which the service works
NinesShorthand for availability: three nines is 99.9%
RPORecovery Point Objective: maximum tolerable data loss in time
RTORecovery Time Objective: maximum tolerable time to restore service
MTTR / MTBFMean time to recover / mean time between failures
SLIService Level Indicator: a measured quantity
SLOService Level Objective: target for an SLI over a window
SLAService Level Agreement: contractual SLO with consequences
Error budgetAllowed unreliability, 100% minus the SLO
Burn rateSpeed at which the error budget is being spent
Trade-off pointProperty that is a sensitivity point for more than one attribute
Sensitivity pointProperty critical to achieving a quality response
Risk / non-riskProblematic or sound architectural decision found in ATAM
Utility treeTree from quality goals down to prioritised scenarios
ATAMArchitecture Tradeoff Analysis Method (SEI)
ASRArchitecturally significant requirement
ADRArchitecture Decision Record
Fitness functionAutomated check of an architectural quality
Evolutionary architectureArchitecture that supports guided, incremental change
Requirements smellWording that hints at an untestable or ambiguous requirement
User storyShort statement of desired functionality, template by Cohn
Use caseGoal-oriented description of actor and system interaction with alternatives
Job storySituation, motivation, outcome format
Acceptance criteriaConditions that must hold for a story to be accepted
GherkinGiven-When-Then plain-text specification language of Cucumber
TacticA single design move that influences a quality
Coordinated omissionLoad-test artefact that hides tail latency
Arch testTest of dependencies between packages or namespaces (go-arch-lint, Deptrac, Pest arch())

References ​

Every URL below was fetched and returned HTTP 200 unless marked otherwise; the text is saved in the scratchpad sources/quality-attributes-requirements/ folder.

Built by Morteza Negahi