128
Requirements Verification in CPSs Luca Pulina 1 Armando Tacchella 2 Simone Vuotto 1,2 1 University of Sassari (Italy) 2 University of Genoa (Italy) CPS Summer School 2018 Alghero, September 18, 2018 Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 1 / 72

1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

  • Upload
    others

  • View
    32

  • Download
    1

Embed Size (px)

Citation preview

Page 1: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Requirements Verification in CPSs

Luca Pulina1 Armando Tacchella2 Simone Vuotto1,2

1University of Sassari (Italy)2University of Genoa (Italy)

CPS Summer School 2018Alghero, September 18, 2018

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 1 / 72

Page 2: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Context

Requirements for Cyber-PhysicalSystems (CPSs)

Understanding

Writing

Analyzing

Refactoring

Validating

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 2 / 72

Page 3: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Motivation

CPSs pose unique challenges inthat they are

Hierarchical

Heterogeneous

Distributed

Connected

Socio-technical

Autonomous/adaptive

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 3 / 72

Page 4: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Challenges

CPSs melt together different com-munities:

Hardware design

Software engineering

Control/automation

Optimization

Artificial Intelligence

Psychology/sociology

“Tower of Babel” phenomenon: each community speaks its ownlanguage and sees the same problems from a different perspective.

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 4 / 72

Page 5: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Objectives

+

Transfer methodology/best practices from software to CPSs

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 5 / 72

Page 6: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

What is in the tutorial

A general introduction to requirement engineering

Our research explained: from software requirements to CPSsrequirements

Introducing our prototype ReqV

Hands-on session on ReqV

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 6 / 72

Page 7: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

What is not in the tutorial

A solution to requirement engineering in CPSs

A common language that cuts across communities

A focus on issues outside software and control (mostly)

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 7 / 72

Page 8: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Outline

1 Requirements Engineering – A quick overviewFunctional and Non-functional RequirementsRequirements Engineering ProcessesRequirements SpecificationRequirements Validation

2 Formal consistency checking

3 Requirements Management with ReqV

4 Hands-on session on ReqV

5 Conclusions

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 8 / 72

Page 9: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Outline

1 Requirements Engineering – A quick overviewFunctional and Non-functional RequirementsRequirements Engineering ProcessesRequirements SpecificationRequirements Validation

2 Formal consistency checking

3 Requirements Management with ReqV

4 Hands-on session on ReqV

5 Conclusions

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 9 / 72

Page 10: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Requirements Engineering

The process of establishingthe services that a customer requires from a system; and

the constraints under which it operates and is developed.

RequirementsDescriptions of the system services and constraints that aregenerated during the requirements engineering process.They may range from a high-level abstract statement of aservice or of a system constraint to a detailed mathematicalfunctional specification.

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 10 / 72

Page 11: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Requirements Engineering

The process of establishingthe services that a customer requires from a system; and

the constraints under which it operates and is developed.

RequirementsDescriptions of the system services and constraints that aregenerated during the requirements engineering process.They may range from a high-level abstract statement of aservice or of a system constraint to a detailed mathematicalfunctional specification.

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 10 / 72

Page 12: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Types of requirement

User requirementsI Statements in natural language plus diagrams of the services the

system provides and its operational constraints.I Written for customers.

System requirementsI A structured document setting out detailed descriptions of the

system’s functions, services and operational constraints.I Defines what should be implemented so may be part of a contract

between client and contractor.

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 11 / 72

Page 13: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Types of requirement

User requirementsI Statements in natural language plus diagrams of the services the

system provides and its operational constraints.I Written for customers.

System requirementsI A structured document setting out detailed descriptions of the

system’s functions, services and operational constraints.I Defines what should be implemented so may be part of a contract

between client and contractor.

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 11 / 72

Page 14: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Example – User and System Requirements

User Requirement1. The robotic arm should never reach its joint limits while moving.

System Requirement1.1 It is never the case that joint1_angle > 45 deg holds.1.2 It is never the case that joint2_angle > 60 deg holds.. . .

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 12 / 72

Page 15: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Example – User and System Requirements

User Requirement1. The robotic arm should never reach its joint limits while moving.

System Requirement1.1 It is never the case that joint1_angle > 45 deg holds.1.2 It is never the case that joint2_angle > 60 deg holds.. . .

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 12 / 72

Page 16: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Readers of different types of requirementsspecification

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 13 / 72

Page 17: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Readers of different types of requirementsspecification

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 13 / 72

Page 18: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Outline

1 Requirements Engineering – A quick overviewFunctional and Non-functional RequirementsRequirements Engineering ProcessesRequirements SpecificationRequirements Validation

2 Formal consistency checking

3 Requirements Management with ReqV

4 Hands-on session on ReqV

5 Conclusions

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 14 / 72

Page 19: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Functional and Non-functional Requirements

Functional requirementsStatements of services the system should provideI How the system should react to particular inputs;I How the system should behave in particular situations

May state what the system should not do.

Non-functional requirementsConstraints on the services or functions offered by the systemI e.g., timing constraints, constraints on the development process,

standards, etc.

Often apply to the system as a whole rather than individualfeatures or services.

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 15 / 72

Page 20: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Functional and Non-functional Requirements

Functional requirementsStatements of services the system should provideI How the system should react to particular inputs;I How the system should behave in particular situations

May state what the system should not do.

Non-functional requirementsConstraints on the services or functions offered by the systemI e.g., timing constraints, constraints on the development process,

