introduction to kaos goal modeling

24
1/25/21 1 MDE RE SE Introduction to KAOS Goal Modeling Acknowledgements: Erik Fredericks MDE RE SE What is goal modeling? Goal modeling with KAOS Models at run time Agenda

Upload: others

Post on 26-Feb-2022

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Introduction to KAOS Goal Modeling

1/25/21

1

MDERE

SE

Introduction to KAOS Goal Modeling

Acknowledgements: Erik Fredericks

MDERE

SE

• What is goal modeling?• Goal modeling with KAOS• Models at run time

Agenda

Page 2: Introduction to KAOS Goal Modeling

1/25/21

2

MDERE

SE

• What is a goal?– Representation of stakeholder objectives

• Who are the stakeholders?– Anybody interested in system

• Developers, customers, maintainers, etc.

• What is a goal model?– Hierarchical arrangement of goals– Demonstrates relationships between goals

What is goal modeling?

MDERE

SE

• Examples of goals:– Camera sensor must have 180 degree field

of view– Radar sensor is always on– All sensors must provide reliable data

• Examples of non-goals:– Camera software implemented in C– Radar housing painted red

What are goals?

Page 3: Introduction to KAOS Goal Modeling

1/25/21

3

MDERE

SE

• Goals can be decomposed from high-level objectives to low-level requirements

• Each goal refined with sub-goals that define how it can be satisfied

• Leaf-level goals are considered to be requirements

Goal hierarchy

MDERE

SEGoal hierarchy

Goal A

Goal CGoal B

… …

Page 4: Introduction to KAOS Goal Modeling

1/25/21

4

MDERE

SE

• Autonomous vehicle– Different types of sensors

• E.g., camera and radar

– Main objective: keep vehiclewithin lane

Running Example

MDERE

SE

• Order these goals from high level to low level– Camera sensor provides data to

processing unit– Vehicle must always stay within lane

markings– Camera sensor must always be ON– Camera sensor detects objects within 10

meters

High-level vs. low-level goals

Page 5: Introduction to KAOS Goal Modeling

1/25/21

5

MDERE

SE

• Order these goals from high level to low level– Camera sensor provides data to

processing unit– (1) Vehicle must always stay within lane

markings– Camera sensor must always be ON– Camera sensor detects objects within 10

meters

High-level vs. low-level goals

MDERE

SE

• Order these goals from high level to low level– (2) Camera sensor provides data to

processing unit– (1) Vehicle must always stay within lane

markings– Camera sensor must always be ON– Camera sensor detects objects within 10

meters

High-level vs. low-level goals

Page 6: Introduction to KAOS Goal Modeling

1/25/21

6

MDERE

SE

• Order these goals from high level to low level– (2) Camera sensor provides data to

processing unit– (1) Vehicle must always stay within lane

markings– Camera sensor must always be ON– (3) Camera sensor detects objects within

10 meters

High-level vs. low-level goals

MDERE

SE

• Order these goals from high level to low level– (2) Camera sensor provides data to

processing unit– (1) Vehicle must always stay within lane

markings– (4) Camera sensor must always be ON– (3) Camera sensor detects objects within

10 meters

High-level vs. low-level goals

Page 7: Introduction to KAOS Goal Modeling

1/25/21

7

MDERE

SE

• Order these goals from high level to low level– Vehicle must always stay within lane

markings– Camera sensor provides data to

processing unit– Camera sensor detects objects within 10

meters– Camera sensor must always be ON

High-level vs. low-level goals

MDERE

SE

• Functional goals– “Hard” goals– Functions that system will perform– Well-defined criteria for satisfaction– E.g., vehicle always stays within lane markings

• Non-functional goals– “Soft” goals– Desired system qualities– Hard to define and quantify– Reliability– Quality– E.g., automatic stop is not jarring to passenger

Types of goals

Page 8: Introduction to KAOS Goal Modeling

1/25/21

8

MDERE

SE

• Safety goals– Ensure system consistently runs safely– Does not endanger people or system itself– E.g., sensor automatically shuts off if

voltage exceeds maximum

• Failsafe goals– Provide safe fallback state in case of error– E.g., system shuts off if camera sensor is

damaged

Types of goals

MDERE

SE

• Identify the goals in the following paragraph:Company X is designing a new autonomous vehicle. Their autonomous vehicle system comprises at least two sensors: a camera and a radar. Both the camera and radar are responsible for sensing objects at a minimum distance of 10 meters. These sensors can communicate to a CPU via a secure CAN bus, at which point the CPU parses the incoming data. For safety purposes, at least one sensor must be active at all times.

Goal exercise

Page 9: Introduction to KAOS Goal Modeling

1/25/21

9

MDERE

SE

