פרקי הקורס
הדרכה · מסלול 9. יסודות SysML v2 · פרק 9.6 מתוך 8
9.6 אימות ועקיבות 3:32
כותבים מקרי אימות, קוראים את ה-RVTM, עוקבים אחרי שלב במטריצה וגוזרים דרישה.
מציג את Holarch 2.22.
מה תלמדו
- לכתוב הגדרת אימות עם מטרה ופסק דין, ולהחיל אותה על נושא
- לתעד שלב ותוצאה בדף “מקרי אימות”
- לקרוא ב-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).
- פותחים את פרויקט ההדגמה 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, והסטטוס מדווח שאין בעיות.
בדיקה עצמית
- ב-
objective massObjective { verify carSpec.sedanMass; }, מה אומרverify, והיכן רואים אותו? - מה ההבדל בין פסק הדין (verdict) של מקרה אימות לבין הסטטוס בדף “מקרי אימות”?
- מתי משתמשים ב-
satisfy, ומתי ב-Derivation? - מה קורה כשבוחרים satisfied by בתא של מטריצת עקיבות?
הצגת התשובות
ב-
objective massObjective { verify carSpec.sedanMass; }, מה אומרverify, והיכן רואים אותו?שמקרה האימות הזה מאמת את הדרישה sedanMass. ה-RVTM מציג את המקרה מול הדרישה הזו.
מה ההבדל בין פסק הדין (verdict) של מקרה אימות לבין הסטטוס בדף “מקרי אימות”?
פסק הדין הוא חלק מהמודל: ביטוי, כאן האם המסה הריקה בתוך המגבלה. שלבים, תוצאות והסטטוס של הרצת בדיקה הם נתוני 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.