Pertemuan 3 Adv SWE 2021

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 54

SPLE

Lecture 3
Principles of Variability

Chapter 4: Software Product Line Engineering, Pohl


Prepared by I Made Murwantara, Universitas Pelita Harapan
Variability
Overview
• Basic knowledge about the variability of a
software product line.
• The difference between external and internal
software product line variability.
• The basic concepts for modeling variability:
variation points, variants, and their
interrelation.
• Orthogonal variability model
Variability
• Variability in domain artefacts
Managed Variability
This concept basically encompasses the following
issues:
• Supporting activities concerned with defining
variability.
• Managing variable artefacts.
• Supporting activities concerned with resolving
variability.
• Collecting, storing, and managing trace
information necessary to fulfill these tasks.
Variability Subject & Object
• The term variability refers to the ability or the
tendency to change.
Examples:
• An electric bulb can be lit or unlit.
• A software application can support different
languages.
• Chewing gum can be sweet or sour.
• A triple band mobile phone supports three
different network standards.
Variability Subject & Object
• What does vary?
• identifying precisely the variable item or property of the real world
• Why does it vary?
• variation of another item.
• How does it vary?
• This question deals with the different shapes a variability subject
can take.
Variability Subject & Object
Variability Subject & Object
Variation Point
• Variability in product line context - Variability
subjects and variability objects are embedded
into the context of an SPL.
• Contextual information of a variation point
encompasses the details about the embedding of
the variability subject into the SPL.
Variant
Variant
Variation Points & Variants
Variation Points & Variants
Variability in SPL
• Variability of a software product line is
variability that is modeled to enable the
development of customized applications by
reusing predefined, adjustable artefacts.
• Decision: variability or commonality
• Commonality denotes features that are part of each
application in exactly the same form.
Variability in SPL
Variability in Time and Space

We focus on Variability in Space.


Variability in Time and Space
• Variability in time is the existence of different
versions of an artefact that are valid at
different times.
Variability in Time and Space
• Variability in space is the existence of an
artefact in different shapes at the same time.
Internal & External Variability

External variability is the variability of


domain artefacts that is visible to customers.
Internal & External Variability
Internal variability is the variability of domain
artefacts that is hidden from customers.
Internal & External Variability
An Example
Internal & External Variability
• Causes of External Variability.
• A home automation product line supports two
security standards, which are officially imposed
by a home automation association, namely
basic security and high security. The basic
security standard demands that the front door is
secured by a numeric keypad. The high security
standard demands a numeric keypad and
additionally a biometric identification
mechanism. Only homes compliant with the
latter standard receive an official security
certificate.
Internal & External Variability
• Causes of Internal Variability.
• The fingerprint scanner door lock in a home
automation system can use two different ways of
storing fingerprint images, compressed and
uncompressed. The uncompressed algorithm is
used during system maintenance and development
to enable fine-tuning and testing of the algorithm.
Compressed image storage is used during the
normal system operation to save database capacity.
Variability Pyramid
Orthogonal Variability Model
• Variability documents should include:
• What varies?
• Why does it varies?
• How does it vary?
• For whom is it documented?
• The explicit documentations has significant advantages,
which are:
• The improvement of making decisions
• Communications
• Traceability
Orthogonal Variability Model
An Example of Explicit Variability
Orthogonal Variability Definition

Variability
can be defined either as an integral part of
development artefacts or in a separate variability
model.

• Existing Research:
• Feature Models to represent variability
• Variability in use case models
• Variability in implementation structures
Orthogonal Variability Definition
• Shortcomings:
• Variability information is spread across
different models, inconsistent.
• It is hard to determine which variability
influence design, realization or test artefacts.
• Overload the software development models.
• Different concepts of variability for software
development models.
Orthogonal Variability Model
An orthogonal variability model is a model that
defines the variability of a software product line. It
relates the variability defined to other software
development models such as feature models, use case
models, design models, component models, and test
models.

An orthogonal variability model provides a cross-


sectional view of the variability across all software
development artefacts.
Orthogonal Variability Model
• Each variation point must be associated with at least one
variant.
• Each variant must be associated with at least one variation
point.
• A variation point can offer more than one variant.
• A variant can be associated with different variation points.
Orthogonal Variability Model
• Each variation point must be associated with at least one
variant.
• Each variant must be associated with at least one variation
point.
• A variation point can offer more than one variant.
• A variant can be associated with different variation points.
Orthogonal Variability Model
• Optional Variability Dependency
The optional variability dependency states that a variant can
(but does not need to) be a part of a product line application.
Each variant must be associated with at least one variation
point.
• Example:
– Defining three identification mechanisms, ‘keypad’,
‘magnetic card’, and ‘fingerprint scanner’, as optional
variants allows the customer to choose any
combination of variants. The customer can decide to
have none of the identification mechanisms, only one,
any combination of two mechanisms, or all of them as
a part of the home security system.
Orthogonal Variability Model
• Mandatory Variability Dependency
It defines that a variant must be selected for an application if
and only if the associated variation point is part of the
application.

• Example:
A home automation system offers different key lengths for
encrypted remote communication (128 bits to 1024 bits). The
software product line engineer wants to state that 128 bit
encryption is required for minimal data protection and that it
must be available in each application that offers remote
access. Therefore, the engineer defines the 128 bit encryption
as a mandatory variant and 256 bit, 512 bit, and 1024 bit
encryption as optional variants. The 128 bit encryption is,
however, only part of applications which include remote
communication.
Orthogonal Variability Model
• Alternative choice
– groups a set of variants that are related through an
optional variability dependency to the same variation
point and defines the range for the amount of optional
variants to be selected for this group.
Orthogonal Variability Model
Alternative Choice, an example:
• By declaring the optional variants ‘keypad’,
‘magnetic card’, and ‘fingerprint scanner’ as
alternative choices with ‘min’ taking the value
“1” and ‘max’ taking the value “2”, the
variability model states that at least one and at
most two of the variants can be selected.
Variability Constraints
• The variability meta model does not support the
documentation of relationships between variants that
belong to different variation points.
• Such restrictions are required for the following cases:
– The modeler wants to state that a variant V requires a
1

