Holarch
Kurskapitel

Schulung · Reihe 9. SysML-v2-Grundlagen · Kapitel 9.5 von 8

9.5 Anforderungen 4:15

Prüfbare Anforderungen schreiben, sie in einer Spezifikation verschachteln und eine sehen, die nicht erfüllt ist.

Zeigt Holarch 2.22.

Das lernen Sie

  • Grenzwerte von Anforderungen als Attribute mit Einheiten benennen
  • Eine Requirement-Definition mit Nummer, Aussage, Subjekt und require-Constraint schreiben
  • Requirement-Usages in einer Spezifikation verschachteln und ihnen mit `:>>` eigene Grenzwerte geben
  • Angeben, was eine Anforderung erfüllt, und die Markierung des Editors lesen, wenn der Entwurf sie nicht erfüllt
  • Anforderungsaussagen auf der Seite „Qualität“ prüfen

Schreiben Sie SysML-v2-Anforderungen in Holarch, nach dem SysML-v2-Tutorial „Requirements“ an einem kleinen Hybrid-Car-Projekt: benannte Grenzwerte, Requirement-Definitionen mit Nummer, Aussage, Subjekt und require-Constraint, Einfügen, eine Spezifikation mit verschachtelten Anforderungen, satisfy, eine Anforderung, die die Limousine nicht mehr erfüllt, die Anforderungstabelle, eine Requirement-Ansicht und die Qualitätsprüfung. SysML ist eine eingetragene Marke der Object Management Group, Inc.

Projektdateien

  • Fertiges Projekt (.holarch.json; Projekte verwalten → Projektdateien ▾ → Projekt importieren (.json)…)

Das Video wird von holarch.app abgespielt; siehe Datenschutzerklärung.

Übung

Führen Sie dies selbst in Holarch durch, am Demoprojekt Hybrid Car (SysML v2).

  1. Öffnen Sie Ihr Demoprojekt Hybrid Car (erstellen Sie es bei Bedarf: Projekte verwalten → Projektdateien ▾ → Neues Demoprojekt → Hybridauto (SysML v2)), öffnen Sie Modell → Editor und das Package VehicleRequirements.
  2. Fügen Sie nach attribute minElectricRange attribute minTopSpeed : SpeedValue = 180 [km/h]; hinzu.
  3. Wählen Sie unter requirement def <'VR-5'> ChargeTime Einfügen ▾ → Requirement-Definition und schreiben Sie <'VR-8'> TopSpeed mit der Aussage The sports car shall reach at least the minimum top speed., dem Subjekt car : SportCar und require constraint { car.topSpeed >= minTopSpeed }.
  4. Fügen Sie nach den anderen satisfy-Zeilen satisfy requirement roadsterSpeed : TopSpeed by fleet.roadster; hinzu.
  5. Ändern Sie minTopSpeed in 220 [km/h]. Zeigen Sie auf die Markierung, die der Editor an das satisfy setzt, um die verglichenen Werte zu lesen, und drücken Sie dann ⌘Z / Ctrl+Z.
  6. Öffnen Sie Bedarfe & Anforderungen → Anforderungen und suchen Sie VR-8, öffnen Sie dann Bedarfe & Anforderungen → Qualität und klicken Sie auf Qualität prüfen.

Sie sind fertig, wenn VR-8 in der Anforderungstabelle steht, das satisfy bei 180 km/h keine Markierung hat und „Qualität prüfen“ seine Aussage bewertet hat.

Selbsttest

  1. Warum hält man Grenzwerte wie maxCurbMass als benannte Attribute, statt die Zahl in jeden Constraint zu schreiben?
  2. Was bewirkt :>> in requirement <'VR-1.1'> sedanMass : CurbMass { attribute :>> limit = maxCurbMass; }?
  3. Was lässt satisfy carSpec by fleet.sedan; Holarch prüfen?
  4. Sie setzen Status und Priorität einer Anforderung auf der Seite „Anforderungen“. Ändert sich der SysML-Text?
Antworten anzeigen
  1. Warum hält man Grenzwerte wie maxCurbMass als benannte Attribute, statt die Zahl in jeden Constraint zu schreiben?

    Jede Anforderung, die den Namen verwendet, folgt einer einzigen Änderung, und der Grenzwert trägt seine Einheit, sodass die Prüfung Werte mit Einheiten vergleicht.

  2. Was bewirkt :>> in requirement <'VR-1.1'> sedanMass : CurbMass { attribute :>> limit = maxCurbMass; }?

    Es redefiniert das Attribut limit, das sedanMass von CurbMass erbt, und gibt dieser Usage ihren eigenen Wert.

  3. Was lässt satisfy carSpec by fleet.sedan; Holarch prüfen?

    Ob die Werte der Limousine die Constraints von carSpec erfüllen. Überschreitet die Leermasse der Limousine den Grenzwert, markiert der Editor das satisfy und zeigt die verglichenen Werte.

  4. Sie setzen Status und Priorität einer Anforderung auf der Seite „Anforderungen“. Ändert sich der SysML-Text?

    Nein. Status, Priorität und Verifikationsmethode sind Holarch-Daten, die neben dem Modell gehalten werden; sie ändern den Text nie.

Weiterlesen

Transkript

Transkript anzeigen (Erzählung und Bildschirminhalt)

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.