Holarch
Главы курса

Обучение · Курс 9. Основы SysML v2 · Глава 9.6 из 8

9.6 Верификация и прослеживаемость 3:32

Запишите варианты верификации, прочитайте RVTM, проследите шаг в матрице и выведите производное требование.

Показан Holarch 2.22.

← 9.5 Требования · Все главы · 9.7 Ограничения и вычисления →

Чему вы научитесь

  • Записывать определение верификации с целью и вердиктом и применять его к субъекту
  • Записывать шаг и результат на странице «Варианты верификации»
  • Читать в 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).

  1. Откройте свой демо-проект Hybrid Car (при необходимости создайте его: Управление проектами → Файлы проекта ▾ → Новый демо-проект → Hybrid Car (SysML v2)), откройте Модель → Редактор и пакет VehicleRequirements.
  2. После 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; }.
  3. Откройте Верификация → Варианты верификации. В строке нового варианта нажмите + Шаги, затем + Добавить шаг, введите Weigh the battery on a bench scale в столбце Действие, нажмите Применить и нажмите Пройдено среди кнопок статуса.
  4. Откройте Верификация → RVTM и найдите VR-6 batteryMassLimit с новым вариантом и его статусом.
  5. Откройте Верификация → Матрица прослеживаемости, покажите требования в строках, а класс Действие в столбцах, щёлкните ячейку на пересечении sedanAcceleration и accelerate и выберите satisfied by.
  6. В конце пакета добавьте 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, а строка состояния не сообщает о проблемах.

Проверьте себя

  1. Что говорит verify в objective massObjective { verify carSpec.sedanMass; } и где это видно?
  2. Чем вердикт варианта верификации отличается от статуса на странице «Варианты верификации»?
  3. Когда используется satisfy, а когда Derivation?
  4. Что происходит, когда вы выбираете satisfied by в ячейке матрицы прослеживаемости?
Показать ответы
  1. Что говорит verify в objective massObjective { verify carSpec.sedanMass; } и где это видно?

    Что этот вариант верификации верифицирует требование sedanMass. RVTM показывает вариант напротив этого требования.

  2. Чем вердикт варианта верификации отличается от статуса на странице «Варианты верификации»?

    Вердикт — часть модели: выражение, здесь — укладывается ли снаряжённая масса в предел. Шаги, результаты и статус прогона теста — данные Holarch, хранящиеся рядом с моделью.

  3. Когда используется satisfy, а когда Derivation?

    satisfy говорит, что элемент проекта, например часть или действие, удовлетворяет требованию. Derivation связывает исходное требование с производным от него; для неё нужен private import RequirementDerivation::*;.

  4. Что происходит, когда вы выбираете 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.