standards, etc.

Often apply to the system as a whole rather than individualfeatures or services.

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 15 / 72

Page 21: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Functional requirements

Describe functionality or system services.

Functional user requirements may be high-level statements ofwhat the system should do.

Functional system requirements should describe the systemservices in detail.

Problems arise when functional requirements are not preciselystated.

Ambiguous requirements may be interpreted in different waysby developers and users.

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 16 / 72

Page 22: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Functional requirements

Describe functionality or system services.

Functional user requirements may be high-level statements ofwhat the system should do.

Functional system requirements should describe the systemservices in detail.

Problems arise when functional requirements are not preciselystated.

Ambiguous requirements may be interpreted in different waysby developers and users.

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 16 / 72

Page 23: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Requirements Completeness and Consistency

In principle, requirements should be both complete and consistent.Complete: They should include descriptions of all facilitiesrequired.Consistent: There should be no conflicts or contradictions in thedescriptions of the system facilities.

In practice, because of system and environmental complexity, it isimpossible to produce a complete and consistent requirementsdocument.

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 17 / 72

Page 24: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Non-functional Requirements

These define system properties and constraintsI Properties: reliability, response time, storage requirements...I Constraints: I/O device capability, system representations...

Non-functional requirements may be more critical than functionalrequirements.I If these are not met, the system may be useless.

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 18 / 72

Page 25: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Types of Non-functional Requirement

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 19 / 72

Page 26: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Metrics for specifying non-functional requirements

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 20 / 72

Page 27: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Outline

1 Requirements Engineering – A quick overviewFunctional and Non-functional RequirementsRequirements Engineering ProcessesRequirements SpecificationRequirements Validation

2 Formal consistency checking

3 Requirements Management with ReqV

4 Hands-on session on ReqV

5 Conclusions

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 21 / 72

Page 28: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Requirements Engineering (RE) processes

The processes used for RE vary widely depending onI the application domain;I the people involved; andI the organization developing the requirements.

However, there are a number of generic activities common to allprocessesI Requirements elicitation;I Requirements analysis;I Requirements validation;I Requirements management.

RE is an iterative activity in which these processes are interleaved.

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 22 / 72

Page 29: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Requirements Engineering (RE) processes

The processes used for RE vary widely depending onI the application domain;I the people involved; andI the organization developing the requirements.

However, there are a number of generic activities common to allprocessesI Requirements elicitation;I Requirements analysis;I Requirements validation;I Requirements management.

RE is an iterative activity in which these processes are interleaved.

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 22 / 72

Page 30: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Requirements Engineering (RE) processes

The processes used for RE vary widely depending onI the application domain;I the people involved; andI the organization developing the requirements.

However, there are a number of generic activities common to allprocessesI Requirements elicitation;I Requirements analysis;I Requirements validation;I Requirements management.

RE is an iterative activity in which these processes are interleaved.

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 22 / 72

Page 31: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

A spiral view

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 23 / 72

Page 32: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Requirements Elicitation

Engineers work with a range of system stakeholders to find outaboutI the application domain;I the services that the system should provide;I the required system performance;I hardware constraints;I other system;I ...

Stages include:1 Requirements discovery,2 Requirements classification and organization,3 Requirements prioritization and negotiation,4 Requirements specification.

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 24 / 72

Page 33: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Requirements Elicitation

Engineers work with a range of system stakeholders to find outaboutI the application domain;I the services that the system should provide;I the required system performance;I hardware constraints;I other system;I ...

Stages include:1 Requirements discovery,2 Requirements classification and organization,3 Requirements prioritization and negotiation,4 Requirements specification.

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 24 / 72

Page 34: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

The Requirements Elicitation and Analysis Process

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 25 / 72

Page 35: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Outline

1 Requirements Engineering – A quick overviewFunctional and Non-functional RequirementsRequirements Engineering ProcessesRequirements SpecificationRequirements Validation

2 Formal consistency checking

3 Requirements Management with ReqV

4 Hands-on session on ReqV

5 Conclusions

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 26 / 72

Page 36: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Requirements Specification

The process of writing down the user and system requirements ina requirements document.User requirements have to be understandable by end-users andcustomers who do not have a technical background.System requirements are more detailed requirements and mayinclude more technical information.The requirements may be part of a contract for the systemdevelopmentI It is therefore important that these are as complete as possible.

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 27 / 72

Page 37: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Ways of writing a system requirements specification

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 28 / 72

Page 38: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Natural language specification

Requirements are written as natural language sentencessupplemented by diagrams and tables.

Used for writing requirements because it is expressive, intuitiveand universal.I This means that the requirements can be understood by users and

customers.

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 29 / 72

Page 39: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Guidelines for Writing Requirements

Invent a standard format and use it for all requirements.Use language in a consistent way.I Use shall for mandatory requirements, should for desirable

requirements.

Use text highlighting to identify key parts of the requirement.Avoid the use of computer jargon.Include an explanation (rationale) of why a requirement isnecessary.

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 30 / 72

Page 40: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Problems with Natural Language

Lack of clarityI Precision is difficult without making the document difficult to read.

Requirements confusionI Functional and non-functional requirements tend to be mixed-up.

Requirements amalgamationI Several different requirements may be expressed together.

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 31 / 72

Page 41: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Problems with Natural Language

Lack of clarityI Precision is difficult without making the document difficult to read.

Requirements confusionI Functional and non-functional requirements tend to be mixed-up.

