Kurs bölümleri
Eğitim · Kurs 9. SysML v2 temelleri · Bölüm 9.5 / 8
9.5 Gereksinimler 4:15
Denetlenebilir gereksinimler yazın, onları bir şartnamede iç içe yerleştirin ve karşılanmayan birini görün.
Holarch 2.22 sürümünü gösterir.
Neler öğreneceksiniz
- Gereksinim sınırlarını birimli öznitelikler olarak adlandırın
- Numarası, ifadesi, konusu ve bir require kısıtı olan bir gereksinim tanımı yazın
- Gereksinim kullanımlarını bir şartnamede iç içe yerleştirin ve onlara `:>>` ile kendi sınırlarını verin
- Bir gereksinimi neyin karşıladığını söyleyin ve tasarım onu karşılamadığında Düzenleyici'nin işaretini okuyun
- Gereksinim ifadelerini Kalite sayfasında denetleyin
Küçük bir Hybrid Car projesi üzerinde SysML v2 öğreticisi Requirements'ı izleyerek Holarch'ta SysML v2 gereksinimleri yazın: adlandırılmış sınırlar, numarası, ifadesi, konusu ve bir require kısıtı olan gereksinim tanımları, Ekle, iç içe gereksinimler içeren bir şartname, satisfy, sedanın artık karşılamadığı bir gereksinim, gereksinimler tablosu, bir Gereksinim görünümü ve kalite denetimi. SysML, Object Management Group, Inc.'in tescilli ticari markasıdır.
Proje dosyaları
- Bitmiş proje (.holarch.json; Projeleri yönet → Proje dosyaları ▾ → Proje içe aktar (.json)…)
Video holarch.app'ten oynatılır; bkz. Gizlilik Politikası.
Alıştırma
Bunu Holarch'ta, Hybrid Car demo projesinde (SysML v2) kendiniz yapın.
- Hybrid Car demo projenizi açın (gerekirse oluşturun: Projeleri yönet → Proje dosyaları ▾ → Yeni demo proje → Hybrid Car (SysML v2)), Model → Düzenleyici'yi ve
VehicleRequirementspaketini açın. attribute minElectricRange'den sonraattribute minTopSpeed : SpeedValue = 180 [km/h];ekleyin.requirement def <'VR-5'> ChargeTime'ın altında Ekle ▾ → Gereksinim tanımı'nı seçin veThe sports car shall reach at least the minimum top speed.ifadesi,car : SportCarkonusu verequire constraint { car.topSpeed >= minTopSpeed }ile<'VR-8'> TopSpeed'i yazın.- Diğer
satisfysatırlarından sonrasatisfy requirement roadsterSpeed : TopSpeed by fleet.roadster;ekleyin. minTopSpeed'i220 [km/h]olarak değiştirin. Karşılaştırdığı değerleri okumak için Düzenleyici'nin satisfy üzerine koyduğu işaretin üzerine gelin, ardından ⌘Z / Ctrl+Z'ye basın.- İhtiyaçlar ve gereksinimler → Gereksinimler'i açın ve VR-8'i bulun, ardından İhtiyaçlar ve gereksinimler → Kalite'yi açın ve Kaliteyi denetle'ye tıklayın.
VR-8 Gereksinimler tablosunda olduğunda, satisfy 180 km/h'de işaret taşımadığında ve Kaliteyi denetle ifadesini puanladığında işiniz bitmiştir.
Kendinizi sınayın
maxCurbMassgibi sınırlar neden her kısıtta sayı yazmak yerine adlandırılmış öznitelikler olarak tutulmalı?requirement <'VR-1.1'> sedanMass : CurbMass { attribute :>> limit = maxCurbMass; }içinde:>>ne yapar?satisfy carSpec by fleet.sedan;Holarch'ın neyi denetlemesini sağlar?- Gereksinimler sayfasında bir gereksinimin Durum ve Öncelik değerlerini ayarlıyorsunuz. SysML metni değişir mi?
Yanıtları göster
maxCurbMassgibi sınırlar neden her kısıtta sayı yazmak yerine adlandırılmış öznitelikler olarak tutulmalı?Adı kullanan her gereksinim tek bir düzenlemeyi izler ve sınır birimini taşır, bu yüzden denetleyici değerleri birimleriyle karşılaştırır.
requirement <'VR-1.1'> sedanMass : CurbMass { attribute :>> limit = maxCurbMass; }içinde:>>ne yapar?sedanMass'in CurbMass'ten devraldığı
limitözniteliğini yeniden tanımlar ve bu kullanıma kendi değerini verir.satisfy carSpec by fleet.sedan;Holarch'ın neyi denetlemesini sağlar?Sedanın değerlerinin carSpec'in kısıtlarını karşılayıp karşılamadığını. Sedanın boş ağırlığı sınırı aşarsa Düzenleyici satisfy'ı işaretler ve karşılaştırılan değerleri gösterir.
Gereksinimler sayfasında bir gereksinimin Durum ve Öncelik değerlerini ayarlıyorsunuz. SysML metni değişir mi?
Hayır. Durum, öncelik ve doğrulama yöntemi modelin yanında tutulan Holarch verileridir; metni asla değiştirmezler.
Daha fazla bilgi
Döküm
Dökümü göster (anlatım ve ekranda görünenler)
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.