Course chapters
Training · Track 9. SysML v2 Fundamentals · Chapter 9.5 of 8
9.5 Requirements 4:15
Write checkable requirements, nest them in a specification, and see one that is not met.
Shows Holarch 2.22.
What you’ll learn
- Name requirement limits as attributes with units
- Write a requirement definition with a number, a statement, a subject and a require constraint
- Nest requirement usages in a specification and give them their own limits with `:>>`
- Say what satisfies a requirement, and read the Editor's mark when the design does not meet it
- Check requirement statements on the Quality page
Write SysML v2 requirements in Holarch, following the SysML v2 tutorial Requirements on a small Hybrid Car project: named limits, requirement definitions with a number, a statement, a subject and a require constraint, Insert, a specification with nested requirements, satisfy, a requirement the sedan no longer meets, the requirements table, a Requirement View and the quality check. SysML is a registered trademark of Object Management Group, Inc.
Project files
- Finished project (.holarch.json; Manage Projects → Project Files ▾ → Import Project (.json)…)
The video plays from holarch.app; see the Privacy Policy.
Practice
Do this yourself in Holarch, on the Hybrid Car demo project (SysML v2).
- Open your Hybrid Car demo project (create it if needed: Manage Projects → Project Files ▾ → New Demo Project → Hybrid Car (SysML v2)), open Model → Editor and the package
VehicleRequirements. - After
attribute minElectricRange, addattribute minTopSpeed : SpeedValue = 180 [km/h];. - Below
requirement def <'VR-5'> ChargeTime, choose Insert ▾ → Requirement Definition and write<'VR-8'> TopSpeedwith the statementThe sports car shall reach at least the minimum top speed., the subjectcar : SportCarandrequire constraint { car.topSpeed >= minTopSpeed }. - After the other
satisfylines, addsatisfy requirement roadsterSpeed : TopSpeed by fleet.roadster;. - Change
minTopSpeedto220 [km/h]. Point at the mark the Editor puts on the satisfy to read the values it compared, then press ⌘Z / Ctrl+Z. - Open Needs & Requirements → Requirements and find VR-8, then open Needs & Requirements → Quality and click Check Quality.
You're done when VR-8 is in the Requirements table, the satisfy has no mark at 180 km/h, and Check Quality has scored its statement.
Check yourself
- Why keep limits such as
maxCurbMassas named attributes instead of writing the number in each constraint? - In
requirement <'VR-1.1'> sedanMass : CurbMass { attribute :>> limit = maxCurbMass; }, what does:>>do? - What does
satisfy carSpec by fleet.sedan;let Holarch check? - You set a requirement's Status and Priority on the Requirements page. Does the SysML text change?
Show the answers
Why keep limits such as
maxCurbMassas named attributes instead of writing the number in each constraint?Every requirement that uses the name follows one edit, and the limit carries its unit, so the checker compares values with units.
In
requirement <'VR-1.1'> sedanMass : CurbMass { attribute :>> limit = maxCurbMass; }, what does:>>do?It redefines the
limitattribute that sedanMass inherits from CurbMass, giving this usage its own value.What does
satisfy carSpec by fleet.sedan;let Holarch check?Whether the sedan's values meet the constraints of carSpec. If the sedan's curb mass exceeds the limit, the Editor marks the satisfy and shows the compared values.
You set a requirement's Status and Priority on the Requirements page. Does the SysML text change?
No. Status, priority and verification method are Holarch data kept next to the model; they never change the text.
Read more
Transcript
Show the transcript (narration and what is on screen)
Introduction
Chapter five: requirements. In SysML v2 a requirement can carry a constraint, so the model can check whether a design meets it.
In this chapter you write limits and requirement definitions, nest requirements in a specification, say what satisfies them, and see a requirement that is not met.
Start the tutorial
Start the tutorial Requirements from Project Files, Start a Tutorial. Its starter project holds a small copy of the design: a battery, a car, and a fleet with a sedan of fifteen hundred eighty kilograms.
On screen: Project Files ▾ → Start a Tutorial… → SysML v2: Requirements → Start; Model → Editor.
Requirement definitions
Keep limits as named values, so one edit updates every requirement that uses them. After the requirements comment, add the maximum curb mass and the minimum battery capacity.
On screen: After // ---- Requirements ----: maxCurbMass and minBatteryCapacity.
Below the limits, write the first requirement definition. V R one is its number, doc is its statement, subject is what it is about, and require constraint makes it checkable: Holarch evaluates it with units.
On screen: Below the limits: requirement def <'VR-1'> CurbMass.
Insert
Insert writes the frame of a construct for you. Below the curb mass requirement, open Insert and choose Requirement Definition. Type its number and name, then press Tab to move to the subject, its type and the statement.
On screen: Insert ▾ (open on camera) → Requirement Definition; <'VR-3'> BatteryCapacity, Tab, battery, Tab, Battery, Tab, statement.
Then give it its constraint: the battery's capacity is at least the minimum.
On screen: After the doc line: require constraint { battery.capacity >= minBatteryCapacity }
Specification and satisfy
A specification holds the sedan's requirements. Each one is a usage of a definition, and the symbol after attribute redefines the limit with the sedan's own value.
On screen: After BatteryCapacity: requirement carSpec with sedanMass : CurbMass.
Now say what satisfies them. The sedan of the fleet satisfies the car specification, and a named satisfy says that the sedan's battery satisfies the battery capacity requirement.
On screen: After carSpec: satisfy carSpec by fleet.sedan; satisfy requirement batterySpec …
Break a requirement on purpose. In the fleet, change the sedan's curb mass from fifteen hundred eighty to seventeen hundred kilograms.
On screen: In fleet: curbMass = 1580 → 1700.
The Editor marks the satisfy: the sedan no longer meets V R one point one. Point at the mark to read the values it compared.
On screen: The mark on the satisfy; its information card.
Change it back, or press Command Z, and the mark clears.
On screen: curbMass = 1700 → 1580; No problems.
Pages on the model
The requirements pages work on the model. Open Needs and Requirements, then Requirements. The model's requirements are the rows, numbered by their short names. Status, priority and verification method are Holarch data next to the model; they never change the text.
On screen: Needs & Requirements → Requirements.
Open the Diagrams page, click New Diagram, and choose Requirement View. Choose the car specification under Shows, and click Create: the specification as a tree, with what satisfies it.
On screen: Diagrams → + New Diagram → Requirement View; Shows: VehicleRequirements::carSpec; Create.
Last, open Needs and Requirements, then Quality, and click Check Quality. Each requirement's statement is scored on the quality criteria, as in an LML project.
On screen: Needs & Requirements → Quality → Check Quality.
Recap
Every step is ticked off. Click Mark as Done.
On screen: Step panel → Mark as Done.
Let's recap. You named the limits, wrote requirement definitions with a number, a statement, a subject and a constraint, used Insert, nested requirements in a specification, said what satisfies them, and saw the Editor mark a requirement that was not met.
Next, verification cases check these requirements, and the matrix traces them.