Requirements amalgamationI Several different requirements may be expressed together.

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 31 / 72

Page 42: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Problems with Natural Language

Lack of clarityI Precision is difficult without making the document difficult to read.

Requirements confusionI Functional and non-functional requirements tend to be mixed-up.

Requirements amalgamationI Several different requirements may be expressed together.

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 31 / 72

Page 43: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Structured (natural language) specifications (1/2)

An approach to writing requirements where the freedom of therequirements writer is limited and requirements are written in astandard way.This works well for some types of requirements e.g. requirementsfor embedded control system but is sometimes too rigid for writingbusiness system requirements.

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 32 / 72

Page 44: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Structured (natural language) specifications (2/2)

Form-based specifications1 Definition of the function or entity.2 Description of inputs and where they come from.3 Description of outputs and where they go to.4 Information about the information needed for the computation and

other entities used.5 Description of the action to be taken.6 Pre and post conditions (if appropriate).7 The side effects (if any) of the function.

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 33 / 72

Page 45: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

The Requirements Document

The requirements document is the official statement of what isrequired of the system developers.Should include both a definition of user requirements and aspecification of the system requirements.It is NOT a design document. As far as possible, it should set ofWHAT the system should do rather than HOW it should do it.

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 34 / 72

Page 46: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Users of a Requirements Document

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 35 / 72

Page 47: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Users of a Requirements Document

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 35 / 72

Page 48: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Users of a Requirements Document

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 35 / 72

Page 49: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Users of a Requirements Document

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 35 / 72

Page 50: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Users of a Requirements Document

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 35 / 72

Page 51: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

The Structure of a Requirements Document (1/2)

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 36 / 72

Page 52: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

The Structure of a Requirements Document (2/2)

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 37 / 72

Page 53: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Outline

1 Requirements Engineering – A quick overviewFunctional and Non-functional RequirementsRequirements Engineering ProcessesRequirements SpecificationRequirements Validation

2 Formal consistency checking

3 Requirements Management with ReqV

4 Hands-on session on ReqV

5 Conclusions

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 38 / 72

Page 54: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Requirements validation

Concerned with demonstrating that the requirements define thesystem that the customer really wants.Requirements error costs are high so validation is very importantI Fixing a requirements error after delivery may cost up to 100 times

the cost of fixing an implementation error.

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 39 / 72

Page 55: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Requirements Checking

Validity. Does the system provide the functions which bestsupport the customer’s needs?

Consistency. Are there any requirements conflicts?Completeness. Are all functions required by the customerincluded?Realism. Can the requirements be implemented given availablebudget and technologyVerifiability. Can the requirements be checked?

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 40 / 72

Page 56: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Requirements Checking

Validity. Does the system provide the functions which bestsupport the customer’s needs?Consistency. Are there any requirements conflicts?

Completeness. Are all functions required by the customerincluded?Realism. Can the requirements be implemented given availablebudget and technologyVerifiability. Can the requirements be checked?

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 40 / 72

Page 57: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Requirements Checking

Validity. Does the system provide the functions which bestsupport the customer’s needs?Consistency. Are there any requirements conflicts?Completeness. Are all functions required by the customerincluded?

Realism. Can the requirements be implemented given availablebudget and technologyVerifiability. Can the requirements be checked?

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 40 / 72

Page 58: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Requirements Checking

Validity. Does the system provide the functions which bestsupport the customer’s needs?Consistency. Are there any requirements conflicts?Completeness. Are all functions required by the customerincluded?Realism. Can the requirements be implemented given availablebudget and technology

Verifiability. Can the requirements be checked?

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 40 / 72

Page 59: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Requirements Checking

Validity. Does the system provide the functions which bestsupport the customer’s needs?Consistency. Are there any requirements conflicts?Completeness. Are all functions required by the customerincluded?Realism. Can the requirements be implemented given availablebudget and technologyVerifiability. Can the requirements be checked?

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 40 / 72

Page 60: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Requirements Checking

Validity. Does the system provide the functions which bestsupport the customer’s needs?Consistency. Are there any requirements conflicts?Completeness. Are all functions required by the customerincluded?Realism. Can the requirements be implemented given availablebudget and technologyVerifiability. Can the requirements be checked?

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 41 / 72

Page 61: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Consistency checking

The issue: How to do consistency checking

of requirements expressed in natural language; andin a completed automated way; andexahustively.

Let us see in the second part of the tutorial!

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 42 / 72

Page 62: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Consistency checking

The issue: How to do consistency checkingof requirements expressed in natural language;

andin a completed automated way; andexahustively.

Let us see in the second part of the tutorial!

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 42 / 72

Page 63: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Consistency checking

The issue: How to do consistency checkingof requirements expressed in natural language; andin a completed automated way;

andexahustively.

Let us see in the second part of the tutorial!

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 42 / 72

Page 64: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Consistency checking

The issue: How to do consistency checkingof requirements expressed in natural language; andin a completed automated way; andexahustively.

Let us see in the second part of the tutorial!

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 42 / 72

Page 65: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Consistency checking

The issue: How to do consistency checkingof requirements expressed in natural language; andin a completed automated way; andexahustively.

Let us see in the second part of the tutorial!

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 42 / 72

Page 66: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Outline

1 Requirements Engineering – A quick overviewFunctional and Non-functional RequirementsRequirements Engineering ProcessesRequirements SpecificationRequirements Validation

2 Formal consistency checking

