r/systems_engineering • u/SysModeler • 30m ago
Resources SysML v2 Tutorial (Lesson 26): Requirement Definitions (Requirements as Code)
We are kicking off Phase 5 of our SysML v2 deep dive series. Up through Lesson 25, we covered what a system is (structure) and what it does (actions, flows, and states). Now we move to what the system must do: Requirement Definitions.
Being Fair to SysML v1 (and DOORS/ReqIF)
SysML v1 didn't lack requirements support. It gave teams mature, auditable traceability («satisfy», «verify», «deriveReqt», «refine», «copy»), containment hierarchies, coverage matrices, and over a decade of refined DOORS and ReqIF integration.
The limitation wasn't traceability—it was what lived inside the requirement. A classic v1 requirement like id: REQ-001 / text: "The vehicle shall not exceed 5000 kg at takeoff." is crystal clear to a human, but opaque to the model. Finding every requirement with a mass limit above 4,000 kg meant searching text and reading sentences; updating that threshold meant manually checking every dependent calculation.
The v2 Shift: RequirementDefinition Is a ConstraintDefinition
In SysML v2, a requirement can still carry its human-readable doc text and stable contract ID (as a short name like <'REQ-001'>), but it also embeds typed thresholds, an explicit subject**, and an evaluable** require constraint:
package MassRequirements {
private import ISQ::*;
private import SI::*;
part def LaunchVehicle {
attribute totalMass: MassValue;
}
requirement def <'REQ-001'> MaxTakeoffMass {
doc /*
* The vehicle shall not exceed the specified
* takeoff mass under any loading configuration.
*/
subject vehicle: LaunchVehicle;
attribute maxMass: MassValue = 5000 [kg];
require constraint {
vehicle.totalMass <= maxMass
}
}
}Because maxMass is a typed quantity (5000 [kg]) and the rule is a formal constraint, tools can natively query mass thresholds across the model, evaluate compliance against the design, and propagate limit changes automatically.
Reuse Without Copy-Paste (subject + :>>)
In SysML v1, «copy» created a read-only mirror of a master requirement's text—useful for alignment, but you couldn't swap in different budgets for different subsystems without authoring separate requirements.
In SysML v2, declaring a typed subject lets you define a rule once and reuse it across multiple parts with different allocated values via redefinition (:>>):
part def PhysicalComponent {
attribute actualMass: MassValue;
}
requirement def MassBudgetCompliance {
subject component: PhysicalComponent;
attribute allocatedMass: MassValue;
require constraint {
component.actualMass <= allocatedMass
}
}
part def LaunchVehicle {
part firstStage: PhysicalComponent;
part secondStage: PhysicalComponent;
part payload: PhysicalComponent;
requirement stage1Mass: MassBudgetCompliance {
subject = firstStage;
:>> allocatedMass = 3200 [kg];
}
requirement stage2Mass: MassBudgetCompliance {
subject = secondStage;
:>> allocatedMass = 1400 [kg];
}
requirement payloadMass: MassBudgetCompliance {
subject = payload;
:>> allocatedMass = 400 [kg];
}
}Three Practical Details Worth Knowing
- Native
actorandstakeholderroles: Instead of tracking authorities and users in external spreadsheets, you can declareactor(who interacts with the subject) andstakeholder(who has an interest in the requirement, like aCertificationAuthority) directly on the requirement and filter by them automatically. - Qualitative requirements stay text: Not everything is a Boolean expression (e.g., "The system shall be maintainable by a technician with standard tooling"). Those stay cleanly in the
docblock alongside theirsubjectand metadata, versioned with the model. - Honest tooling reality: SysML v1 still has the edge in mature DOORS and ReqIF ecosystems, while v2 requirements-management tooling is still younger.
SysML v1 vs. SysML v2 at a Glance
| Topic | SysML v1 | SysML v2 |
|---|---|---|
| Requirement Element | «requirement» stereotype on a Class | requirement def, based on ConstraintDefinition |
| Thresholds | Embedded inside the text sentence | Typed quantities (e.g., 5000 [kg]) |
| Subject | Named in text, linked later via «satisfy» | Explicitly declared as a typed subject |
| Reuse | «copy» mirrors read-only text | One definition reused with different subjects and :>> values |
| Roles | Stakeholders tied to viewpoints, not requirements | actor and stakeholder declared directly on the requirement |
| Identifiers | id property | Short name (e.g., <'REQ-001'>) |
| Tool Ecosystem | Mature DOORS / ReqIF support | Requirements-management tooling is still younger |
Next lesson (Lesson 27), we'll cover require and assume—how to formally state the operating conditions under which a requirement actually applies.
Curious to hear from the practitioners here: On your current programs, what percentage of your requirements could realistically be expressed as evaluable constraints vs. qualitative text—and is DOORS/ReqIF integration still the main blocker keeping your team on v1?