Розділи курсів
Навчання · Курс 9. Основи SysML v2 · Розділ 9.6 з 8
9.6 Верифікація та простежуваність 3:32
Пишіть випадки верифікації, читайте RVTM, простежуйте крок у матриці й виводьте вимогу.
Показано Holarch 2.22.
Що ви дізнаєтеся
- Написати визначення верифікації з метою й вердиктом і застосувати його до суб’єкта
- Записати крок і результат на сторінці «Випадки верифікації»
- Прочитати в RVTM випадки, що верифікують вимогу, та її статус
- Простежити вимогу до дії в Матриці простежуваності
- Вивести одну вимогу з іншої через з’єднання Derivation
Верифікуйте й простежуйте вимоги SysML v2 у Holarch за навчальним посібником SysML v2 Verification and Traceability на невеликому проєкті Hybrid Car: визначення верифікації, мета якого верифікує вимогу, використання верифікації, застосоване до седана, сторінка «Випадки верифікації» та RVTM, satisfy, створений у Матриці простежуваності, виведення між вимогами й перевірки моделі. SysML є зареєстрованою торговельною маркою Object Management Group, Inc.
Файли проєкту
- Готовий проєкт (.holarch.json; Керування проєктами → Файли проєкту ▾ → Імпортувати проєкт (.json)…)
Відео відтворюється з holarch.app; див. Політику конфіденційності.
Практика
Виконайте це самі в Holarch на демопроєкті Hybrid Car (SysML v2).
- Відкрийте свій демопроєкт Hybrid Car (за потреби створіть його: Керування проєктами → Файли проєкту ▾ → Новий демопроєкт → Hybrid Car (SysML v2)), відкрийте Модель → Редактор і пакет
VehicleRequirements. - Після
verification <'VC-1.1'> sedanWeighingдодайтеverification def <'VC-2'> BatteryWeighing { subject battery : Battery; objective { verify batteryMassLimit; } return verdict : Boolean = battery.mass <= 50 [kg]; }іverification <'VC-2.1'> sedanBatteryWeighing : BatteryWeighing { subject battery = fleet.sedan.powertrain.battery; }. - Відкрийте Верифікація → Випадки верифікації. У рядку нового випадку натисніть + Кроки, потім + Додати крок, введіть
Weigh the battery on a bench scaleу Дія, натисніть Застосувати і натисніть Пройдено серед кнопок статусу. - Відкрийте Верифікація → RVTM і знайдіть VR-6
batteryMassLimitз новим випадком і його статусом. - Відкрийте Верифікація → Матриця простежуваності, покажіть вимоги як рядки, а клас Дія як стовпці, натисніть клітинку на перетині
sedanAccelerationіaccelerateй оберіть satisfied by. - Наприкінці пакета додайте
requirement <'VR-9'> tankVolume { doc /* The fuel tank shall hold at least 40 L. */ subject tank : FuelTank; }іconnection tankDerivation : Derivation connect carSpec.sedanRange to tankVolume;. Потім відкрийте Верифікація → Перевірки моделі.
Завдання виконано, коли RVTM показує новий випадок для VR-6 як пройдений, Редактор містить новий satisfy і tankDerivation, а рядок стану не повідомляє про проблеми.
Перевірте себе
- Що означає
verifyвobjective massObjective { verify carSpec.sedanMass; }і де це видно? - Чим відрізняється вердикт випадку верифікації від статусу на сторінці «Випадки верифікації»?
- Коли використовувати
satisfy, а коли —Derivation? - Що відбувається, коли ви обираєте satisfied by у клітинці Матриці простежуваності?
Показати відповіді
Що означає
verifyвobjective massObjective { verify carSpec.sedanMass; }і де це видно?Що цей випадок верифікації верифікує вимогу sedanMass. RVTM показує випадок навпроти цієї вимоги.
Чим відрізняється вердикт випадку верифікації від статусу на сторінці «Випадки верифікації»?
Вердикт є частиною моделі: це вираз, тут — чи споряджена маса в межах ліміту. Кроки, результати й статус виконання тесту — це дані Holarch, які зберігаються поруч із моделлю.
Коли використовувати
satisfy, а коли —Derivation?satisfyозначає, що елемент проєкту, як-от частина чи дія, відповідає вимозі. Derivation з’єднує початкову вимогу з вимогою, виведеною з неї; для неї потрібенprivate import RequirementDerivation::*;.Що відбувається, коли ви обираєте satisfied by у клітинці Матриці простежуваності?
Holarch записує
satisfyу текст SysML, тож трасування стає частиною моделі й видно в Редакторі.
Докладніше
Стенограма
Показати стенограму (озвучення і те, що на екрані)
Introduction
Chapter six: verification and traceability. A verification case says how a requirement is checked, and traceability shows what connects to what.
In this chapter you write a verification case and apply it to the sedan, check the RVTM, trace a step to a requirement in the matrix, and derive a requirement.
Start the tutorial
Start the tutorial Verification and Traceability from Project Files, Start a Tutorial. Its starter project holds the curb mass requirement and the car specification, a short drive cycle, and two more requirements: a battery mass limit and stopping from cruise.
On screen: Project Files ▾ → Start a Tutorial… → SysML v2: Verification and Traceability → Start; Model → Editor.
Verification cases
After the verification comment, write the verification definition. Its objective names the requirement it verifies, and its verdict passes when the curb mass is within the limit.
On screen: After // ---- Verification ----: verification def <'VC-1'> CurbMassTest.
Below it, apply it to the sedan: a verification usage that weighs the sedan of the fleet.
On screen: Below it: verification <'VC-1.1'> sedanWeighing : CurbMassTest.
Open Verification, then Verification Cases. The model's verification cases are the test cases here. Steps, results and status are Holarch data next to the model, kept on this page.
On screen: Verification → Verification Cases; the Sedan Weighing row.
In the Sedan Weighing row, click Steps, then Add Step. Type weigh the car as the action, and click Apply.
On screen: + Steps → + Add Step; Action: Weigh the car; Apply.
Then set the result: click Passed in its status buttons.
On screen: Status buttons → Passed.
Open the RVTM. Each requirement is listed with its verification method, the cases that verify it, and their status.
On screen: Verification → RVTM.
Traceability
Now trace a step to a requirement. Open the Traceability Matrix. Its rows are the requirements; open Columns, and choose the class Action.
On screen: Verification → Traceability Matrix; rows: Requirement; Columns: class Action; Done.
Click the cell where stop from cruise meets the brake step, and choose satisfied by. Holarch writes a satisfy into the text.
On screen: Cell stopFromCruise × brake → satisfied by.
In the Editor, the satisfy is there. To derive a requirement, first import the requirement derivation package after the other imports.
On screen: Model → Editor: the new satisfy; import RequirementDerivation.
Then, at the end of the package, connect the sedan's mass requirement to the battery mass limit with a derivation: the battery limit is derived from the curb mass requirement.
On screen: After sedanWeighing: connection batteryMassDerivation : Derivation connect carSpec.sedanMass to batteryMassLimit;
Last, open Verification, then Model Checks. Rules run over the whole model, for example requirements without a satisfy or a verify, and each finding links to its element.
On screen: Verification → Model Checks.
Recap
Every step is ticked off. Click Mark as Done.
On screen: Step panel → Mark as Done.
Let's recap. You wrote a verification case with an objective and a verdict, applied it to the sedan, opened the Verification Cases and the RVTM, traced a step to a requirement in the matrix, and derived one requirement from another.
Next, constraints and calculations evaluate the sedan's values.