View
657
Download
2
Embed Size (px)
Citation preview
Tools andMethods forContinuouslyExpandingSoftwareApplications—
Andrzej Wasowski
PROCESS AND SYSTEM MODELS GROUP
Variability Is Everywhere
c© Andrzej Wasowski, IT University of Copenhagen 2
Variability Adds Complexity
c© Andrzej Wasowski, IT University of Copenhagen 3
Domain vs Application ProcessesPohl et. al. Software Product Line Engineering
c© Andrzej Wasowski, IT University of Copenhagen 4
Handling Variability
c© Andrzej Wasowski, IT University of Copenhagen 5
Which variabilitytechniques are
effective in practice?
Under what conditions?
c© Andrzej Wasowski, IT University of Copenhagen 6
AGENDA
Variability Management vs EncouragementArchitectural Patterns for Variability Management
Clone-and-Own with version controlInterpreted configuration filesFeature Modeling and compile-time variabilityDomain Specific Languages (code generation,interpretation)
c© Andrzej Wasowski, IT University of Copenhagen 7
Two Opposing Approaches to Variability
Variability
Management
Variability
Encouragement
Controlling scopeEliminating variantsIf no significant businessvalue added
Unleashing community innovationEncouraging competition
Letting community decide scope
c© Andrzej Wasowski, IT University of Copenhagen 11
T. Berger. H. Pfeiffer. R. Tartler. S. Dienst. K. Czarnecki. A. Wasowski. S. She: Variability mechanisms insoftware ecosystems. Information & Software Technology 2014
Some Correlations
c© Andrzej Wasowski, IT University of Copenhagen 13
Let’s summarize the broad spectrum
Feature modeling works for static variability in engineeringdomains
Feature models scale well in the embedded domain
Open and dynamic ecosystems grow fast!They rely on dynamic binding, runtime-service lookup, and easydownload and installation
c© Andrzej Wasowski, IT University of Copenhagen 14
AGENDA
Variability Management vs EncouragementArchitectural Patterns for Variability Management
Clone-and-Own with version controlInterpreted configuration filesFeature Modeling and compile-time variabilityDomain Specific Languages (code generation,interpretation)
c© Andrzej Wasowski, IT University of Copenhagen 15
Clone-and-Own with Version Control
1.1 2.01.2 1.3
only maintenance (bug fixes) on 1.x branch
tiger
1.1 1.2
uses
tigeruses
eagle
uses
0.1
only maintenance (bug fixes)
lion
Version control records changes to files overtime so that you can recall specific versions
later. It can do it for any software source code,but also for any type of file on a computer.
c© Andrzej Wasowski, IT University of Copenhagen 16
Scott Chacon. Ben Straub. Pro Git. Everything You Need to Know about Git. 2nd Edition
When is Clone-and-Own beneficial?
Read-onlyaccess toreleasessuffices
Very rarechanges to oldreleases
You do notmaintain norpropagatechangesbetweenvariants
c© Andrzej Wasowski, IT University of Copenhagen 17
S. Stanciulescu. S. Schulze. A. Wasowski. Forked and Integrated Variants in an Open-Source FirmwareProject. ICSME 2015
Drowning in Clone-And-Own
blue.cc
blue.cc
CHANGE
blue.cc
green.cc green.cc
blue.cc
green.cc
BUG FOUNDINDEPENDENTLY
INDEPENDENTBUG FIXES
?
c© Andrzej Wasowski, IT University of Copenhagen 19
SUCCESSFUL REUSE IS
PROACTIVEPLANNEDMANAGED
c© Andrzej Wasowski, IT University of Copenhagen 20
Spectrum of Variability ArchitecturesStay as close to the left as possible
property & configuration files + build system
feature models + build system
feature models + product specific code
domain specific languages + code generation
frameworks + framework completion code
only product specific code (no reuse)
c© Andrzej Wasowski, IT University of Copenhagen 21
AGENDA
Variability Management vs EncouragementArchitectural Patterns for Variability Management
Clone-and-Own with version controlInterpreted configuration filesFeature Modeling and compile-time variabilityDomain Specific Languages (code generation,interpretation)
c© Andrzej Wasowski, IT University of Copenhagen 22
A Configuration FileInterpreted at Boot-Time
A config file controls differences between customersOne SW for all customers, different config fileManage configurations with branching/forking
ProsSimple, easy to maintain, conceptually one productEasier to certify for functional safetySeen in many embedded projects (including automotive,see AUTOSAR, and avionics)
ConsHW resources may be spilledHard to control IP spill (rare)Hard to manage configurations if large
c© Andrzej Wasowski, IT University of Copenhagen 23
AGENDA
Variability Management vs EncouragementArchitectural Patterns for Variability Management
Clone-and-Own with version controlInterpreted configuration filesFeature Modeling and compile-time variabilityDomain Specific Languages (code generation,interpretation)
c© Andrzej Wasowski, IT University of Copenhagen 24
Feature ModelingExample from Czarnecki’02
mandatory
pulls trailerenginebody
car
electric gasoline automatic manual
optional
exclusive choice
inclusive choice
transmission
Hierarchy constraints, for example:manual requires transmission (each child node requires its parent node)
Groups constraints: engine is electric or gas driven or bothNot all constraints in hierarchy & groups, cross-tree constraints in text:
electric requires automatic
Attributes are added like to classes (eg. engine volume)
c© Andrzej Wasowski, IT University of Copenhagen 25
Feature ModelingConfiguration
mandatory
pulls trailerenginebody
car
electric gasoline automatic manual
optional
exclusive choice
inclusive choice
transmission
electric requires automatic
+ ++ +
+ + +c© Andrzej Wasowski, IT University of Copenhagen 26
Applications of Feature Models
Design & Management
domain modeling
product line scopingproduct line mngmt
code generationdriving build system
drivingtesting
Development & Test
c© Andrzej Wasowski, IT University of Copenhagen 27
Static Variability with Feature ModelsAn Example from The Linux Kernel
1 #ifdef CONFIG_DEVPTS_MULTIPLE_INSTANCES2 if (inode->i_sb->s_magic == ) . . .3 #endif
void pts_sb_from_inode(struct inode * inode)
4 #ifdef CONFIG_UNIX98_PTYS5 pts_sb_from_inode (tty->driver_data);6 #endif
void pty_close(struct tty_struct * tty)
7 tty = kzalloc(sizeof (*tty), GFP_KERNEL);8 pty_close (tty)· · ·
Important to vary onfeatures not customersA model of featuresneeded if manyConnect to build systemsAs always: less is betterPros: simple, youprecisely control resourcesCons: testing and QAtooling cannot be used onall variants simultanously
c© Andrzej Wasowski, IT University of Copenhagen 28
Integrated Variability and Version Controlengine
gasoline
engine
electric gasoline
1.1 2.01.2
1.3
only maintenance (bug fixes) on 1.x branch
tiger
1.1 1.2
uses
tigeruses
eagle
uses
0.1
only maintenance (bug fixes)
c© Andrzej Wasowski, IT University of Copenhagen 29
AGENDA
Variability Management vs EncouragementArchitectural Patterns for Variability Management
Clone-and-Own with version controlInterpreted configuration filesFeature Modeling and compile-time variabilityDomain Specific Languages (code generation,interpretation)
c© Andrzej Wasowski, IT University of Copenhagen 30
Are all variability models trees?A Fire Alarm System
detection zonesalarm zoneswiringthree differentstructuresModeled asconstrained classdiagrams!Sometimes calledtopologicalvariability
Berger. Stanciulescu. Øgård. Haugen. Larsen. Wasowski. To connect or not to connect: experiencesfrom modeling topological variability. SPLC 2014Fantechi. Topologically configurable systems as product families. SPLC 2013
c© Andrzej Wasowski, IT University of Copenhagen 31
Modeled using class diagrams in PapyrusA model view showing two model hierarchies
PowerLoopDriverAL_ComInterface
ExternalComs
IO_Module
OperationPanel AutroFieldBus
OperationZoneDomain Group
AutroSafePanel
AFB_PowerControl
Installation
AFB_Unit
AlarmZone DetectionZone
[1]
[*]
[1]
[*]
[1]
[*]
[1]
[1]
[1]
[1..*]
[1]
[1]
[1]
[1..32]
[1]
[*]
[1]
[1..*]
[1]
[0..7] [1]
[1..32]
physicalstructure
logical structure
A home grownconfigurator usedto instantiate mod-els
c© Andrzej Wasowski, IT University of Copenhagen 32
Feature Models vs DSLs
Feature models are ready and simple (no design effort, deep insight)DSL requires design effort, but rewards with more expressivenessEffort also translates to maintenanceFM effort is offset by existing feature modeling toolsDSL development effort is offset by language workbenches
Feat
ure
M
od
el
## CPUFreq processor drivers#CONFIG_X86_PCC_CPUFREQ=mCONFIG_X86_ACPI_CPUFREQ=yCONFIG_X86_POWERNOW_K6=yCONFIG_X86_POWERNOW_K7=yCONFIG_X86_POWERNOW_K7_ACPI=yCONFIG_X86_POWERNOW_K8=yCONFIG_X86_GX_SUSPMOD=yCONFIG_X86_SPEEDSTEP_CENTRINO=yCONFIG_X86_SPEEDSTEP_CENTRINO_TABLE=yCONFIG_X86_SPEEDSTEP_ICH=yCONFIG_X86_SPEEDSTEP_SMI=yCONFIG_X86_P4_CLOCKMOD=mCONFIG_X86_CPUFREQ_NFORCE2=yCONFIG_X86_LONGRUN=yCONFIG_X86_LONGHAUL=yCONFIG_X86_E_POWERSAVER=mC
on
figu
rati
on
DSL
Me
ta-
Mo
de
lD
SL M
od
el
Debug Level :int Compress Data
Journalling Flash File System
Misc. Filesystems
Support ZLIB Default Compression
None SizePriority
conforms to conforms to
c© Andrzej Wasowski, IT University of Copenhagen 33
ConclusionClone-and-Own with Version Control
1.1 2.01.2 1.3
only maintenance (bug fixes) on 1.x branch
tiger
1.1 1.2
uses
tigeruses
eagle
uses
0.1
only maintenance (bug fixes)
lion
Version control records changes to files overtime so that you can recall specific versions
later. It can do it for any software source code,but also for any type of file on a computer.
c© Andrzej Wasowski, IT University of Copenhagen 12
Scott Chacon. Ben Straub. Pro Git. Everything You Need to Know about Git. 2nd Edition
Feature Modeling (II)Example from Czarnecki’02
mandatory
pulls trailerenginebody
car
electric gasoline automatic manual
optional
exclusive choice
inclusive choice
transmission
Hierarchy constraints, for example:manual requires transmission (each child node requires its parent node)
Groups constraints: engine is electric or gas driven or bothNot all constraints in hierarchy & groups, cross-tree constraints in text:
electric requires automatic
Attributes are added like to classes (eg. engine volume)
c© Andrzej Wasowski, IT University of Copenhagen 19
Static Variability with Feature ModelsAn Example from The Linux Kernel
1 #ifdef CONFIG_DEVPTS_MULTIPLE_INSTANCES2 if (inode->i_sb->s_magic == ) . . .3 #endif
void pts_sb_from_inode(struct inode * inode)
4 #ifdef CONFIG_UNIX98_PTYS5 pts_sb_from_inode (tty->driver_data);6 #endif
void pty_close(struct tty_struct * tty)
7 tty = kzalloc(sizeof (*tty), GFP_KERNEL);8 pty_close (tty)· · ·
c© Andrzej Wasowski, IT University of Copenhagen 22
Modeled using class diagrams in PapyrusA model view showing two model hierarchies
PowerLoopDriverAL_ComInterface
ExternalComs
IO_Module
OperationPanel AutroFieldBus
OperationZoneDomain Group
AutroSafePanel
AFB_PowerControl
Installation
AFB_Unit
AlarmZone DetectionZone
[1]
[*]
[1]
[*]
[1]
[*]
[1]
[1]
[1]
[1..*]
[1]
[1]
[1]
[1..32]
[1]
[*]
[1]
[1..*]
[1]
[0..7] [1]
[1..32]
physicalstructure
logical structure
c© Andrzej Wasowski, IT University of Copenhagen 24
c© Andrzej Wasowski, IT University of Copenhagen 34
c© Andrzej Wasowski, IT University of Copenhagen 35
c© Andrzej Wasowski, IT University of Copenhagen 36