36
Tools and Methods for Continuously Expanding Software Applications Andrzej W ˛ asowski PROCESS AND SYSTEM MODELS GROUP

Tools and Methods for Continuously Expanding Software Applications

Embed Size (px)

Citation preview

Page 1: Tools and Methods for Continuously Expanding Software Applications

Tools andMethods forContinuouslyExpandingSoftwareApplications—

Andrzej Wasowski

PROCESS AND SYSTEM MODELS GROUP

Page 2: Tools and Methods for Continuously Expanding Software Applications

Variability Is Everywhere

c© Andrzej Wasowski, IT University of Copenhagen 2

Page 3: Tools and Methods for Continuously Expanding Software Applications

Variability Adds Complexity

c© Andrzej Wasowski, IT University of Copenhagen 3

Page 4: Tools and Methods for Continuously Expanding Software Applications

Domain vs Application ProcessesPohl et. al. Software Product Line Engineering

c© Andrzej Wasowski, IT University of Copenhagen 4

Page 5: Tools and Methods for Continuously Expanding Software Applications

Handling Variability

c© Andrzej Wasowski, IT University of Copenhagen 5

Page 6: Tools and Methods for Continuously Expanding Software Applications

Which variabilitytechniques are

effective in practice?

Under what conditions?

c© Andrzej Wasowski, IT University of Copenhagen 6

Page 7: Tools and Methods for Continuously Expanding Software Applications

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

Page 8: Tools and Methods for Continuously Expanding Software Applications
Page 9: Tools and Methods for Continuously Expanding Software Applications
Page 10: Tools and Methods for Continuously Expanding Software Applications
Page 11: Tools and Methods for Continuously Expanding Software Applications

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

Page 12: Tools and Methods for Continuously Expanding Software Applications
Page 13: Tools and Methods for Continuously Expanding Software Applications

Some Correlations

c© Andrzej Wasowski, IT University of Copenhagen 13

Page 14: Tools and Methods for Continuously Expanding Software Applications

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

Page 15: Tools and Methods for Continuously Expanding Software Applications

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

Page 16: Tools and Methods for Continuously Expanding Software Applications

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

Page 17: Tools and Methods for Continuously Expanding Software Applications

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

Page 18: Tools and Methods for Continuously Expanding Software Applications
Page 19: Tools and Methods for Continuously Expanding Software Applications

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

Page 20: Tools and Methods for Continuously Expanding Software Applications

SUCCESSFUL REUSE IS

PROACTIVEPLANNEDMANAGED

c© Andrzej Wasowski, IT University of Copenhagen 20

Page 21: Tools and Methods for Continuously Expanding Software Applications

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

Page 22: Tools and Methods for Continuously Expanding Software Applications

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

Page 23: Tools and Methods for Continuously Expanding Software Applications

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

Page 24: Tools and Methods for Continuously Expanding Software Applications

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

Page 25: Tools and Methods for Continuously Expanding Software Applications

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

Page 26: Tools and Methods for Continuously Expanding Software Applications

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

Page 27: Tools and Methods for Continuously Expanding Software Applications

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

Page 28: Tools and Methods for Continuously Expanding Software Applications

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

Page 29: Tools and Methods for Continuously Expanding Software Applications

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

Page 30: Tools and Methods for Continuously Expanding Software Applications

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

Page 31: Tools and Methods for Continuously Expanding Software Applications

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

Page 32: Tools and Methods for Continuously Expanding Software Applications

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

Page 33: Tools and Methods for Continuously Expanding Software Applications

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

Page 34: Tools and Methods for Continuously Expanding Software Applications

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

Page 35: Tools and Methods for Continuously Expanding Software Applications

c© Andrzej Wasowski, IT University of Copenhagen 35

Page 36: Tools and Methods for Continuously Expanding Software Applications

c© Andrzej Wasowski, IT University of Copenhagen 36