3 Requirements Management with ReqV

4 Hands-on session on ReqV

5 Conclusions

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 43 / 72

Page 67: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Context - Robotic Manipulator

H2020 EU project CERBERO (Cross-layer modEl-based fRamework formulti-oBjective dEsign of Reconfigurable systems in unceRtain hybRid envirOnments)

TasksFind the objectMove to the target positionGrabMove to the bucketRelease the object

The robot should operate with-out damaging itself or the sur-rounding environment.

Trossen Robotics WidowX armwith 4 degrees-of-freedom

and a gripper

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 44 / 72

Page 68: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Context - Robotic Manipulator

H2020 EU project CERBERO (Cross-layer modEl-based fRamework formulti-oBjective dEsign of Reconfigurable systems in unceRtain hybRid envirOnments)

TasksFind the objectMove to the target positionGrabMove to the bucketRelease the object

The robot should operate with-out damaging itself or the sur-rounding environment.

Trossen Robotics WidowX armwith 4 degrees-of-freedom

and a gripper

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 44 / 72

Page 69: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Context - Robotic Manipulator

H2020 EU project CERBERO (Cross-layer modEl-based fRamework formulti-oBjective dEsign of Reconfigurable systems in unceRtain hybRid envirOnments)

TasksFind the object

Move to the target positionGrabMove to the bucketRelease the object

The robot should operate with-out damaging itself or the sur-rounding environment.

Trossen Robotics WidowX armwith 4 degrees-of-freedom

and a gripper

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 44 / 72

Page 70: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Context - Robotic Manipulator

H2020 EU project CERBERO (Cross-layer modEl-based fRamework formulti-oBjective dEsign of Reconfigurable systems in unceRtain hybRid envirOnments)

TasksFind the objectMove to the target position

GrabMove to the bucketRelease the object

The robot should operate with-out damaging itself or the sur-rounding environment.

Trossen Robotics WidowX armwith 4 degrees-of-freedom

and a gripper

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 44 / 72

Page 71: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Context - Robotic Manipulator

H2020 EU project CERBERO (Cross-layer modEl-based fRamework formulti-oBjective dEsign of Reconfigurable systems in unceRtain hybRid envirOnments)

TasksFind the objectMove to the target positionGrab

Move to the bucketRelease the object

The robot should operate with-out damaging itself or the sur-rounding environment.

Trossen Robotics WidowX armwith 4 degrees-of-freedom

and a gripper

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 44 / 72

Page 72: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Context - Robotic Manipulator

H2020 EU project CERBERO (Cross-layer modEl-based fRamework formulti-oBjective dEsign of Reconfigurable systems in unceRtain hybRid envirOnments)

TasksFind the objectMove to the target positionGrabMove to the bucket

Release the objectThe robot should operate with-out damaging itself or the sur-rounding environment.

Trossen Robotics WidowX armwith 4 degrees-of-freedom

and a gripper

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 44 / 72

Page 73: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Context - Robotic Manipulator

H2020 EU project CERBERO (Cross-layer modEl-based fRamework formulti-oBjective dEsign of Reconfigurable systems in unceRtain hybRid envirOnments)

TasksFind the objectMove to the target positionGrabMove to the bucketRelease the object

The robot should operate with-out damaging itself or the sur-rounding environment.

Trossen Robotics WidowX armwith 4 degrees-of-freedom

and a gripper

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 44 / 72

Page 74: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Context - Robotic Manipulator

H2020 EU project CERBERO (Cross-layer modEl-based fRamework formulti-oBjective dEsign of Reconfigurable systems in unceRtain hybRid envirOnments)

TasksFind the objectMove to the target positionGrabMove to the bucketRelease the object

The robot should operate with-out damaging itself or the sur-rounding environment.

Trossen Robotics WidowX armwith 4 degrees-of-freedom

and a gripper

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 44 / 72

Page 75: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Robotic Manipulator Requirements

SafetyThe joint1 speed should never exceed 90 degrees/s.

State EvolutionThe successors of grabbing state are move-to-target or alarmstates.

Conditional EventsIf the proximity sensor detects an obstacle, the robot arm shouldstop.

Mutual ExclusionThe controller can be in only one state at a time.

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 45 / 72

Page 76: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Requirements Consistency Check

Encode each requirement into Linear Temporal LogicReduce the consistency check to the LTL satisfiability check.

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 46 / 72

Page 77: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Requirements Consistency Check

Encode each requirement into Linear Temporal Logic

Reduce the consistency check to the LTL satisfiability check.

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 46 / 72

Page 78: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Requirements Consistency Check

Encode each requirement into Linear Temporal LogicReduce the consistency check to the LTL satisfiability check.

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 46 / 72

Page 79: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Robotic Manipulator Requirements - LTL

SafetyThe joint1 speed should never exceed 90 degrees/s.

�(¬(joint1gt90))

State EvolutionThe successors of grabbing state are move-to-target or alarm

�¬s_grabbing ∨ ♦(s_grabbing ∧ ♦(s_movetotarget ∨ s_alarm))

Conditional EventsIf the proximity sensor detects an obstacle, the robot arm shouldstop.

�(object_detected → ♦arm_idle)

Mutual ExclusionThe controller can be in only one state at a time.

�(s_init → ¬(s_grabbing ∨ s_state_alarm ∨ ...)) ∧�(state_grabbing → ...) ∧ ...

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 47 / 72

Page 80: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Robotic Manipulator Requirements - LTL