• Identify the goals in the following paragraph:Company X is designing a new autonomous vehicle. Their autonomous vehicle system comprises at least two sensors: a camera and a radar. Both the camera and radar are responsible for sensing objects at a minimum distance of 10 meters. These sensors can communicate to a CPU via a secure CAN bus, at which point the CPU parses the incoming data. For safety purposes, at least one sensor must be active at all times.

Goal exercise

MDERE

SE

• Provide rationale for requirements• Identify stable information in system

objectives• Guide requirements elaboration /

elicitation• Provide visual depiction of relationships

and dependencies between objectives

Why do we use goal models?

Page 10: Introduction to KAOS Goal Modeling

1/25/21

10

MDERE

SE

• Early in requirements engineering process– Identify problems– Explore solutions and alternatives– Performed prior to UML modeling– Continually refine goal model as new

requirements or obstacles surface

When to use goal models

Late RE Design Code Test

Why? What? How?

Early RE

MDERE

SE

• Different approaches exist for creating goal models– KAOS, i*, UML (use cases)

• We will be using KAOS in this class for goal modeling

Goal modeling with KAOS

Page 11: Introduction to KAOS Goal Modeling

1/25/21

11

MDERE

SE

• Refine goals into requirements• Objects in KAOS goal model

– Goal– Agent– Requirement / Expectation– Refinements

KAOS notation

MDERE

SEKAOS notation

Vehicle remains within lane markings

Detect objects within 10m

Send image data to

processing unit

Camera always ON

(A)

(D)

(B) (C)

(E)Camera feed is always valid

Camera

Page 12: Introduction to KAOS Goal Modeling

1/25/21

12

MDERE

SE

• Goals

KAOS notationVehicle

remains within lane markings

Detect objects within

10m

Send image data to

processing unit

Camera always ON

(A)

(D)

(B) (C)

(E)Camera feed is always valid

Camera

MDERE

SE

• Agent– Agent can be human or sensor

KAOS notationVehicle

remains within lane markings

Detect objects within 10m

Send image data to

processing unit

Camera always ON

(A)

(D)

(B) (C)

(E)Camera feed is always valid

Camera

Page 13: Introduction to KAOS Goal Modeling

1/25/21

13

MDERE

SE

• Requirement / Expectation• Requirement:

– Automated component responsible• Expectation:

– Environment responsible

KAOS notationVehicle

remains within lane markings

Detect objects within

10m

Send image data to

processing unit

Camera always ON

(A)

(D)

(B) (C)

(E)Camera feed is always valid

Camera

MDERE

SEKAOS notation

AND-refinement

Vehicle remains within lane markings

Detect objects within

10m

Send image data to

processing unit

Camera always ON

(A)

(D)

(B) (C)

(E)Camera feed is always valid

Camera

Page 14: Introduction to KAOS Goal Modeling

1/25/21

14

MDERE

SEKAOS notation

OR-refinement

Vehicle remains within lane markings

Detect objects within 10m

Send image data to

processing unit

Camera always ON

(A)

(D)

(B) (C)

(E)Camera feed is always valid

Camera

MDERE

SE

• Invariant– Must ALWAYS be satisfied– Safety, failsafe, or system invariants– E.g., vehicle can never collide with an

obstacle

• Non-invariant– Temporarily tolerate unsatisfied goal– Transient conditions– E.g., sensor temporarily occluded

Goal categories

Page 15: Introduction to KAOS Goal Modeling

1/25/21

15

MDERE

SEGoal examples

Vehicle remains within lane markings

Detect objects within

10m

Send image data to

processing unit

Camera always

ON

(A)

(D)

(B) (C)

(E)Camera feed

is always valid

Camera

MDERE

SEGoal examples

Vehicle remains within lane markings

(A)

(D)Maintain[Vehicle

remains within lane markings]

Invariant goal

(A)

(Avoid also considered invariant)E.g., Avoid [Collision]

Page 16: Introduction to KAOS Goal Modeling

1/25/21

16

MDERE

SEGoal examples

Maintain[Vehicle remains

within lane markings]

Detect objects within

10m

Send image data to

processing unit

Camera always

ON

(A)

(D)

(B) (C)

(E)Camera feed

is always valid

Camera

MDERE

SEGoal examples

Detect objects within

10m(D)

Achieve[Detect objects

within 10m](D)

Non-invariantgoal

Page 17: Introduction to KAOS Goal Modeling

1/25/21

17

MDERE

SEGoal examples

Maintain[Vehicle remains

within lane markings]

Achieve[Detect objects

within 10m]

Achieve [Send image data to

processing unit]

Achieve[Camera

always ON]

(A)

(D)

(B) (C)

(E)Achieve

[Camera feed is always valid]

Camera

MDERE

