플로우차트
그래픽 표현
마인드맵
구조화된 표현
노트
효율적인 표현

요구사항 다이어그램구문

요구사항 다이어그램

요구사항 다이어그램은 요구사항과 그들 사이의 연결 관계, 그리고 다른 문서 요소와의 관계를 시각화하여 제공합니다.

코드
                            
복사
임베드
requirementDiagram requirement test_req { id: 1 text: the test text. risk: high verifymethod: test } element test_entity { type: simulation } test_entity - satisfies -> test_req

문법

요구사항 다이어그램에는 요구사항, 요소 및 관계의 세 가지 구성 요소가 포함됩니다.

꺾쇠괄호로 표시된 단어는 열거형 키워드이며, 예를 들어 , 그 옵션은 표에 자세히 설명되어 있습니다. user_defined... 는 사용자 입력이 필요한 모든 곳에 사용됩니다.

사용자 텍스트에 대한 중요한 설명: 모든 입력은 큰따옴표로 감쌀 수도 있고 쓰지 않을 수도 있습니다. 그러나 사용자는 따옴표가 없는 입력을 사용할 때 주의해야 합니다. 다른 키워드가 감지되면 편집기 렌더링이 실패합니다.

요구사항

요구사항 정의에는 요구사항 유형, 이름, ID, 텍스트, 위험 및 검증 방법이 포함됩니다. 문법은 다음과 같습니다:

                            
복사
임베드
<type> user_defined_name { id: user_defined_id text: user_defined text risk: <risk> verifymethod: <method> }

유형, 위험 및 방법은 SysML 에서 정의된 열거형입니다.

키워드 옵션
유형 요구사항, 기능 요구사항, 인터페이스 요구사항, 성능 요구사항, 물리적 요구사항, 설계 제약
위험 낮음, 중간, 높음
검증 방법 분석, 검사, 테스트, 시연

요소

요소 정의에는 요소 이름, 유형 및 문서 참조가 포함되며, 이 세 가지는 모두 사용자 정의입니다. 요소 기능은 경량을 유지하면서 요구사항을 다른 문서의 일부 내용과 연결할 수 있도록 설계되었습니다.

                            
복사
임베드
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}

"소스 노드" 와 "대상 노드" 는 다른 곳에서 정의된 요구사항 또는 요소 노드의 이름이어야 합니다.

관계 유형은 포함, 복사, 파생, 충족, 검증, 세분화 또는 추적 중 하나일 수 있습니다.

상세 사례

이 예는 해당 다이어그램의 모든 기능을 사용합니다.

코드
                            
복사
임베드
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