SafetyThe joint1 speed should never exceed 90 degrees/s.�(¬(joint1gt90))

State EvolutionThe successors of grabbing state are move-to-target or alarm�¬s_grabbing ∨ ♦(s_grabbing ∧ ♦(s_movetotarget ∨ s_alarm))

Conditional EventsIf the proximity sensor detects an obstacle, the robot arm shouldstop.�(object_detected → ♦arm_idle)

Mutual ExclusionThe controller can be in only one state at a time.�(s_init → ¬(s_grabbing ∨ s_state_alarm ∨ ...)) ∧�(state_grabbing → ...) ∧ ...

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 47 / 72

Page 81: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Issues

High Level SkillsLTL is far from the natural language.

Lack of expressivenessR1 “The angle of joint1 shall never be greater than 170 degrees”.R2 “After the MOTOR_SPEED signal arrived, the angle of joint1 shall

never be lower than 90 degrees”.

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 48 / 72

Page 82: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Property Specification Patterns

Issue 1 calls for a language that is “more” Natural and “less” Formal.

Property Specification PatternsPSPs are a collection of parameterizable, high-level,formalism-independent specification abstractions, originally developedto capture recurring solutions to the needs of requirement engineering.

Each pattern isparameterizablewritten in natural languagedirectly encoded in a formal language(LTL/CTL/...)

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 49 / 72

Page 83: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Property Specification Patterns

Issue 1 calls for a language that is “more” Natural and “less” Formal.

Property Specification PatternsPSPs are a collection of parameterizable, high-level,formalism-independent specification abstractions, originally developedto capture recurring solutions to the needs of requirement engineering.

Each pattern isparameterizablewritten in natural languagedirectly encoded in a formal language(LTL/CTL/...)

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 49 / 72

Page 84: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Property Specification Patterns

Issue 1 calls for a language that is “more” Natural and “less” Formal.

Property Specification PatternsPSPs are a collection of parameterizable, high-level,formalism-independent specification abstractions, originally developedto capture recurring solutions to the needs of requirement engineering.

Each pattern isparameterizablewritten in natural languagedirectly encoded in a formal language(LTL/CTL/...)

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 49 / 72

Page 85: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

PSPBodyThe body of a pattern, describes the behavior that we want to specify.

ScopeThe scope is the extent of the program execution over which thepattern must hold.

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 50 / 72

Page 86: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

PSPBodyThe body of a pattern, describes the behavior that we want to specify.

ScopeThe scope is the extent of the program execution over which thepattern must hold.

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 50 / 72

Page 87: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

PSP example: Response Pattern

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 51 / 72

Page 88: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Constraint System

Issue 2 calls for atomic constraint.

Constraint System DD = (D,R1, . . . ,Rn, I),

D is a non-empty set called domain,Ri is a predicate symbol of arity ai ,I(Ri) ⊆ Dai it is the interpretation of Ri over the domain Dai

Given a set of variables X and a set of constants C such thatC ∩ X = ∅,A term is a member of the set T = C ∪ X ;

Ri(t1, . . . , tai ) is an (atomic) D-constraint over a set of terms Twhere 1 ≤ i ≤ n and tj ∈ T for all 1 ≤ j ≤ ai

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 52 / 72

Page 89: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Constraint System

Issue 2 calls for atomic constraint.

Constraint System DD = (D,R1, . . . ,Rn, I),

D is a non-empty set called domain,Ri is a predicate symbol of arity ai ,I(Ri) ⊆ Dai it is the interpretation of Ri over the domain Dai

Given a set of variables X and a set of constants C such thatC ∩ X = ∅,A term is a member of the set T = C ∪ X ;

Ri(t1, . . . , tai ) is an (atomic) D-constraint over a set of terms Twhere 1 ≤ i ≤ n and tj ∈ T for all 1 ≤ j ≤ ai

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 52 / 72

Page 90: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Constraint Property Specification Pattern

PSP(D)A Constraint Property Specification Pattern is a PSP wherespecification contains both boolean and atoms from a constraintsystem D.

restrictionDC = (R,<,=)with atomic constraints of the form x < c and x = c, where c is aconstant in R

PSP(Dc)is a PSP(D) system where atomic constraint are in the form of x < c orx = c (c ∈ R).

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 53 / 72

Page 91: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Constraint Property Specification Pattern

PSP(D)A Constraint Property Specification Pattern is a PSP wherespecification contains both boolean and atoms from a constraintsystem D.

restrictionDC = (R,<,=)with atomic constraints of the form x < c and x = c, where c is aconstant in R

PSP(Dc)is a PSP(D) system where atomic constraint are in the form of x < c orx = c (c ∈ R).

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 53 / 72

Page 92: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Constraint Property Specification Pattern

PSP(D)A Constraint Property Specification Pattern is a PSP wherespecification contains both boolean and atoms from a constraintsystem D.

restrictionDC = (R,<,=)with atomic constraints of the form x < c and x = c, where c is aconstant in R

PSP(Dc)is a PSP(D) system where atomic constraint are in the form of x < c orx = c (c ∈ R).

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 53 / 72

Page 93: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Robotic Manipulator Requirements - PSP(DC)SafetyThe joint1 speed should never exceed 90 degrees/s.

Globally, it is never the case that joint1_speed > 90

holds.

State EvolutionThe successors of grabbing state are move-to-target or alarm

After state_grabbing, state_moving_to_bucket or state_alarm

