Holarch
فصول الدورة

التدريب · المسار 9. أساسيات SysML v2 · الفصل 9.6 من 8

9.6 التحقق والتتبع 3:32

اكتب حالات تحقق، واقرأ RVTM، وتتبّع خطوة في المصفوفة، واشتق متطلبًا.

يعرض Holarch 2.22.

→ 9.5 المتطلبات · كل الفصول · 9.7 القيود والحسابات ←

ما ستتعلمه

  • اكتب تعريف تحقق بهدف وحكم، وطبّقه على موضوع
  • سجّل خطوة ونتيجة في صفحة «حالات التحقق»
  • اقرأ حالات التحقق من متطلب ووضعه في RVTM
  • تتبّع متطلبًا إلى إجراء في مصفوفة التتبع
  • اشتق متطلبًا من آخر بوصلة Derivation

تحقق من متطلبات SysML v2 وتتبّعها في Holarch، باتباع البرنامج التعليمي Verification and Traceability الخاص بـ SysML v2 على مشروع 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. في objective massObjective { verify carSpec.sedanMass; }، ماذا يقول verify، وأين تراه؟
  2. ما الفرق بين حكم حالة التحقق والوضع في صفحة «حالات التحقق»؟
  3. متى تستخدم satisfy، ومتى Derivation؟
  4. ماذا يحدث عندما تختار satisfied by في خلية من مصفوفة التتبع؟
إظهار الإجابات
  1. في objective massObjective { verify carSpec.sedanMass; }، ماذا يقول verify، وأين تراه؟

    أن حالة التحقق هذه تتحقق من المتطلب 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.