Markdown Editor

Architecture Fitness Functions Catalogue Template

Catalogue of executable architecture checks per quality attribute: type, metric, threshold, tool, cadence, owner, result

Kiến trúc & Thiết kế hệ thốngChuẩnBuilding Evolutionary Architectures (fitness function concept)fitnessfunctions
Mở trong editorTải .md

Cách dùng: Use to protect architectural characteristics as the system evolves. List the quality attributes first, then define one objective, automated check with a threshold for each. The main pitfall is vague checks or thresholds without a recorded rationale, which get disabled later.

Xem trước

Architecture Fitness Functions Catalogue: [System or product]

Catalogue of architecture fitness functions for [System]: the quality attributes that matter, an objective check for each, how it is classified, the metric and threshold, where it is implemented, how often it runs, who owns it and its current result. Based on the fitness function concept from Building Evolutionary Architectures (Neal Ford, Rebecca Parsons, Patrick Kua, and in the second edition Pramod Sadalage). Replace every [bracketed] value and every row marked Example.

FieldValue
Catalogue ID[FF-SYSTEM]
System[Name and scope]
Version[0.1]
Owner[@architect]
Contributors[Teams]
Last reviewedYYYY-MM-DD
Related[Architecture description], [Quality attribute scenarios], [Tech debt register]

1. Purpose and concept

A fitness function is an objective measure of how well the system meets one architectural characteristic. Together, the functions in this catalogue act as an executable description of the architecture: when a change would erode a property we care about, a check fails early and the team decides consciously whether to fix the change or revise the target. The concept comes from evolutionary computing, where a fitness function scores how close a candidate solution is to the goal.

2. Quality attributes in scope

IDQuality attributeWhy it mattersPriority
QA-01Example: Modularity (layering and bounded contexts)Teams release independently; coupling slows every changeHigh
QA-02Example: Performance (API latency)Checkout abandonment rises above 1 s response timeHigh
QA-03Example: Security (dependency hygiene)Regulator requires patching critical CVEs within 14 daysHigh
QA-04Example: AvailabilityContractual 99.9% monthly SLAHigh
QA-05Example: DeployabilityTarget: deploy any service on any working day in < 30 minMedium
QA-06Example: Cost efficiencyUnit cost must fall as volume growsMedium
[QA-nn][Attribute][Reason][H/M/L]

3. Classification dimensions

DimensionValuesMeaning
ScopeAtomic / HolisticAtomic checks one characteristic in isolation; holistic checks how several interact (for example performance under a security control)
TriggerTriggered / ContinualTriggered runs on an event such as a commit or a release; continual runs all the time, typically in production monitoring
ResultStatic / DynamicStatic compares with a fixed threshold; dynamic threshold depends on context such as load or time of day
ExecutionAutomated / ManualManual checks (for example a legal review) are allowed but should be rare and scheduled
TimingTemporalRuns on a calendar, for example "upgrade check every quarter"
IntentIntentional / EmergentIntentional checks are defined up front; emergent ones are added after the system reveals a new risk

4. Fitness function catalogue

IDQuality attributeFitness function definitionTypeMetric and thresholdImplementationCadenceOwnerCurrent result
FF-01QA-01 ModularityExample: Classes in domain must not depend on infrastructure or web packagesAtomic, triggered, static, automated0 violationsArchitecture unit test (ArchUnit) in buildEvery commit[@team-core]Pass, 0 violations
FF-02QA-01 ModularityExample: No cycles between modulesAtomic, triggered, static, automated0 cyclesdependency-cruiser rule in CIEvery commit[@team-web]Pass
FF-03QA-02 PerformanceExample: p95 latency of /checkout under 300 RPS loadAtomic, triggered, static, automatedp95 <= 400 msk6 load test in staging pipelineEvery release candidate[@team-checkout]362 ms, pass
FF-04QA-03 SecurityExample: No dependency with a known critical vulnerability older than 14 daysAtomic, triggered and temporal, static, automated0 critical findings > 14 daysSoftware composition analysis in CI plus nightly scanEvery commit and nightly[@security]1 finding, 6 days old, pass
FF-05QA-04 AvailabilityExample: Monthly availability of public API from synthetic probesAtomic, continual, static, automated>= 99.9% per monthSynthetic checks every minute from 3 regionsContinual[@sre]99.95% last month, pass
FF-06QA-02 and QA-03Example: p95 latency stays within budget with WAF and mTLS enabledHolistic, triggered, static, automatedp95 <= 400 ms with all security controls onLoad test in production-like environmentMonthly[@sre]391 ms, pass (near threshold)
FF-07QA-05 DeployabilityExample: Lead time from merge to productionAtomic, continual, dynamic, automatedMedian < 30 min; alert if 7-day median rises 50% above the 90-day medianPipeline metrics dashboardContinual[@platform]22 min median, pass
FF-08QA-06 CostExample: Infrastructure cost per 1,000 ordersHolistic, temporal, dynamic, automatedMust not rise for two consecutive monthsCost export and queryMonthly[@finops]Fell 4%, pass
FF-09QA-03 SecurityExample: Annual review of data flows against records of processingAtomic, temporal, static, manualReview completed and signed offPrivacy review checklistYearly[@dpo]Due YYYY-MM-DD
[FF-nn][QA-nn][Precise definition][Scope, trigger, result, execution][Metric and threshold][Test, tool, query][Cadence][@name][Result and date]

4.1 Threshold rationale

Record why each threshold has its value, so it can be revisited.

IDThresholdRationaleSource
FF-03p95 <= 400 msExample: Leaves 600 ms of the 1 s page budget for front end and networkPerformance budget, [link]
FF-0414 daysExample: Regulatory patching deadline[Policy reference]
[FF-nn][Threshold][Reason][Source]

5. Implementation guidelines

  • Store fitness function code in the same repository as the system it checks, under [path, e.g. tests/architecture/], and review it like any other change.
  • Each failing check prints the function ID, the threshold, the measured value and a link to this catalogue.
  • Pipeline position: structural checks block merge; performance and holistic checks block promotion to production; continual checks raise alerts routed to the owner.
  • New quality attribute scenarios must propose at least one fitness function or explain why one is not possible.
  • Disabling a check needs an entry in section 6 with an expiry date.

6. Exceptions and waivers

IDFunctionWaiverReasonApproved byExpires
WV-01Example: FF-02Allow one known cycle between billing and invoicingBeing removed by TD-017[@architect]YYYY-MM-DD
[WV-nn][FF-nn][Change][Reason][@name]YYYY-MM-DD

7. Review and results history

Review dateFunctionsPassingNear thresholdFailingChanges made
YYYY-MM-DDExample: 981 (FF-06)0Added FF-08 cost check; tightened FF-03 from 500 ms to 400 ms
YYYY-MM-DD[n][n][IDs][IDs][Changes]

Actions from the latest review: [list with owners]. Example: profile the WAF rule set to restore headroom on FF-06 ([@sre], YYYY-MM-DD).

Standard and licence note

Based on the architecture fitness function concept described in Building Evolutionary Architectures by Neal Ford, Rebecca Parsons and Patrick Kua (O'Reilly, 2017; second edition with Pramod Sadalage, 2023). The classification dimensions are summarised in original words; no text from the book is reproduced. Tool names are examples only. Template licence: MIT.

Template liên quan