Skip to content
English

Introduction to quality attribute scenarios

A person opens a project and asks for its information. The system returns the data that person is authorized to see. A use case describes that interaction and its outcome. Sooner or later someone adds an expectation: the query should be fast. That raises two questions the use case does not answer. Fast under what conditions? And how fast is fast enough?

A quality attribute scenario answers both. This post shows how to write one, using hypothetical examples from the portal’s quality guidance. None of the services, figures or results in the examples describe TDP. They are teaching examples with illustrative, unapproved criteria and synthetic observations.

From a quality concern to a verifiable expectation

The running example is G01, a hypothetical project-information read service. One of its illustrative criteria reads:

During the ten-minute hold at an offered load of 50 requests/s, at least 95% of successful responses arrive complete at the client within 500 ms of dispatch.

The timing criterion counts only successful responses. A service that completes half its requests within 500 ms and rejects the rest would still meet that criterion.

G01 closes that gap with further criteria for the same hold. Errors must stay under 1% of arrived requests, and the service must achieve at least 49 successful requests/s. The guide also sets CPU and memory limits. The G01 scenario lists the full workload, every criterion and two worked runs.

The six parts of a quality attribute scenario

The Software Engineering Institute (SEI) describes a quality attribute scenario in six parts. The infographic shows what each part means in G01.

Hypothetical G01 example. Six-part framework from the SEI's Deriving Architectural Tactics, section 2.1.

Text equivalent. The stimulus source (simulated users) generates the stimulus (project query requests). The stimulus affects the artifact (the hypothetical query service and its dependencies), which produces the response (correct, authorized information or a recorded error). The environment includes the offered load of 50 requests per second during the hold and 100,000 synthetic records. The illustrated response measure checks whether at least 95% of successful responses arrive within 500 ms. The full G01 scenario also checks errors, throughput, CPU and memory.

What happens, and under what conditions?

The first four parts describe the situation.

The stimulus source is the actor or entity that generates the condition. In G01, that is a group of simulated users. The stimulus is the condition or event itself: project query requests. The environment is the context when the stimulus occurs. G01 states it precisely: up to 100 concurrent simulated users, 100,000 synthetic project records, an empty cache at the start, a one-minute ramp to 50 requests/s, then a ten-minute hold at that rate. The artifact is the system or part affected, here the hypothetical query service and its dependencies.

Two of these parts are easy to confuse. The stimulus is something that happens. The environment is a state the system is in when it happens. “A request arrives” is a stimulus; “the service is under a sustained load of 50 requests/s” is an environment.

What should happen, and how will we judge it?

The last two parts describe the expected outcome and how to evaluate it.

The response is the action expected when the stimulus occurs. Who acts depends on the scenario. In G01, the service returns correct, authorized information or records an error. The response measure states what the team will check and what counts as a pass. A recovery check might look for every acknowledged update after a fault. A timing check may also need to specify which responses count and when the clock starts and stops.

Example: where the 500 ms clock starts and stops. G01 starts the clock when the client sends the request and stops it when the client receives the complete response. Time spent preparing the request or displaying the result falls outside that interval.

A single response can therefore carry several criteria. G01 has timing, error, throughput, CPU and memory criteria, and the response meets the scenario only when all of them pass.

The SEI also distinguishes two levels of scenario. A general scenario is a reusable pattern independent of any system. For example, under sustained load, a service completes requests from clients within a specified time limit. A concrete scenario fixes the artifact, the conditions and the criteria for one evaluation. G01 is a concrete scenario. The SEI’s collection on reasoning about software quality attributes describes the two levels.

The same framework across runtime and development time

The six parts are not limited to speed. The table compares five hypothetical scenarios from the portal’s guidance. They are grouped by when the response of interest occurs. A test prepared during development can still evaluate a runtime response, as the recoverability example does.