SE

• All have been functional so far…

• What about non-functional?– Soft / fuzzy goals?

Goal examplesMaintain

[Vehicle remains within lane markings]

Achieve[Detect objects

within 10m]

Achieve [Send image data to

processing unit]

Achieve[Camera

always ON]

(A)

(D)

(B) (C)

(E)Achieve

[Camera feed is always valid]

Camera

Page 18: Introduction to KAOS Goal Modeling

1/25/21

18

MDERE

SEGoal examples

Maintain[Vehicle remains

within lane markings]

Achieve[Detect objects

within 10m]

Achieve [Send image data to

processing unit]

Achieve[Camera

always ON]

(A)

(D)

(B) (C)

(E)Achieve

[Camera feed is always valid]

Camera

Achieve[Vehicle drives

smoothly](F)

MDERE

SEGoal examples

Maintain[Vehicle remains

within lane markings]

Achieve[Detect objects

within 10m]

Achieve [Send image data to

processing unit]

Achieve[Camera

always ON]

(A)

(D)

(B) (C)

(E)Achieve

[Camera feed is always valid]

Camera

Achieve[Vehicle drives

smoothly](F)

No difference between functional and non-functional goal in KAOS!

Page 19: Introduction to KAOS Goal Modeling

1/25/21

19

MDERE

SE

• Goal models can provide measure of system performance

• Is system satisfying its invariants

• How well is system satisfying its non-invariants?

Using models at run time

MDERE

SE

• Derived mathematical function for each goal

• Provides degree of satisfaction for each goal

• Normalized on [0.0, 1.0]– 0.0 è goal is violated– 1.0 è goal is satisfied– (0.0,1.0) è goal is satisfied to some

degree (i.e., “satisficed”)

Utility functions

Page 20: Introduction to KAOS Goal Modeling

1/25/21

20

MDERE

SEMaintain

[Vehicle remains within lane markings]

Detect objects within

10m

Send image data to

processing unit

Camera always

ON

(A)

(D)

(B) (C)

(E)Camera feed

is always valid

Camera

Goal examples

Invariants are typically Boolean functions

Goal (A) = 1.0 if vehicle has never crossed lane boundaryGoal (A) = 0.0 otherwiseAlso, Goal (A) = 0.0 if (Goal (B) = 0.0) OR (Goal (C) = 0.0)

MDERE

SEMaintain

[Vehicle remains within lane markings]

Detect objects within

10m

Send image data to

processing unit

Camera always

ON

(A)

(D)

(B) (C)

(E)Camera feed

is always valid

Camera

Goal examples

Non-invariants are typically real functions

Goal (C) = 1.0 – |distancedetected – distancemax|distancemax

Detected at 8m instead of 10m

Goal (C) = 1.0 - |8.0-10.0|10.0

Goal (C) = 0.8

Page 21: Introduction to KAOS Goal Modeling

1/25/21

21

MDERE

SE

• Determine if an objective has been violated– Or, determine if an objective is not being

satisfied enough

• Refactor goal model• Introduce a bugfix or patch• Reconfigure system

What can we do with a utility value?

MDERE

SE

• Derive goal model based on requirements specification for your term project

• Must have at minimum:– (2) Invariant goals– (6) Non-invariant goals– (3) System agents– (2) AND- and (2) OR- refinements

Assignment Part 1

Page 22: Introduction to KAOS Goal Modeling

1/25/21

22

MDERE

SE

• Responsibility models• Operation models• Object models• Obstacle models

Other types of KAOS models

MDERE

SE

• Describes:– Agent– Requirements/expectations agent is

responsible for

Responsibility models

Camera

Camera always

ONCamera

feed valid

……

Page 23: Introduction to KAOS Goal Modeling

1/25/21

23

MDERE

SE

• Defines an obstacle to goal satisfaction• Attempt to identify resolve obstacles in

advance by refining goal model

Obstacle models

Camera

Camera sensor

damaged

Camera

Camera performs self-diagnostics

MDERE

SEObstacles

http://arquivo.devmedia.com.br/artigos/Rafael_Julian/re-tools/image006.png

Achieve [Train stopped at Entry if stop signal]

Stop Signal and Not [Train Stopped at Block Entry]

Signal not visible Driver unresponsive

Brake system down

Achieve [Responsiveness check sent regularly]

Page 24: Introduction to KAOS Goal Modeling

1/25/21

24

MDERE

SE

• For your original goal model:– Define at least 2 utility functions to assess

the satisfaction and/or satisficement of a goal– Identify sources of uncertainty and how to

account for them in your goal model? • Define an obstacle model to complement

your homework assignment– Define (2) obstacles to the success of your

goal model– Provide a strategy for resolving each

Assignment Part 2