eventually holds.

Conditional EventsIf the proximity sensor detects an obstacle, the robot arm shouldstop.

Globally, it is always the case that if proximity_sensor <

20 holds, then arm_idle eventually holds.

Mutual ExclusionThe controller can be in only one state at a time.

Globally, it is always the case that if state_init holds,then not (state_scanning or state_moving_to_target or ...)holds as well.

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 54 / 72

Page 94: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Robotic Manipulator Requirements - PSP(DC)SafetyThe joint1 speed should never exceed 90 degrees/s.Globally, it is never the case that joint1_speed > 90

holds.

State EvolutionThe successors of grabbing state are move-to-target or alarmAfter state_grabbing, state_moving_to_bucket or state_alarm

eventually holds.

Conditional EventsIf the proximity sensor detects an obstacle, the robot arm shouldstop.Globally, it is always the case that if proximity_sensor <

20 holds, then arm_idle eventually holds.

Mutual ExclusionThe controller can be in only one state at a time.Globally, it is always the case that if state_init holds,then not (state_scanning or state_moving_to_target or ...)holds as well.

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 54 / 72

Page 95: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Linear Temporal Logic (LTL) - 1/2

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 55 / 72

Page 96: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Linear Temporal Logic (LTL) - 2/2

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 56 / 72

Page 97: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Linear Temporal Logic modulo Constraint

PSP system encode requirements directly in LTL. What aboutPSP(DC)?

The Linear Temporal Logic modulo Constraint (LTL(D)) is an extensionof LTL with atoms in a constraint system D.

φ = p | Ri(t1, . . . , tai ) | ¬φ1 | φ1 ∨ φ2 | X φ1 | φ1 U φ2

whereProp is a set of Boolean PropositionsD = (D,R1, . . . ,Rn, I) is a constraint systemT = C ∪ X is a set of terms

abbreviations

we consider p ∨ ¬p as >, p ∧ ¬p as ⊥, “∧” and “→”, ♦φ (“eventually”) denote >U φ and �φ (“always”) denote ¬♦¬φ.

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 57 / 72

Page 98: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Linear Temporal Logic modulo Constraint

PSP system encode requirements directly in LTL. What aboutPSP(DC)?

The Linear Temporal Logic modulo Constraint (LTL(D)) is an extensionof LTL with atoms in a constraint system D.

φ = p | Ri(t1, . . . , tai ) | ¬φ1 | φ1 ∨ φ2 | X φ1 | φ1 U φ2

whereProp is a set of Boolean PropositionsD = (D,R1, . . . ,Rn, I) is a constraint systemT = C ∪ X is a set of terms

abbreviations

we consider p ∨ ¬p as >, p ∧ ¬p as ⊥, “∧” and “→”, ♦φ (“eventually”) denote >U φ and �φ (“always”) denote ¬♦¬φ.

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 57 / 72

Page 99: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Consistency Check

PSP(Dc) encoding into LTL(Dc) follows the PSP to LTL encoding

The consistency check of a set of PSP(DC) requirement is encodedinto a satisfiability of a LTL(Dc).

Unluckily, to the best of our knowledge there is still not a toolcomputing the satisfiability of a LTL(Dc) formula.

Luckily a LTL(Dc) formula can be reduced to a LTL formula.

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 58 / 72

Page 100: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Consistency Check

PSP(Dc) encoding into LTL(Dc) follows the PSP to LTL encoding

The consistency check of a set of PSP(DC) requirement is encodedinto a satisfiability of a LTL(Dc).

Unluckily, to the best of our knowledge there is still not a toolcomputing the satisfiability of a LTL(Dc) formula.

Luckily a LTL(Dc) formula can be reduced to a LTL formula.

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 58 / 72

Page 101: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Consistency Check

PSP(Dc) encoding into LTL(Dc) follows the PSP to LTL encoding

The consistency check of a set of PSP(DC) requirement is encodedinto a satisfiability of a LTL(Dc).

Unluckily, to the best of our knowledge there is still not a toolcomputing the satisfiability of a LTL(Dc) formula.

Luckily a LTL(Dc) formula can be reduced to a LTL formula.

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 58 / 72

Page 102: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Consistency Check

PSP(Dc) encoding into LTL(Dc) follows the PSP to LTL encoding

The consistency check of a set of PSP(DC) requirement is encodedinto a satisfiability of a LTL(Dc).

Unluckily, to the best of our knowledge there is still not a toolcomputing the satisfiability of a LTL(Dc) formula.

Luckily a LTL(Dc) formula can be reduced to a LTL formula.

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 58 / 72

Page 103: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

LTL(Dc) reduction to LTL

Given a LTL(Dc) formula, φ, letA(φ) be the set of atomic constraint in φ (x < c and x = c)X (φ) be the set of variables occurring in A(φ)C(φ) be the set of constants that occur in A(φ).Sx(φ) ⊆ C(φ) be the set of constants occurring in each atomicconstraint where the variable x occurs (ordered ascending)

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 59 / 72

Page 104: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

LTL(Dc) reduction to LTL

ExampleR1 Globally, it is always the case that v ≤ 5.0 holds.R2 After a, v ≤ 8.5 eventually holds.R3 After a, it is always the case that if v ≥ 3.2 holds, then z eventually

holds.

A(φ) = {v < 5.0, v = 5.0, v < 8.5, v = 8.5, v < 3.2}X (φ) = {v}C(φ) = {3.2,5.0,8.5}.Sv (φ) = {3.2,5.0,8.5}.

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 60 / 72