Setting and attributeWhat happensExpected responseIllustrative criterion
RuntimeTime behaviourProject queries arrive under the stated load.The service returns the authorized information.At least 95% of successful responses arrive complete at the client within 500 ms. G01
RuntimeResource utilizationThe same read and update trace is replayed with and without caching.The service continues to return correct, authorized and up-to-date information.At least 20% less CPU time per correct read, with a separate memory limit. G01-E
RuntimeRecoverabilityA test controller stops a service instance.The service restores a usable state and preserves acknowledged updates.Recovery within 30 seconds of fault injection and zero lost acknowledged updates. G02
Development timeModifiabilityA product representative requests a rule threshold change.The team makes the change and checks behaviour, migration and rollback.At most ten total engineer-hours, and all required checks pass. G09
Development timeTestabilityA team member prepares a regression test for a time-sensitive rule.They reproduce the condition and detect a known wrong result.At most three total engineer-hours to construct and diagnose the test, which must detect the seeded wrong result. G08
  • Time behaviour

    Runtime

    What happens
    Project queries arrive under the stated load.
    Expected response
    The service returns the authorized information.
    Illustrative criterion
    At least 95% of successful responses arrive complete at the client within 500 ms. G01
  • Resource utilization

    Runtime

    What happens
    The same read and update trace is replayed with and without caching.
    Expected response
    The service continues to return correct, authorized and up-to-date information.
    Illustrative criterion
    At least 20% less CPU time per correct read, with a separate memory limit. G01-E
  • Recoverability

    Runtime

    What happens
    A test controller stops a service instance.
    Expected response
    The service restores a usable state and preserves acknowledged updates.
    Illustrative criterion
    Recovery within 30 seconds of fault injection and zero lost acknowledged updates. G02
  • Modifiability

    Development time

    What happens
    A product representative requests a rule threshold change.
    Expected response
    The team makes the change and checks behaviour, migration and rollback.
    Illustrative criterion
    At most ten total engineer-hours, and all required checks pass. G09
  • Testability

    Development time

    What happens
    A team member prepares a regression test for a time-sensitive rule.
    Expected response
    They reproduce the condition and detect a known wrong result.
    Illustrative criterion
    At most three total engineer-hours to construct and diagnose the test, which must detect the seeded wrong result. G08

Each example excerpts the criteria relevant to the comparison. The linked guides give the complete conditions and checks. Engineer-hours add up the effort of everyone involved; they are not elapsed time on the clock.

The modifiability example shows that all six parts also apply when the scenario evaluates the team’s work rather than the service’s behaviour in operation. Checks still run, but what is judged is how the team changes the rule and verifies the result. In G09, a product representative (stimulus source) requests a change to a rule threshold (stimulus). The work happens during planned maintenance, on an isolated copy of the data (environment). The rule service, its consumer contract and its stored rules are the artifact under evaluation. The team implements the change, migrates the stored state and rehearses the rollback (response). The response measure covers both the total effort and the behaviour, migration and rollback checks.

From an agreed target to evidence

Compare the target with what you observe under the stated conditions.

Example: a target and an observation. G02’s illustrative criteria allow at most 30 seconds from fault injection to restored service, with zero lost acknowledged updates. In the guide’s synthetic Run A, restoration took 20 seconds, which meets the time criterion. The data criterion needs its own check: all 60 acknowledged updates were preserved, so Run A also meets the zero-loss criterion in that exercise. A fast recovery that lost one acknowledged update would still fail the scenario.

Agree on what matters. Writing the scenario forces the conversation that a vague requirement skips: which conditions apply, what happens when the criterion is missed, and who can approve the target. The SEI’s Quality Attribute Workshop uses this kind of stakeholder discussion to generate, prioritize and refine scenarios. Agreement on the wording does not show that the target is feasible; that takes analysis and evidence.

Compare design choices. A design decision intended to improve one response can cost something elsewhere. The synthetic G01-E comparison replays identical reads and updates with and without caching, under comparable conditions. In that example, the invalidation-aware cache cuts CPU time per correct read by 40%, against a required 20%, while peak memory rises from 0.8 to 1.2 GiB, still under the 2 GiB limit. A TTL-only cache uses even less CPU but returns 120 stale responses and fails the freshness check. The team compares the resource measures and confirms timing, freshness and authorization before deciding whether the change is acceptable.

Prepare tests and monitoring. A scenario gives the team testable acceptance criteria to agree on before a change, and a basis for deciding what to monitor in production. A controlled test samples the conditions it specifies; it does not prove every future behaviour. A scenario measure can inform a service-level objective once its population and window are agreed. A scenario is not automatically a service-level agreement, which carries consequences; the Google SRE book explains the difference between indicators, objectives and agreements.

Write your first scenario

Start from this two-sentence prompt:

When [the stimulus from a named source] affects [the artifact] under [stated conditions], the expected response is [the action taken]. The response shall meet [the measurable criteria].

Choose a verb that fits the stimulus. A request arrives, a fault occurs, a change is requested. For each criterion, state what counts as a pass. Specify the population, time window or measurement boundaries where they affect the result.

Then pick one quality expectation from your own work, such as “it should recover quickly” or “it should be easy to change”. Write down what you would observe to decide whether it was met. If you cannot say, the expectation is not yet a scenario.

The full scenario template adds the context a team needs before acting on a scenario: the stakeholder, the target owner, the verification method, assumptions and approval status.

The next chapter looks at Time behaviour in more depth, including how controlled benchmarks and production monitoring complement each other. The series stays open to other quality attributes the team needs to explore.

Sources