תרשים דרישות
תרשים דרישות מספק ייצוג חזותי של דרישות, קשרי החיבור ביניהן, והיחסים שלהן עם רכיבים אחרים במסמך.
העתק
הטמעה
requirementDiagram
requirement test_req {
id: 1
text: the test text.
risk: high
verifymethod: test
}
element test_entity {
type: simulation
}
test_entity - satisfies -> test_req
תחביר
תרשים דרישות מכיל שלושה רכיבים: דרישות, רכיבים ויחסים.
מילים המיוצגות בסוגריים מזוויות הן מילות מפתח של מונים (enums), כגון , שאפשרויותיהן מפורטות בטבלה. user_defined... משמש בכל מקום הדורש קלט מהמשתמש.
הערה חשובה לגבי טקסט משתמש: כל הקלט יכול להיות עטוף במרכאות כפולות או ללא מרכאות כפולות. עם זאת, המשתמש חייב להיזהר בעת שימוש בקלט ללא מרכאות. אם מזוהות מילות מפתח אחרות, העורך ייכשל ברינדור.
דרישה
הגדרת דרישה כוללת סוג דרישה, שם, ID, טקסט, סיכון ושיטת אימות. התחביר הוא כדלקמן:
העתק
הטמעה
<type> user_defined_name {
id: user_defined_id
text: user_defined text
risk: <risk>
verifymethod: <method>
}
type, risk ו-method הם מונים המוגדרים ב-SysML.
| מילת מפתח | אפשרויות |
|---|---|
| סוג | דרישה, דרישה פונקציונלית, דרישת ממשק, דרישת ביצועים, דרישה פיזית, אילוץ עיצובי |
| סיכון | נמוך, בינוני, גבוה |
| שיטת אימות | ניתוח, בדיקה, בחינה, הדגמה |
רכיב
הגדרת רכיב כוללת שם רכיב, type והפניה למסמך, ושלושתם מוגדרים על ידי המשתמש. תכונת הרכיב נועדה להישאר קלת-משקל, ובמקביל לאפשר קישור דרישות לחלקים אחרים של מסמכים.
העתק
הטמעה
element myElement {
type: string
docref: some/doc/path
}
תחביר Markdown
במקומות המאפשרים למשתמש להתאים אישית טקסט (כגון שמות, טקסט דרישה, הפניות למסמכים של רכיבים וכדומה), ניתן:
- לעטוף את הטקסט במרכאות כפולות
- להשתמש בפורמט markdown בתוך המרכאות הכפולות
העתק
הטמעה
requirementDiagram
requirement "__test_req__" {
id: 1
text: "*italicized text* **bold text**"
risk: high
verifymethod: test
}
יחס
יחס מורכב מצומת מקור, צומת יעד וסוג היחס.
יש לפעול לפי פורמט ההגדרה שלהלן:
העתק
הטמעה
{name of source} - <type> -> {name of destination}
או
העתק
הטמעה
{name of destination} <- <type> - {name of source}
"צומת המקור" ו-"צומת היעד" צריכים להיות שמות של צומתי דרישה או רכיב המוגדרים במקום אחר.
סוג היחס יכול להיות אחד מהבאים: contains, copies, derives, satisfies, verifies, refines או traces.
דוגמה מפורטת
דוגמה זו משתמשת בכל התכונות של תרשים זה.
העתק
הטמעה
requirementDiagram
requirement test_req {
id: 1
text: the test text.
risk: high
verifymethod: test
}
functionalRequirement test_req2 {
id: 1.1
text: the second test text.
risk: low
verifymethod: inspection
}
performanceRequirement test_req3 {
id: 1.2
text: the third test text.
risk: medium
verifymethod: demonstration
}
interfaceRequirement test_req4 {
id: 1.2.1
text: the fourth test text.
risk: medium
verifymethod: analysis
}
physicalRequirement test_req5 {
id: 1.2.2
text: the fifth test text.
risk: medium
verifymethod: analysis
}
designConstraint test_req6 {
id: 1.2.3
text: the sixth test text.
risk: medium
verifymethod: analysis
}
element test_entity {
type: simulation
}
element test_entity2 {
type: word doc
docRef: reqs/test_entity
}
element test_entity3 {
type: "test suite"
docRef: github.com/all_the_tests
}
test_entity - satisfies -> test_req2
test_req - traces -> test_req2
test_req - contains -> test_req3
test_req3 - contains -> test_req4
test_req4 - derives -> test_req5
test_req5 - refines -> test_req6
test_entity3 - verifies -> test_req5
test_req <- copies - test_entity2
כיוון
ניתן להשתמש בהצהרת direction כדי לרנדר את התרשים בכיוונים שונים; הערכים החוקיים הם:
- TB - מלמעלה למטה (ברירת מחדל)
- BT - מלמטה למעלה
- LR - משמאל לימין
- RL - מימין לשמאל
העתק
הטמעה
requirementDiagram
direction LR
requirement test_req {
id: 1
text: the test text.
risk: high
verifymethod: test
}
element test_entity {
type: simulation
}
test_entity - satisfies -> test_req
סגנון
ניתן לעצב דרישות ורכיבים באמצעות סגנון ישיר או מחלקות. באופן כללי, בעת החלת סגנון או מחלקה, הם מקבלים רשימה של שמות דרישות או רכיבים ורשימה של שמות מחלקות, ובכך מאפשרים הקצאה של מספר מחלקות בבת אחת. היוצא מן הכלל היחיד הוא תחביר הקיצור :::, שבו האופרטור יכול להקצות מספר מחלקות, אך רק לדרישה אחת או לרכיב אחד בכל פעם.
סגנון ישיר
העתק
הטמעה
requirementDiagram
requirement test_req {
id: 1
text: styling example
risk: low
verifymethod: test
}
element test_entity {
type: simulation
}
style test_req fill:#ffa,stroke:#000, color: green
style test_entity fill:pink,stroke:#333, color: blue
הגדרת מחלקה מוצגת בדוגמה שלהלן:
שימוש ב-classDef להגדרת סגנון לשימוש חוזר:
העתק
הטמעה
requirementDiagram
requirement test_req {
id: 1
text: "class styling example"
risk: low
verifymethod: test
}
element test_entity {
type: simulation
}
classDef important fill:#f96,stroke:#333,stroke-width:4px
classDef test fill:#ffa,stroke:#000
מחלקת ברירת מחדל
אם מחלקה נקראת default, היא תוחל על כל הצמתים. יש להגדיר סגנונות ומחלקות ספציפיים לאחר מכן, כדי לעקוף את סגנון ברירת המחדל שהוחל.
העתק
הטמעה
classDef default fill:pink,stroke:#333,stroke-width:4px;
מחלקת יישום
ניתן להחיל מחלקות בשתי דרכים:
1. שימוש בתחביר class:
העתק
הטמעה
class test_req,test_entity important
2. שימוש בתחביר הקיצור של האופרטור ::: במהלך ההגדרה או אחריה:
העתק
הטמעה
requirement test_req:::important {
id: 1
text: class styling example
risk: low
verifymethod: test
}
העתק
הטמעה
element test_elem {}
test_elem:::myClass
דוגמת שילוב
העתק
הטמעה
requirementDiagram
requirement test_req:::important {
id: 1
text: "class styling example"
risk: low
verifymethod: test
}
element test_entity {
type: simulation
}
classDef important font-weight:bold
class test_entity important
style test_entity fill:pink,stroke:#333