Page 105: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

LTL(Dc) reduction to LTLGiven Sx(φ) we construct two sets of boolean proposition, Qx and Ex

Qv = {q1,q2,q3} and Ev = {e1,e2,e3}.We substitute in φ each atomic proposition with x , as follows

x < tk k∨

j=1

qj ∨k−1∨j=1

ej and x = tk ek .

For example x < 8.5 {q1 ∨ q2 ∨ q3 ∨ e1 ∨ e2}

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 61 / 72

Page 106: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

LTL(Dc) reduction to LTLGiven Sx(φ) we construct two sets of boolean proposition, Qx and Ex

Qv = {q1,q2,q3} and Ev = {e1,e2,e3}.We substitute in φ each atomic proposition with x , as follows

x < tk k∨

j=1

qj ∨k−1∨j=1

ej and x = tk ek .

For example x < 8.5 {q1 ∨ q2 ∨ q3 ∨ e1 ∨ e2}

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 61 / 72

Page 107: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

LTL(Dc) reduction to LTLGiven Sx(φ) we construct two sets of boolean proposition, Qx and Ex

Qv = {q1,q2,q3} and Ev = {e1,e2,e3}.

We substitute in φ each atomic proposition with x , as follows

x < tk k∨

j=1

qj ∨k−1∨j=1

ej and x = tk ek .

For example x < 8.5 {q1 ∨ q2 ∨ q3 ∨ e1 ∨ e2}

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 61 / 72

Page 108: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

LTL(Dc) reduction to LTLGiven Sx(φ) we construct two sets of boolean proposition, Qx and Ex

Qv = {q1,q2,q3} and Ev = {e1,e2,e3}.We substitute in φ each atomic proposition with x , as follows

x < tk k∨

j=1

qj ∨k−1∨j=1

ej and x = tk ek .

For example x < 8.5 {q1 ∨ q2 ∨ q3 ∨ e1 ∨ e2}

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 61 / 72

Page 109: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

LTL(Dc) reduction to LTLGiven Sx(φ) we construct two sets of boolean proposition, Qx and Ex

Qv = {q1,q2,q3} and Ev = {e1,e2,e3}.We substitute in φ each atomic proposition with x , as follows

x < tk k∨

j=1

qj ∨k−1∨j=1

ej and x = tk ek .

For example x < 8.5 {q1 ∨ q2 ∨ q3 ∨ e1 ∨ e2}

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 61 / 72

Page 110: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

LTL(Dc) reduction to LTL

�(v < 5.0 ∨ v = 5.0) �(q1 ∨ q2 ∨ e1 ∨ e2)�(a→ ♦(v < 8.5) ∨ (v = 8.5)) �(a→ ♦(q1 ∨ q2 ∨ q3 ∨ e1 ∨ e2 ∨ e3))�(a→ �(v ≥ 3.2→ ♦z)) �(a→ �((q2 ∨ q3 ∨ e1 ∨ e2 ∨ e3)→ ♦z))

Consistency may report wrong resultsA satisfiable formula may be satisfiable only by models containing conflicting booleanatoms such as q1 (encoding of x ≤ 3.2) and q2 (encoding of 3.2 ≤ x ≤ 5.0).

Mutual ExclusionGiven any two boolean variables in Qξ(φ) ∪ Eξ(φ), they can not be true at the sametime.

φM =∧

ξ∈X(φ)

∧a,b∈Mξ(φ),a 6=b

�¬(a ∧ b)

(1)

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 62 / 72

Page 111: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

LTL(Dc) reduction to LTL

�(v < 5.0 ∨ v = 5.0) �(q1 ∨ q2 ∨ e1 ∨ e2)�(a→ ♦(v < 8.5) ∨ (v = 8.5)) �(a→ ♦(q1 ∨ q2 ∨ q3 ∨ e1 ∨ e2 ∨ e3))�(a→ �(v ≥ 3.2→ ♦z)) �(a→ �((q2 ∨ q3 ∨ e1 ∨ e2 ∨ e3)→ ♦z))

Consistency may report wrong resultsA satisfiable formula may be satisfiable only by models containing conflicting booleanatoms such as q1 (encoding of x ≤ 3.2) and q2 (encoding of 3.2 ≤ x ≤ 5.0).

Mutual ExclusionGiven any two boolean variables in Qξ(φ) ∪ Eξ(φ), they can not be true at the sametime.

φM =∧

ξ∈X(φ)

∧a,b∈Mξ(φ),a 6=b

�¬(a ∧ b)

(1)

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 62 / 72

Page 112: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

LTL(Dc) reduction to LTL

�(v < 5.0 ∨ v = 5.0) �(q1 ∨ q2 ∨ e1 ∨ e2)�(a→ ♦(v < 8.5) ∨ (v = 8.5)) �(a→ ♦(q1 ∨ q2 ∨ q3 ∨ e1 ∨ e2 ∨ e3))�(a→ �(v ≥ 3.2→ ♦z)) �(a→ �((q2 ∨ q3 ∨ e1 ∨ e2 ∨ e3)→ ♦z))

Consistency may report wrong resultsA satisfiable formula may be satisfiable only by models containing conflicting booleanatoms such as q1 (encoding of x ≤ 3.2) and q2 (encoding of 3.2 ≤ x ≤ 5.0).

