Capitoli del corso
Formazione · Percorso 9. Fondamenti di SysML v2 · Capitolo 9.6 di 8
9.6 Verification and Traceability 3:32
Scrivere casi di verifica, leggere la RVTM, tracciare un passo nella matrice e derivare un requisito.
Mostra Holarch 2.22.
Che cosa si impara
- Scrivere una definizione di verifica con un obiettivo e un verdetto e applicarla a un soggetto
- Registrare un passo e un risultato nella pagina Casi di verifica
- Leggere nella RVTM i casi che verificano un requisito e il suo stato
- Tracciare un requisito fino a una action nella Matrice di tracciabilità
- Derivare un requisito da un altro con una connessione Derivation
Verificare e tracciare requisiti SysML v2 in Holarch, seguendo il tutorial SysML v2 Verification and Traceability su un piccolo progetto Hybrid Car: una definizione di verifica il cui obiettivo verifica un requisito, un uso di verifica applicato alla berlina, la pagina Casi di verifica e la RVTM, un satisfy creato nella Matrice di tracciabilità, una derivazione tra requisiti e i Controlli del modello. SysML è un marchio registrato di Object Management Group, Inc.
File di progetto
- Progetto completato (.holarch.json; Gestisci progetti → File di progetto ▾ → Importa progetto (.json)…)
Il video viene riprodotto da holarch.app; vedere l’Informativa sulla privacy.
Esercitazione
Provare in prima persona in Holarch, sul progetto demo Hybrid Car (SysML v2).
- Aprire il progetto demo Hybrid Car (crearlo se necessario: Gestisci progetti → File di progetto ▾ → Nuovo progetto demo → Hybrid Car (SysML v2)), aprire Modello → Editor e il package
VehicleRequirements. - Dopo
verification <'VC-1.1'> sedanWeighing, aggiungereverification def <'VC-2'> BatteryWeighing { subject battery : Battery; objective { verify batteryMassLimit; } return verdict : Boolean = battery.mass <= 50 [kg]; }everification <'VC-2.1'> sedanBatteryWeighing : BatteryWeighing { subject battery = fleet.sedan.powertrain.battery; }. - Aprire Verifica → Casi di verifica. Nella riga del nuovo caso, fare clic su + Passi, poi su + Aggiungi passo, digitare
Weigh the battery on a bench scalein Azione, fare clic su Applica e fare clic su Superati tra i pulsanti di stato. - Aprire Verifica → RVTM e trovare VR-6
batteryMassLimitcon il nuovo caso e il suo stato. - Aprire Verifica → Matrice di tracciabilità, mostrare i requisiti come righe e la classe Azione come colonne, fare clic sulla cella in cui
sedanAccelerationincontraacceleratee scegliere satisfied by. - Alla fine del package, aggiungere
requirement <'VR-9'> tankVolume { doc /* The fuel tank shall hold at least 40 L. */ subject tank : FuelTank; }econnection tankDerivation : Derivation connect carSpec.sedanRange to tankVolume;. Poi aprire Verifica → Controlli del modello.
L’esercizio è completato quando la RVTM elenca il nuovo caso rispetto a VR-6 come superato, l’Editor contiene il nuovo satisfy e tankDerivation, e lo stato non segnala problemi.
Verifica
- In
objective massObjective { verify carSpec.sedanMass; }, che cosa diceverifye dove lo si vede? - Qual è la differenza tra il verdetto di un caso di verifica e lo stato nella pagina Casi di verifica?
- Quando si usa
satisfye quando unaDerivation? - Che cosa succede quando si sceglie satisfied by in una cella della Matrice di tracciabilità?
Mostra le risposte
In
objective massObjective { verify carSpec.sedanMass; }, che cosa diceverifye dove lo si vede?Che questo caso di verifica verifica il requisito sedanMass. La RVTM elenca il caso rispetto a quel requisito.
Qual è la differenza tra il verdetto di un caso di verifica e lo stato nella pagina Casi di verifica?
Il verdetto fa parte del modello: un’espressione, qui se la massa a vuoto rientra nel limite. Passi, risultati e lo stato di un’esecuzione di test sono dati di Holarch tenuti accanto al modello.
Quando si usa
satisfye quando unaDerivation?satisfydice che un elemento di progetto, come una part o una action, soddisfa un requisito. Una Derivation collega un requisito originale a un requisito derivato da esso; richiedeprivate import RequirementDerivation::*;.Che cosa succede quando si sceglie satisfied by in una cella della Matrice di tracciabilità?
Holarch scrive un
satisfynel testo SysML, quindi la traccia fa parte del modello e compare nell’Editor.
Per saperne di più
Trascrizione
Mostra la trascrizione (narrazione e contenuto dello schermo)
Introduction
Chapter six: verification and traceability. A verification case says how a requirement is checked, and traceability shows what connects to what.
In this chapter you write a verification case and apply it to the sedan, check the RVTM, trace a step to a requirement in the matrix, and derive a requirement.
Start the tutorial
Start the tutorial Verification and Traceability from Project Files, Start a Tutorial. Its starter project holds the curb mass requirement and the car specification, a short drive cycle, and two more requirements: a battery mass limit and stopping from cruise.
On screen: Project Files ▾ → Start a Tutorial… → SysML v2: Verification and Traceability → Start; Model → Editor.
Verification cases
After the verification comment, write the verification definition. Its objective names the requirement it verifies, and its verdict passes when the curb mass is within the limit.
On screen: After // ---- Verification ----: verification def <'VC-1'> CurbMassTest.
Below it, apply it to the sedan: a verification usage that weighs the sedan of the fleet.
On screen: Below it: verification <'VC-1.1'> sedanWeighing : CurbMassTest.
Open Verification, then Verification Cases. The model's verification cases are the test cases here. Steps, results and status are Holarch data next to the model, kept on this page.
On screen: Verification → Verification Cases; the Sedan Weighing row.
In the Sedan Weighing row, click Steps, then Add Step. Type weigh the car as the action, and click Apply.
On screen: + Steps → + Add Step; Action: Weigh the car; Apply.
Then set the result: click Passed in its status buttons.
On screen: Status buttons → Passed.
Open the RVTM. Each requirement is listed with its verification method, the cases that verify it, and their status.
On screen: Verification → RVTM.
Traceability
Now trace a step to a requirement. Open the Traceability Matrix. Its rows are the requirements; open Columns, and choose the class Action.
On screen: Verification → Traceability Matrix; rows: Requirement; Columns: class Action; Done.
Click the cell where stop from cruise meets the brake step, and choose satisfied by. Holarch writes a satisfy into the text.
On screen: Cell stopFromCruise × brake → satisfied by.
In the Editor, the satisfy is there. To derive a requirement, first import the requirement derivation package after the other imports.
On screen: Model → Editor: the new satisfy; import RequirementDerivation.
Then, at the end of the package, connect the sedan's mass requirement to the battery mass limit with a derivation: the battery limit is derived from the curb mass requirement.
On screen: After sedanWeighing: connection batteryMassDerivation : Derivation connect carSpec.sedanMass to batteryMassLimit;
Last, open Verification, then Model Checks. Rules run over the whole model, for example requirements without a satisfy or a verify, and each finding links to its element.
On screen: Verification → Model Checks.
Recap
Every step is ticked off. Click Mark as Done.
On screen: Step panel → Mark as Done.
Let's recap. You wrote a verification case with an objective and a verdict, applied it to the sedan, opened the Verification Cases and the RVTM, traced a step to a requirement in the matrix, and derived one requirement from another.
Next, constraints and calculations evaluate the sedan's values.