Holarch
Capítulos do curso

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

9.5 Requisitos 4:15

Escreva requisitos checáveis, aninhe-os em uma especificação e veja um que não é atendido.

Mostra o Holarch 2.22.

O que você vai aprender

  • Nomear limites de requisitos como atributos com unidades
  • Escrever uma definição de requisito com um número, uma declaração, um sujeito e uma require constraint
  • Aninhar usos de requisito em uma especificação e dar a eles limites próprios com `:>>`
  • Dizer o que atende a um requisito e ler a marca do Editor quando o projeto não o atende
  • Checar as declarações dos requisitos na página Qualidade

Escreva requisitos SysML v2 no Holarch, seguindo o tutorial de SysML v2 Requirements em um pequeno projeto Hybrid Car: limites com nome, definições de requisito com um número, uma declaração, um sujeito e uma require constraint, Inserir, uma especificação com requisitos aninhados, satisfy, um requisito que o sedã não atende mais, a tabela de requisitos, uma Visão de requisitos e a checagem de qualidade. 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 attribute minElectricRange, adicione attribute minTopSpeed : SpeedValue = 180 [km/h];.
  3. Abaixo de requirement def <'VR-5'> ChargeTime, escolha Inserir ▾ → Definição de requisito e escreva <'VR-8'> TopSpeed com a declaração The sports car shall reach at least the minimum top speed., o sujeito car : SportCar e require constraint { car.topSpeed >= minTopSpeed }.
  4. Depois das outras linhas satisfy, adicione satisfy requirement roadsterSpeed : TopSpeed by fleet.roadster;.
  5. Mude minTopSpeed para 220 [km/h]. Aponte para a marca que o Editor coloca no satisfy para ler os valores que ele comparou e depois pressione ⌘Z / Ctrl+Z.
  6. Abra Necessidades e requisitos → Requisitos e encontre VR-8; depois abra Necessidades e requisitos → Qualidade e clique em Checar qualidade.

Você terminou quando VR-8 estiver na tabela Requisitos, o satisfy não tiver marca a 180 km/h e Checar qualidade tiver pontuado sua declaração.

Teste-se

  1. Por que manter limites como maxCurbMass como atributos com nome em vez de escrever o número em cada restrição?
  2. Em requirement <'VR-1.1'> sedanMass : CurbMass { attribute :>> limit = maxCurbMass; }, o que :>> faz?
  3. O que satisfy carSpec by fleet.sedan; permite que o Holarch cheque?
  4. Você define o Status e a Prioridade de um requisito na página Requisitos. O texto SysML muda?
Mostrar as respostas
  1. Por que manter limites como maxCurbMass como atributos com nome em vez de escrever o número em cada restrição?

    Todo requisito que usa o nome acompanha uma única edição, e o limite carrega sua unidade, então o verificador compara valores com unidades.

  2. Em requirement <'VR-1.1'> sedanMass : CurbMass { attribute :>> limit = maxCurbMass; }, o que :>> faz?

    Ele redefine o atributo limit que sedanMass herda de CurbMass, dando a este uso seu próprio valor.

  3. O que satisfy carSpec by fleet.sedan; permite que o Holarch cheque?

    Se os valores do sedã atendem às restrições de carSpec. Se a massa em ordem de marcha do sedã exceder o limite, o Editor marca o satisfy e mostra os valores comparados.

  4. Você define o Status e a Prioridade de um requisito na página Requisitos. O texto SysML muda?

    Não. Status, prioridade e método de verificação são dados do Holarch mantidos junto do modelo; eles nunca alteram o texto.

Saiba mais

Transcrição

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

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.