Mutual ExclusionGiven any two boolean variables in Qξ(φ) ∪ Eξ(φ), they can not be true at the sametime.

φM =∧

ξ∈X(φ)

∧a,b∈Mξ(φ),a 6=b

�¬(a ∧ b)

(1)

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 62 / 72

Page 113: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

LTL(Dc) satisfiability via Model Checking

Given a set of requirements in PSP(Dc)

we encode them in a formula LTL(Dc), φwe construct the the formula φM → φ′,we construct the universal model M, i.e. a model that encodes allthe possible computation over a set of Prop.φM → φ′ is satisfiable precisely when M does not satisfy itsnegation.

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 63 / 72

Page 114: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

LTL(Dc) satisfiability via Model Checking

Given a set of requirements in PSP(Dc)

we encode them in a formula LTL(Dc), φwe construct the the formula φM → φ′,we construct the universal model M, i.e. a model that encodes allthe possible computation over a set of Prop.φM → φ′ is satisfiable precisely when M does not satisfy itsnegation.

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 63 / 72

Page 115: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

LTL(Dc) satisfiability via Model Checking

Given a set of requirements in PSP(Dc)we encode them in a formula LTL(Dc), φ

we construct the the formula φM → φ′,we construct the universal model M, i.e. a model that encodes allthe possible computation over a set of Prop.φM → φ′ is satisfiable precisely when M does not satisfy itsnegation.

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 63 / 72

Page 116: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

LTL(Dc) satisfiability via Model Checking

Given a set of requirements in PSP(Dc)we encode them in a formula LTL(Dc), φwe construct the the formula φM → φ′,

we construct the universal model M, i.e. a model that encodes allthe possible computation over a set of Prop.φM → φ′ is satisfiable precisely when M does not satisfy itsnegation.

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 63 / 72

Page 117: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

LTL(Dc) satisfiability via Model Checking

Given a set of requirements in PSP(Dc)we encode them in a formula LTL(Dc), φwe construct the the formula φM → φ′,we construct the universal model M, i.e. a model that encodes allthe possible computation over a set of Prop.

φM → φ′ is satisfiable precisely when M does not satisfy itsnegation.

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 63 / 72

Page 118: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

LTL(Dc) satisfiability via Model Checking

Given a set of requirements in PSP(Dc)we encode them in a formula LTL(Dc), φwe construct the the formula φM → φ′,we construct the universal model M, i.e. a model that encodes allthe possible computation over a set of Prop.φM → φ′ is satisfiable precisely when M does not satisfy itsnegation.

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 63 / 72

Page 119: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Summing up

We extended basic PSPs over the constraint system Dc

We provided an encoding from any PSP(Dc) into a LTL formulaWe showed how to check the consistency of a set of requirementswritten a PSP(Dc) by reduction to model checking problemOur approach scales on realistically sized sets of requirementsOur approach is feasible to check specifications and uncoverinjected faults

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 64 / 72

Page 120: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Outline

1 Requirements Engineering – A quick overviewFunctional and Non-functional RequirementsRequirements Engineering ProcessesRequirements SpecificationRequirements Validation

2 Formal consistency checking

3 Requirements Management with ReqV

4 Hands-on session on ReqV

5 Conclusions

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 65 / 72

Page 121: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Requirements Management with ReqV

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 66 / 72

Page 122: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Outline

1 Requirements Engineering – A quick overviewFunctional and Non-functional RequirementsRequirements Engineering ProcessesRequirements SpecificationRequirements Validation

2 Formal consistency checking

3 Requirements Management with ReqV

4 Hands-on session on ReqV

5 Conclusions

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 67 / 72

Page 123: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Hands-on session on ReqV

https://reqv.sagelab.it/

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 68 / 72

Page 124: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Outline

1 Requirements Engineering – A quick overviewFunctional and Non-functional RequirementsRequirements Engineering ProcessesRequirements SpecificationRequirements Validation

2 Formal consistency checking

3 Requirements Management with ReqV

4 Hands-on session on ReqV

5 Conclusions

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 69 / 72

Page 125: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Conclusion (1/2)

Requirements for a system set out what the system should do anddefine constraints on its operation and implementation.

Functional requirements are statements of the services that thesystem must provide or are descriptions of how somecomputations must be carried out.

Non-functional requirements often constrain the system beingdeveloped and the development process being used.

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 70 / 72

Page 126: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Conclusion (2/2)

The requirements engineering process is an iterative process thatincludes requirements elicitation, specification and validation.

Requirements specification is the process of formally documentingthe user and system requirements and creating a requirementsdocument.

Requirements validation is the process of checking therequirements for validity, consistency, completeness, realism andverifiability.

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 71 / 72

Page 127: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Acknowledgments

ReqV and related research is a joint work with our colleagueMassimo Narizzano (University of Genoa).This work is partially funded by the EU Commission H2020Programme under grant agreement N.732105 (CERBEROproject).

Please, fill the questionnaire!

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 72 / 72

Page 128: 1cm Requirements Verification in CPSs€¦ · Functional and Non-functional Requirements Functional requirements Statements of services the system should provide I How the system

Acknowledgments

ReqV and related research is a joint work with our colleagueMassimo Narizzano (University of Genoa).This work is partially funded by the EU Commission H2020Programme under grant agreement N.732105 (CERBEROproject).

Please, fill the questionnaire!

Pulina, Tacchella, Vuotto (UNISS & UNIGE) Requirements Verification in CPSs CPS Summer School 2018 72 / 72