Dayagram ng pangangailangan
Ang requirement diagram ay nagbibigay ng visualization ng mga requirement at ang mga koneksyon sa pagitan nila, gayundin ang mga relasyon sa ibang elemento ng dokumento.
Kopyahin
Embed
requirementDiagram
requirement test_req {
id: 1
text: the test text.
risk: high
verifymethod: test
}
element test_entity {
type: simulation
}
test_entity - satisfies -> test_req
Syntax
Ang requirement diagram ay naglalaman ng tatlong component: requirement, element, at relasyon.
Ang salita na kinakatawan ng angle brackets ay enumeration keyword, tulad ng , ang mga opsyon nito ay detalyadong ipinaliwanag sa talahanayan. Ang user_defined... ay ginagamit saanman kailangan ng input ng user.
Mahalagang tala tungkol sa user text: ang lahat ng input ay maaaring napapalibutan ng double quotes, o walang double quotes. Gayunpaman, kailangang mag-ingat ang user kapag gumagamit ng input na walang quotes. Kung may matukoy na ibang keyword, mabibigo ang rendering ng editor.
Requirement
Ang requirement definition ay naglalaman ng uri ng requirement, pangalan, ID, teksto, risk, at verification method. Ang syntax ay ang sumusunod:
Kopyahin
Embed
<type> user_defined_name {
id: user_defined_id
text: user_defined text
risk: <risk>
verifymethod: <method>
}
Ang type, risk, at method ay enumeration na tinukoy sa SysML.
| Keyword | Option |
|---|---|
| Uri | Requirement, functional requirement, interface requirement, performance requirement, physical requirement, design constraint |
| Risk | Low, medium, high |
| Verification method | Analysis, inspection, test, demonstration |
Element
Ang element definition ay naglalaman ng pangalan ng elemento, type, at dokumento reference, ang tatlong ito ay tinutukoy ng user. Ang element feature ay dinisenyo upang manatiling lightweight, habang pinapayagan ang pag-uugnay ng requirement sa bahagi ng nilalaman ng ibang dokumento.
Kopyahin
Embed
element myElement {
type: string
docref: some/doc/path
}
Markdown format
Sa mga lugar kung saan pinapayagan ang user na mag-customize ng teksto (tulad ng pangalan, requirement text, element document reference, atbp.), maaari mong:
- Ilagay ang teksto sa loob ng double quotes
- Gumamit ng markdown format sa loob ng double quotes
Kopyahin
Embed
requirementDiagram
requirement "__test_req__" {
id: 1
text: "*italicized text* **bold text**"
risk: high
verifymethod: test
}
Relasyon
Ang relasyon ay binubuo ng source node, target node, at uri ng relasyon.
Sumusunod sa sumusunod na definition format:
Kopyahin
Embed
{name of source} - <type> -> {name of destination}
o
Kopyahin
Embed
{name of destination} <- <type> - {name of source}
Ang "source node" at "target node" ay dapat na pangalan ng requirement o element node na tinukoy sa ibang lugar.
Ang uri ng relasyon ay maaaring isa sa contains, copies, derives, satisfies, verifies, refines, o traces.
Detalyadong halimbawa
Ginagamit ng halimbawang ito ang lahat ng feature ng chart.
Kopyahin
Embed
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
Direksyon
Maaaring gamitin ang direction statement upang itakda ang iba't ibang direksyon ng rendering ng chart, ang mga valid na halaga ay:
- TB - Mula itaas pababa (default)
- BT - Mula ibaba pataas
- LR - Mula kaliwa pakanan
- RL - Mula kanan pakaliwa
Kopyahin
Embed
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
Estilo
Ang requirement at element ay maaaring lagyan ng estilo gamit ang direct na estilo o class. Sa pangkalahatan, kapag nag-aaplay ng estilo o class, tumatanggap ito ng listahan ng pangalan ng requirement o element at listahan ng class name, na nagpapahintulot na magtalaga ng maraming class nang sabay. Ang tanging exception ay ang shorthand syntax :::, ang operator ay maaaring magtalaga ng maraming class, ngunit isang requirement o element lamang sa isang pagkakataon.
Direct na estilo
Kopyahin
Embed
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
Ang class definition ay tulad ng ipinapakita sa sumusunod na halimbawa:
Gamitin ang classDef upang tukuyin ang muling magagamit na estilo:
Kopyahin
Embed
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 na class
Kung pinangalanan ang isang class na default, ilalapat ito sa lahat ng node. Ang mga partikular na estilo at class ay dapat tukuyin pagkatapos nito, upang i-override ang nailapat na default na estilo.
Kopyahin
Embed
classDef default fill:pink,stroke:#333,stroke-width:4px;
Application class
Ang class ay maaaring ilapat sa dalawang paraan:
1. Gamitin ang class syntax:
Kopyahin
Embed
class test_req,test_entity important
2. Gamitin ang operator ::: shorthand syntax sa panahon o pagkatapos ng depinisyon:
Kopyahin
Embed
requirement test_req:::important {
id: 1
text: class styling example
risk: low
verifymethod: test
}
Kopyahin
Embed
element test_elem {}
test_elem:::myClass
Halimbawa ng kombinasyon
Kopyahin
Embed
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