Rozdziały kursu
Szkolenia · Ścieżka 9. Podstawy SysML v2 · Rozdział 9.5 z 8
9.5 Wymagania 4:15
Pisanie sprawdzalnych wymagań, zagnieżdżanie ich w specyfikacji i oglądanie wymagania, które nie jest spełnione.
Pokazuje Holarch 2.22.
Czego się nauczysz
- Nazywanie limitów wymagań jako atrybutów z jednostkami
- Pisanie definicji wymagania z numerem, zdaniem, podmiotem i ograniczeniem require
- Zagnieżdżanie użyć wymagań w specyfikacji i nadawanie im własnych limitów za pomocą `:>>`
- Określanie, co spełnia wymaganie, i odczytywanie znacznika Edytora, gdy projekt go nie spełnia
- Sprawdzanie zdań wymagań na stronie Jakość
Pisz wymagania SysML v2 w Holarch zgodnie z samouczkiem SysML v2 Wymagania na małym projekcie Hybrid Car: nazwane limity, definicje wymagań z numerem, zdaniem, podmiotem i ograniczeniem require, Wstaw, specyfikacja z zagnieżdżonymi wymaganiami, satisfy, wymaganie, którego sedan już nie spełnia, tabela wymagań, Widok wymagań i kontrola jakości. SysML jest zastrzeżonym znakiem towarowym Object Management Group, Inc.
Pliki projektu
- Projekt ukończony (.holarch.json; Zarządzaj projektami → Pliki projektu ▾ → Importuj projekt (.json)…)
Film jest odtwarzany z holarch.app; zobacz Politykę prywatności.
Ćwiczenie
Wykonaj to samodzielnie w Holarch na projekcie demonstracyjnym Hybrid Car (SysML v2).
- Otwórz swój projekt demonstracyjny Hybrid Car (w razie potrzeby utwórz go: Zarządzaj projektami → Pliki projektu ▾ → Nowy projekt demonstracyjny → Hybrid Car (SysML v2)), otwórz Model → Edytor i pakiet
VehicleRequirements. - Po
attribute minElectricRangedodajattribute minTopSpeed : SpeedValue = 180 [km/h];. - Pod
requirement def <'VR-5'> ChargeTimewybierz Wstaw ▾ → Definicja wymagania i napisz<'VR-8'> TopSpeedze zdaniemThe sports car shall reach at least the minimum top speed., podmiotemcar : SportCarirequire constraint { car.topSpeed >= minTopSpeed }. - Po pozostałych wierszach
satisfydodajsatisfy requirement roadsterSpeed : TopSpeed by fleet.roadster;. - Zmień
minTopSpeedna220 [km/h]. Wskaż znacznik, który Edytor umieszcza przy satisfy, aby odczytać porównane wartości, a następnie naciśnij ⌘Z / Ctrl+Z. - Otwórz Potrzeby i wymagania → Wymagania i znajdź VR-8, a następnie otwórz Potrzeby i wymagania → Jakość i kliknij Sprawdź jakość.
Gotowe, gdy VR-8 jest w tabeli Wymagania, satisfy nie ma znacznika przy 180 km/h, a Sprawdź jakość oceniło jego zdanie.
Sprawdź się
- Dlaczego trzymać limity takie jak
maxCurbMassjako nazwane atrybuty zamiast wpisywać liczbę w każdym ograniczeniu? - Co robi
:>>wrequirement <'VR-1.1'> sedanMass : CurbMass { attribute :>> limit = maxCurbMass; }? - Co pozwala sprawdzić w Holarch
satisfy carSpec by fleet.sedan;? - Ustawiasz Status i Priorytet wymagania na stronie Wymagania. Czy tekst SysML się zmienia?
Pokaż odpowiedzi
Dlaczego trzymać limity takie jak
maxCurbMassjako nazwane atrybuty zamiast wpisywać liczbę w każdym ograniczeniu?Każde wymaganie używające tej nazwy podąża za jedną edycją, a limit zawiera jednostkę, więc kontroler porównuje wartości z jednostkami.
Co robi
:>>wrequirement <'VR-1.1'> sedanMass : CurbMass { attribute :>> limit = maxCurbMass; }?Redefiniuje atrybut
limit, który sedanMass dziedziczy z CurbMass, nadając temu użyciu własną wartość.Co pozwala sprawdzić w Holarch
satisfy carSpec by fleet.sedan;?Czy wartości sedana spełniają ograniczenia carSpec. Jeśli masa własna sedana przekracza limit, Edytor oznacza satisfy i pokazuje porównane wartości.
Ustawiasz Status i Priorytet wymagania na stronie Wymagania. Czy tekst SysML się zmienia?
Nie. Status, priorytet i metoda weryfikacji to dane Holarch przechowywane obok modelu; nigdy nie zmieniają tekstu.
Więcej informacji
Transkrypcja
Pokaż transkrypcję (narracja i to, co widać na ekranie)
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.