variant V to function correctly. Consequently, if V is


2 1

selected for an application, V also has to be selected.


2

– The modeler wants to state that if variant V is selected,


1

variant V must not be selected.


2

– The modeler wants to state that a variation point must be


part of an application depending on the selection of a
particular variant made for another variation point.
Variant Constraint Dependency
• Describes a relationship between two variants,
which may be of one of two types:
a) Variant requires variant (requires_V_V): The
selection of a variant V1 requires the selection of
another variant V2 independent of the variation
points the variants are associated with.
b) Variant excludes variant (excludes_V_V): The
selection of a variant V1 excludes the selection
of the related variant V2 independent of the
variation points the variants are associated with.
Variant Constraint Dependency
Variant Constraint Dependency
Example: Variant Requires Variant
• A home automation system provides a variation
point ‘wireless communication’ with two variants
‘WLAN’ and ‘Bluetooth’ and a variation point
‘secure connection’ with two variants ‘VPN’
(Virtual Private Network) and ‘SSH’ (Secure
Shell). The selection of ‘WLAN’ requires the
selection of ‘VPN’ as a secure connection. This is
documented by introducing a requires_V_V
relationship between the ‘WLAN’ and the ‘VPN’
variants.
Variant Constraint Dependency
Example: Variant Excludes Variant
• A home automation system provides a variation point
‘wireless communication’ with two variants ‘WLAN’
and ‘Bluetooth’ and another variation point ‘motion
detection’ with two variants ‘optical sensors’ and
‘radar-based sensors’. It is not possible to combine the
variant ‘WLAN’ with the variant ‘radar-based sensors’
because both use similar frequencies and interfere with
each other. This is documented by introducing an
excludes_V_V dependency between the variants
‘WLAN’ and ‘radar-based sensors’.
Variant to Variation Point
Constraint Dependency
Describes a relationship between a variant and a
variation point, which may be of one of the two
types:
a) Variant requires variation point
(requires_V_VP): The selection of a variant V1
requires the consideration of a variation point
VP2.
b) Variant excludes variation point
(excludes_V_VP): The selection of a variant V1
excludes the consideration of a variation point
VP2.
Variant to Variation Point
Constraint Dependency
Example: Variant Requires Variation Point
• Wireless LAN provides different standards with
different transfer speeds. Hence, the variant
‘WLAN’ requires a variation point ‘LAN
Standard’ that is related to variants representing
the different standards of wireless LAN
communication (e.g. IEEE 802.11a, b, and g).
This is represented by introducing a
requires_V_VP relation between the variant
‘WLAN’ and the variation point ‘LAN-Standard’.
Variant to Variation Point
Constraint Dependency
Example: Variant Excludes Variation Point
• If only one LAN type can be selected, the
selection of cabled LAN makes the selection
of different antennas for wireless
communication unnecessary. This is
represented by introducing an excludes_V_VP
relation between the variant ‘cabled LAN’ and
the variation point ‘antenna for wireless
communication’.
Variation Point Constraint
Dependency
Describes a relationship between two variation
points, which may be of one of two types:
a) Variation point requires variation point
(requires_VP_VP): A variation point requires the
consideration of another variation point in order
to be realised.
b) Variation point excludes variation point
(excludes_VP_VP): The consideration of a
variation point excludes the consideration of
another variation point.
Variation Point Constraint
Dependency
Example: Variation Point Requires Variation
Point
• Any selection of a variant at the variation point
‘wireless communication’ requires the
selection of some variant at the variation point
‘antenna for wireless communication’. This is
represented by introducing a requires_VP_VP
relation between the variation point ‘wireless
communication’ and the variation point
‘antenna for wireless communication’.
Variation Point Constraint
Dependency
Example: Variation Point Excludes Variation
Point
• The home automation system does not support
combining wireless communication and cabled
communication. Hence the variation points
‘wireless communication’ and ‘cabled
communication’ exclude each other –
represented by an excludes_VP_VP relation
between those two variation points.
Traceability between Variability
Model and Other Development
Artefacts
Variability Meta Model
Variability Meta Model
The artefact dependency is realised as an association
class of the ‘realised by’ association. The
multiplicities of the association define the
following conditions:
1. A development artefact can but does not have to
be related to one or several variants (multiplicity
‘0..n’).
2. A variant must be related to at least one
development artefact and may be related to more
than one development artefact (multiplicity
‘1..n’).
Orthogonal Variability Model
Orthogonal Variability Model
Example:
Orthogonal Variability Model
Example: Represent variability in a use case diagram
Orthogonal Variability Model
Handling Complexity

Example: Package Variants


• The variability model in Fig. 4-14 includes the
variation point ‘security package’ and the two
alternative variants ‘basic’ and ‘advanced’. These
variants represent packages. Selecting the ‘basic’
package also selects the variant ‘motion sensors’ of the
variation point ‘intrusion detection’ and the variant
‘keypad’ of the variation point ‘door locks’. If the
‘advanced’ package (variant) is selected, the variants
‘camera surveillance’ and ‘fingerprint scanner’ are
chosen.
Orthogonal Variability Model
Handling Complexity
Example: Package Variants

You might also like