コースのチャプター
トレーニング · トラック 9. SysML v2 の基礎 · チャプター 9.5(全 8 チャプター)
9.5 要求 4:15
チェック可能な要求を書き、仕様にまとめ、満たされていない要求を確認します。
Holarch 2.22 の画面です。
学習内容
- 要求の制限を単位付きの属性として名前を付ける
- 番号、文、対象、require 制約を持つ要求定義を記述する
- 要求使用を仕様の中に入れ子にし、`:>>` で独自の制限を与える
- 要求を満たすものを示し、設計が要求を満たさないときのエディターのマークを読む
- 品質ページで要求の文をチェックする
小さな Hybrid Car プロジェクトで SysML v2 チュートリアル「Requirements」に沿って、Holarch で SysML v2 の要求を記述します。名前付きの制限、番号・文・対象・require 制約を持つ要求定義、挿入、入れ子の要求を持つ仕様、satisfy、セダンが満たさなくなった要求、要求の表、要求ビュー、品質チェックを扱います。SysML は Object Management Group, Inc. の登録商標です。
プロジェクトファイル
- 完成したプロジェクト (.holarch.json。プロジェクトを管理 → プロジェクトファイル ▾ → プロジェクトをインポート (.json)…)
動画は holarch.app から再生されます。プライバシーポリシーをご覧ください。
演習
Hybrid Car デモプロジェクト(SysML v2)を使って、Holarch で実際に操作します。
- Hybrid Car デモプロジェクトを開き(必要に応じて作成します:プロジェクトを管理 → プロジェクトファイル ▾ → 新しいデモプロジェクト → Hybrid Car (SysML v2))、モデル → エディターとパッケージ
VehicleRequirementsを開きます。 attribute minElectricRangeの後にattribute minTopSpeed : SpeedValue = 180 [km/h];を追加します。requirement def <'VR-5'> ChargeTimeの下で 挿入 ▾ → 要求定義を選び、文The sports car shall reach at least the minimum top speed.、対象car : SportCar、require constraint { car.topSpeed >= minTopSpeed }を持つ<'VR-8'> TopSpeedを記述します。- 他の
satisfyの行の後にsatisfy requirement roadsterSpeed : TopSpeed by fleet.roadster;を追加します。 minTopSpeedを220 [km/h]に変更します。エディターが satisfy に付けたマークにポインターを合わせて比較された値を読み、⌘Z / Ctrl+Z を押します。- ニーズと要求 → 要求を開いて VR-8 を見つけ、次にニーズと要求 → 品質を開いて品質をチェックをクリックします。
VR-8 が要求の表にあり、180 km/h で satisfy にマークがなく、品質チェックがその文にスコアを付けていれば完了です。
確認問題
maxCurbMassのような制限を、各制約に数値を書く代わりに名前付きの属性として保持するのはなぜですか?requirement <'VR-1.1'> sedanMass : CurbMass { attribute :>> limit = maxCurbMass; }で、:>>は何をしますか?satisfy carSpec by fleet.sedan;によって、Holarch は何をチェックできますか?- 要求ページで要求の Status と Priority を設定します。SysML のテキストは変わりますか?
解答を表示
maxCurbMassのような制限を、各制約に数値を書く代わりに名前付きの属性として保持するのはなぜですか?その名前を使うすべての要求が 1 回の編集に追従し、制限は単位を持つため、チェッカーは単位付きで値を比較します。
requirement <'VR-1.1'> sedanMass : CurbMass { attribute :>> limit = maxCurbMass; }で、:>>は何をしますか?sedanMass が CurbMass から継承する
limit属性を再定義し、この使用に独自の値を与えます。satisfy carSpec by fleet.sedan;によって、Holarch は何をチェックできますか?セダンの値が carSpec の制約を満たしているかどうかです。セダンの車両重量が制限を超えると、エディターは satisfy にマークを付け、比較した値を表示します。
要求ページで要求の Status と Priority を設定します。SysML のテキストは変わりますか?
いいえ。ステータス、優先度、検証方法はモデルの横に保持される Holarch のデータで、テキストを変更することはありません。
関連資料
トランスクリプト
トランスクリプトを表示 (ナレーションと画面の内容)
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.