Holarch
Capítulos del curso

Formación · Curso 9. Fundamentos de SysML v2 · Capítulo 9.6 de 8

9.6 Verificación y trazabilidad 3:32

Escribir casos de verificación, leer la RVTM, trazar un paso en la matriz y derivar un requisito.

Muestra Holarch 2.22.

← 9.5 Requisitos · Todos los capítulos · 9.7 Restricciones y cálculos →

Lo que aprenderá

  • Escribir una definición de verificación con un objetivo y un veredicto, y aplicarla a un sujeto
  • Registrar un paso y un resultado en la página Casos de verificación
  • Leer en la RVTM los casos que verifican un requisito y su estado
  • Trazar un requisito hasta una acción en la matriz de trazabilidad
  • Derivar un requisito de otro con una conexión Derivation

Verifique y trace requisitos de SysML v2 en Holarch, siguiendo el tutorial de SysML v2 Verification and Traceability en un pequeño proyecto Hybrid Car: una definición de verificación cuyo objetivo verifica un requisito, un uso de verificación aplicado al sedán, la página Casos de verificación y la RVTM, un satisfy creado en la matriz de trazabilidad, una derivación entre requisitos y las comprobaciones del modelo. SysML es una marca registrada de Object Management Group, Inc.

Archivos de proyecto

  • Proyecto terminado (.holarch.json; Gestionar proyectos → Archivos de proyecto ▾ → Importar proyecto (.json)…)

El vídeo se reproduce desde holarch.app; consulte la Política de privacidad.

Práctica

Hágalo usted mismo en Holarch, en el proyecto de demostración Hybrid Car (SysML v2).

  1. Abra su proyecto de demostración Hybrid Car (créelo si hace falta: Gestionar proyectos → Archivos de proyecto ▾ → Nuevo proyecto de demostración → Hybrid Car (SysML v2)), abra Modelo → Editor y el paquete VehicleRequirements.
  2. Después de verification <'VC-1.1'> sedanWeighing, añada verification def <'VC-2'> BatteryWeighing { subject battery : Battery; objective { verify batteryMassLimit; } return verdict : Boolean = battery.mass <= 50 [kg]; } y verification <'VC-2.1'> sedanBatteryWeighing : BatteryWeighing { subject battery = fleet.sedan.powertrain.battery; }.
  3. Abra Verificación → Casos de verificación. En la fila del nuevo caso, haga clic en + Pasos, después en + Añadir paso, escriba Weigh the battery on a bench scale en Acción, haga clic en Aplicar y haga clic en Aprobado entre sus botones de estado.
  4. Abra Verificación → RVTM y busque VR-6 batteryMassLimit con el nuevo caso y su estado.
  5. Abra Verificación → Matriz de trazabilidad, muestre los requisitos como filas y la clase Action como columnas, haga clic en la celda donde sedanAcceleration se cruza con accelerate y elija satisfied by.
  6. Al final del paquete, añada requirement <'VR-9'> tankVolume { doc /* The fuel tank shall hold at least 40 L. */ subject tank : FuelTank; } y connection tankDerivation : Derivation connect carSpec.sedanRange to tankVolume;. Después abra Verificación → Comprobaciones del modelo.

Habrá terminado cuando la RVTM liste el nuevo caso frente a VR-6 como aprobado, el Editor contenga el nuevo satisfy y tankDerivation, y el estado no indique problemas.

Compruebe lo aprendido

  1. En objective massObjective { verify carSpec.sedanMass; }, ¿qué expresa verify y dónde se ve?
  2. ¿Qué diferencia hay entre el veredicto de un caso de verificación y el estado en la página Casos de verificación?
  3. ¿Cuándo se usa satisfy y cuándo una Derivation?
  4. ¿Qué ocurre al elegir satisfied by en una celda de la matriz de trazabilidad?
Mostrar las respuestas
  1. En objective massObjective { verify carSpec.sedanMass; }, ¿qué expresa verify y dónde se ve?

    Que este caso de verificación verifica el requisito sedanMass. La RVTM lista el caso frente a ese requisito.

  2. ¿Qué diferencia hay entre el veredicto de un caso de verificación y el estado en la página Casos de verificación?

    El veredicto forma parte del modelo: una expresión, aquí si la masa en vacío está dentro del límite. Los pasos, los resultados y el estado de una ejecución de prueba son datos de Holarch que se guardan junto al modelo.

  3. ¿Cuándo se usa satisfy y cuándo una Derivation?

    satisfy dice que un elemento de diseño, como una parte o una acción, cumple un requisito. Una Derivation conecta un requisito original con un requisito derivado de él; necesita private import RequirementDerivation::*;.

  4. ¿Qué ocurre al elegir satisfied by en una celda de la matriz de trazabilidad?

    Holarch escribe un satisfy en el texto de SysML, de modo que la traza forma parte del modelo y aparece en el Editor.

Más información

Transcripción

Mostrar la transcripción (narración y lo que aparece en pantalla)

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.