Holarch
Capítulos do curso

Treinamento · Trilha 9. Fundamentos do SysML v2 · Capítulo 9.6 de 8

9.6 Verificação e rastreabilidade 3:32

Escreva casos de verificação, leia a RVTM, rastreie um passo na matriz e derive um requisito.

Mostra o Holarch 2.22.

← 9.5 Requisitos · Todos os capítulos · 9.7 Restrições e cálculos →

O que você vai aprender

  • Escrever uma definição de verificação com um objetivo e um veredito e aplicá-la a um sujeito
  • Registrar uma etapa e um resultado na página Casos de verificação
  • Ler os casos que verificam um requisito e seu status na RVTM
  • Rastrear um requisito até uma ação na Matriz de rastreabilidade
  • Derivar um requisito de outro com uma conexão Derivation

Verifique e rastreie requisitos SysML v2 no Holarch, seguindo o tutorial de SysML v2 Verification and Traceability em um pequeno projeto Hybrid Car: uma definição de verificação cujo objetivo verifica um requisito, um uso de verificação aplicado ao sedã, a página Casos de verificação e a RVTM, um satisfy criado na Matriz de rastreabilidade, uma derivação entre requisitos e as Checagens do modelo. SysML é uma marca registrada da Object Management Group, Inc.

Arquivos de projeto

  • Projeto concluído (.holarch.json; Gerenciar projetos → Arquivos de projeto ▾ → Importar projeto (.json)…)

O vídeo é reproduzido a partir de holarch.app; veja a Política de Privacidade.

Prática

Faça isto você mesmo no Holarch, no projeto de demonstração Hybrid Car (SysML v2).

  1. Abra seu projeto de demonstração Hybrid Car (crie-o se necessário: Gerenciar projetos → Arquivos de projeto ▾ → Novo projeto de demonstração → Hybrid Car (SysML v2)), abra Modelo → Editor e o pacote VehicleRequirements.
  2. Depois de verification <'VC-1.1'> sedanWeighing, adicione verification def <'VC-2'> BatteryWeighing { subject battery : Battery; objective { verify batteryMassLimit; } return verdict : Boolean = battery.mass <= 50 [kg]; } e verification <'VC-2.1'> sedanBatteryWeighing : BatteryWeighing { subject battery = fleet.sedan.powertrain.battery; }.
  3. Abra Verificação → Casos de verificação. Na linha do novo caso, clique em + Etapas, depois em + Adicionar etapa, digite Weigh the battery on a bench scale em Ação, clique em Aplicar e clique em Aprovado nos botões de status.
  4. Abra Verificação → RVTM e encontre VR-6 batteryMassLimit com o novo caso e seu status.
  5. Abra Verificação → Matriz de rastreabilidade, mostre requisitos como linhas e a classe Ação como colunas, clique na célula em que sedanAcceleration encontra accelerate e escolha satisfied by.
  6. No fim do pacote, adicione requirement <'VR-9'> tankVolume { doc /* The fuel tank shall hold at least 40 L. */ subject tank : FuelTank; } e connection tankDerivation : Derivation connect carSpec.sedanRange to tankVolume;. Depois abra Verificação → Checagens do modelo.

Você terminou quando a RVTM listar o novo caso em relação a VR-6 como aprovado, o Editor contiver o novo satisfy e tankDerivation, e o status não indicar problemas.

Teste-se

  1. Em objective massObjective { verify carSpec.sedanMass; }, o que verify declara, e onde você vê isso?
  2. Qual é a diferença entre o veredito de um caso de verificação e o status na página Casos de verificação?
  3. Quando usar satisfy, e quando uma Derivation?
  4. O que acontece quando você escolhe satisfied by em uma célula da Matriz de rastreabilidade?
Mostrar as respostas
  1. Em objective massObjective { verify carSpec.sedanMass; }, o que verify declara, e onde você vê isso?

    Que este caso de verificação verifica o requisito sedanMass. A RVTM lista o caso em relação a esse requisito.

  2. Qual é a diferença entre o veredito de um caso de verificação e o status na página Casos de verificação?

    O veredito faz parte do modelo: uma expressão, aqui se a massa em ordem de marcha está dentro do limite. As etapas, os resultados e o status de uma execução de teste são dados do Holarch mantidos junto do modelo.

  3. Quando usar satisfy, e quando uma Derivation?

    satisfy diz que um elemento de projeto, como uma parte ou uma ação, atende a um requisito. Uma Derivation conecta um requisito original a um requisito derivado dele; ela precisa de private import RequirementDerivation::*;.

  4. O que acontece quando você escolhe satisfied by em uma célula da Matriz de rastreabilidade?

    O Holarch escreve um satisfy no texto SysML, então a rastreabilidade faz parte do modelo e aparece no Editor.

Saiba mais

Transcrição

Mostrar a transcrição (narração e o que aparece na tela)

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.