Holarch
فصول الدورة

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

9.5 المتطلبات 4:15

اكتب متطلبات قابلة للفحص، وضعها متداخلة في مواصفة، وشاهد متطلبًا غير مستوفى.

يعرض Holarch 2.22.

ما ستتعلمه

  • سمِّ حدود المتطلبات كسمات بوحدات
  • اكتب تعريف متطلب برقم وعبارة وموضوع وقيد require
  • ضع استخدامات المتطلبات متداخلة في مواصفة وأعطها حدودها الخاصة باستخدام `:>>`
  • حدّد ما الذي يستوفي متطلبًا، واقرأ علامة المحرر عندما لا يستوفيه التصميم
  • افحص عبارات المتطلبات في صفحة «الجودة»

اكتب متطلبات SysML v2 في Holarch، باتباع البرنامج التعليمي Requirements الخاص بـ SysML v2 على مشروع Hybrid Car صغير: حدود مسمّاة، وتعريفات متطلبات برقم وعبارة وموضوع وقيد require، والإدراج، ومواصفة بمتطلبات متداخلة، و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. بعد attribute minElectricRange، أضف attribute minTopSpeed : SpeedValue = 180 [km/h];.
  3. تحت requirement def <'VR-5'> ChargeTime، اختر إدراج ▾ ← تعريف متطلب واكتب <'VR-8'> TopSpeed مع العبارة The sports car shall reach at least the minimum top speed.، والموضوع car : SportCar وrequire constraint { car.topSpeed >= minTopSpeed }.
  4. بعد أسطر satisfy الأخرى، أضف satisfy requirement roadsterSpeed : TopSpeed by fleet.roadster;.
  5. غيّر minTopSpeed إلى 220 [km/h]. أشر إلى العلامة التي يضعها المحرر على satisfy لتقرأ القيم التي قارنها، ثم اضغط ⌘Z / Ctrl+Z.
  6. افتح الاحتياجات والمتطلبات ← المتطلبات واعثر على VR-8، ثم افتح الاحتياجات والمتطلبات ← الجودة وانقر فحص الجودة.

تكون قد انتهيت عندما يكون VR-8 في جدول المتطلبات، ولا تكون على satisfy علامة عند 180 km/h، ويكون «فحص الجودة» قد قيّم عبارته.

اختبر نفسك

  1. لماذا تُبقي الحدود مثل maxCurbMass كسمات مسمّاة بدلًا من كتابة الرقم في كل قيد؟
  2. في requirement <'VR-1.1'> sedanMass : CurbMass { attribute :>> limit = maxCurbMass; }، ماذا يفعل :>>؟
  3. ما الذي يتيح satisfy carSpec by fleet.sedan; لـ Holarch فحصه؟
  4. تضبط حالة متطلب وأولويته في صفحة «المتطلبات». هل يتغير نص SysML؟
إظهار الإجابات
  1. لماذا تُبقي الحدود مثل maxCurbMass كسمات مسمّاة بدلًا من كتابة الرقم في كل قيد؟

    كل متطلب يستخدم الاسم يتبع تعديلًا واحدًا، ويحمل الحد وحدته، فيقارن المدقق القيم بالوحدات.

  2. في requirement <'VR-1.1'> sedanMass : CurbMass { attribute :>> limit = maxCurbMass; }، ماذا يفعل :>>؟

    يعيد تعريف السمة limit التي يرثها sedanMass من CurbMass، فيعطي هذا الاستخدام قيمته الخاصة.

  3. ما الذي يتيح satisfy carSpec by fleet.sedan; لـ Holarch فحصه؟

    ما إذا كانت قيم السيدان تستوفي قيود carSpec. فإذا تجاوزت كتلة السيدان الفارغة الحد، يعلّم المحرر satisfy ويعرض القيم المقارنة.

  4. تضبط حالة متطلب وأولويته في صفحة «المتطلبات». هل يتغير نص 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.