17-708 Software Product Lines: Concepts and Implementation...

41
17-708 SOFTWARE PRODUCT LINES: CONCEPTS AND IMPLEMENTATION FEATURE INTERACTIONS CHRISTIAN KAESTNER CARNEGIE MELLON UNIVERSITY INSTITUTE FOR SOFTWARE RESEARCH 1

Transcript of 17-708 Software Product Lines: Concepts and Implementation...

Page 1: 17-708 Software Product Lines: Concepts and Implementation ...ckaestne/17708/19_featureinteraction.pdf · 17-708 SOFTWARE PRODUCT LINES: CONCEPTS AND IMPLEMENTATION FEATURE INTERACTIONS

17-708 SOFTWARE PRODUCT LINES:

CONCEPTS AND IMPLEMENTATION

FEATURE INTERACTIONS

CHRISTIAN KAESTNER

CARNEGIE MELLON UNIVERSITY

INSTITUTE FOR SOFTWARE RESEARCH

1

Page 2: 17-708 Software Product Lines: Concepts and Implementation ...ckaestne/17708/19_featureinteraction.pdf · 17-708 SOFTWARE PRODUCT LINES: CONCEPTS AND IMPLEMENTATION FEATURE INTERACTIONS

READING

ASSIGNMENT NOV 16

tbd

Page 3: 17-708 Software Product Lines: Concepts and Implementation ...ckaestne/17708/19_featureinteraction.pdf · 17-708 SOFTWARE PRODUCT LINES: CONCEPTS AND IMPLEMENTATION FEATURE INTERACTIONS

LEARNING GOALS

Understand the nature of feature interactions and the optional feature problem; disentangle the different meanings of the terms

Identify common sources of feature interactions

Use appropriate strategies to avoid, mitigate, or detect feature interactions

Select and apply implementation strategies for the optional feature problem

Page 4: 17-708 Software Product Lines: Concepts and Implementation ...ckaestne/17708/19_featureinteraction.pdf · 17-708 SOFTWARE PRODUCT LINES: CONCEPTS AND IMPLEMENTATION FEATURE INTERACTIONS

Nhlabatsi, Armstrong, Robin Laney, and Bashar Nuseibeh.

"Feature interaction: the security threat from within software

systems." Progress in Informatics 5 (2008): 75-89.

Page 5: 17-708 Software Product Lines: Concepts and Implementation ...ckaestne/17708/19_featureinteraction.pdf · 17-708 SOFTWARE PRODUCT LINES: CONCEPTS AND IMPLEMENTATION FEATURE INTERACTIONS
Page 6: 17-708 Software Product Lines: Concepts and Implementation ...ckaestne/17708/19_featureinteraction.pdf · 17-708 SOFTWARE PRODUCT LINES: CONCEPTS AND IMPLEMENTATION FEATURE INTERACTIONS
Page 7: 17-708 Software Product Lines: Concepts and Implementation ...ckaestne/17708/19_featureinteraction.pdf · 17-708 SOFTWARE PRODUCT LINES: CONCEPTS AND IMPLEMENTATION FEATURE INTERACTIONS

[:weather:]

Plugin

:) 8-) ;-) …

Plugin

Today's weather: [:weather

Page 8: 17-708 Software Product Lines: Concepts and Implementation ...ckaestne/17708/19_featureinteraction.pdf · 17-708 SOFTWARE PRODUCT LINES: CONCEPTS AND IMPLEMENTATION FEATURE INTERACTIONS

Hands-free entry

Night lock

Electronic operation

Intruder defense

Example from P. Zave

Page 9: 17-708 Software Product Lines: Concepts and Implementation ...ckaestne/17708/19_featureinteraction.pdf · 17-708 SOFTWARE PRODUCT LINES: CONCEPTS AND IMPLEMENTATION FEATURE INTERACTIONS

Feature Interactions

Features designed in isolation

(divide and conquer)

Interact in intended and unintended ways

when composed

(Failure of compositionality

due to hidden underlying domain)

Page 10: 17-708 Software Product Lines: Concepts and Implementation ...ckaestne/17708/19_featureinteraction.pdf · 17-708 SOFTWARE PRODUCT LINES: CONCEPTS AND IMPLEMENTATION FEATURE INTERACTIONS

"The physical world has no compositionality." . M. Jackson, FI Dagstuhl 2014 .

Page 11: 17-708 Software Product Lines: Concepts and Implementation ...ckaestne/17708/19_featureinteraction.pdf · 17-708 SOFTWARE PRODUCT LINES: CONCEPTS AND IMPLEMENTATION FEATURE INTERACTIONS

SOURCES

Overlapping preconditions (nondeterminism)

Requirements inconsistency

Conflicting goals

Violations of assumptions

Resource contention

Nhlabatsi, Armstrong, Robin Laney, and Bashar Nuseibeh.

"Feature interaction: the security threat from within software

systems." Progress in Informatics 5 (2008): 75-89.

Page 12: 17-708 Software Product Lines: Concepts and Implementation ...ckaestne/17708/19_featureinteraction.pdf · 17-708 SOFTWARE PRODUCT LINES: CONCEPTS AND IMPLEMENTATION FEATURE INTERACTIONS

INTERACTION TYPES

Nondeterminism

Dependence

Override (same precondition)

Negative impact (same precondition)

Override (linked trigger events)

Negative impact (linked trigger events)

Order

Bypass

Infinite loop

Nhlabatsi, Armstrong, Robin Laney, and Bashar Nuseibeh.

"Feature interaction: the security threat from within software

systems." Progress in Informatics 5 (2008): 75-89.

Page 13: 17-708 Software Product Lines: Concepts and Implementation ...ckaestne/17708/19_featureinteraction.pdf · 17-708 SOFTWARE PRODUCT LINES: CONCEPTS AND IMPLEMENTATION FEATURE INTERACTIONS

Keck, Dirk O., and Paul J. Kuehn. "The feature and service

interaction problem in telecommunications systems: A survey."

Software Engineering, IEEE Transactions on 24, no. 10 (1998):

779-796.

Page 14: 17-708 Software Product Lines: Concepts and Implementation ...ckaestne/17708/19_featureinteraction.pdf · 17-708 SOFTWARE PRODUCT LINES: CONCEPTS AND IMPLEMENTATION FEATURE INTERACTIONS

Handling Interactions

Composition mechanism with default

resolution

(telecommunication, Android,

home automation)

Page 15: 17-708 Software Product Lines: Concepts and Implementation ...ckaestne/17708/19_featureinteraction.pdf · 17-708 SOFTWARE PRODUCT LINES: CONCEPTS AND IMPLEMENTATION FEATURE INTERACTIONS

Handling Interactions

Isolation, noninterference (to some degree)

(Android, Kernel drivers, browser plugins)

Page 16: 17-708 Software Product Lines: Concepts and Implementation ...ckaestne/17708/19_featureinteraction.pdf · 17-708 SOFTWARE PRODUCT LINES: CONCEPTS AND IMPLEMENTATION FEATURE INTERACTIONS

Handling Interactions

Detection in requirements or

implementations

true -> true

true -> (WORLD v BYE)

¬ (WORLD ˄ BYE)

Page 17: 17-708 Software Product Lines: Concepts and Implementation ...ckaestne/17708/19_featureinteraction.pdf · 17-708 SOFTWARE PRODUCT LINES: CONCEPTS AND IMPLEMENTATION FEATURE INTERACTIONS

DETECTION

Formal methods

Model checking

Detecting overlapping preconditions

Requirements

Identifying shared resources

Page 18: 17-708 Software Product Lines: Concepts and Implementation ...ckaestne/17708/19_featureinteraction.pdf · 17-708 SOFTWARE PRODUCT LINES: CONCEPTS AND IMPLEMENTATION FEATURE INTERACTIONS

Apel, Sven, Don Batory, Christian Kästner, and Gunter Saake.

Feature-Oriented Software Product Lines. Berlin: Springer, 2013.

Page 19: 17-708 Software Product Lines: Concepts and Implementation ...ckaestne/17708/19_featureinteraction.pdf · 17-708 SOFTWARE PRODUCT LINES: CONCEPTS AND IMPLEMENTATION FEATURE INTERACTIONS

Ferber, Stefan, Jürgen Haag, and Juha Savolainen. "Feature

interaction and dependencies: Modeling features for

reengineering a legacy product line." In Software product lines,

pp. 235-256. Springer Berlin Heidelberg, 2002.

Page 20: 17-708 Software Product Lines: Concepts and Implementation ...ckaestne/17708/19_featureinteraction.pdf · 17-708 SOFTWARE PRODUCT LINES: CONCEPTS AND IMPLEMENTATION FEATURE INTERACTIONS

Ferber, Stefan, Jürgen Haag, and Juha Savolainen. "Feature

interaction and dependencies: Modeling features for

reengineering a legacy product line." In Software product lines,

pp. 235-256. Springer Berlin Heidelberg, 2002.

Page 21: 17-708 Software Product Lines: Concepts and Implementation ...ckaestne/17708/19_featureinteraction.pdf · 17-708 SOFTWARE PRODUCT LINES: CONCEPTS AND IMPLEMENTATION FEATURE INTERACTIONS

ONLINE TECHNIQUES

Calder, Muffy, Mario Kolberg, Evan H. Magill, and Stephan Reiff-

Marganiec. "Feature interaction: a critical review and considered

forecast." Computer Networks 41, no. 1 (2003): 115-141.

Page 22: 17-708 Software Product Lines: Concepts and Implementation ...ckaestne/17708/19_featureinteraction.pdf · 17-708 SOFTWARE PRODUCT LINES: CONCEPTS AND IMPLEMENTATION FEATURE INTERACTIONS

OPTIONAL

FEATURE

PROBLEM

Page 23: 17-708 Software Product Lines: Concepts and Implementation ...ckaestne/17708/19_featureinteraction.pdf · 17-708 SOFTWARE PRODUCT LINES: CONCEPTS AND IMPLEMENTATION FEATURE INTERACTIONS

OPTIONAL FEATURE

PROBLEM

Code focused view – how to implement coordination code between two features

Applicable only once interactions identified and detected

Page 24: 17-708 Software Product Lines: Concepts and Implementation ...ckaestne/17708/19_featureinteraction.pdf · 17-708 SOFTWARE PRODUCT LINES: CONCEPTS AND IMPLEMENTATION FEATURE INTERACTIONS

Weather Smiley

Coordination

Page 25: 17-708 Software Product Lines: Concepts and Implementation ...ckaestne/17708/19_featureinteraction.pdf · 17-708 SOFTWARE PRODUCT LINES: CONCEPTS AND IMPLEMENTATION FEATURE INTERACTIONS

Statistics

(buffer hit ratio,

table size and

cardinality, …)

Transactions

(locks, commit,

rollback, …)

Transactions per second

25

Page 26: 17-708 Software Product Lines: Concepts and Implementation ...ckaestne/17708/19_featureinteraction.pdf · 17-708 SOFTWARE PRODUCT LINES: CONCEPTS AND IMPLEMENTATION FEATURE INTERACTIONS

PRODUCTS

DB with statistics without transactions

DB with transactions, without statistics

DB with statistics and

transactions

26

Page 27: 17-708 Software Product Lines: Concepts and Implementation ...ckaestne/17708/19_featureinteraction.pdf · 17-708 SOFTWARE PRODUCT LINES: CONCEPTS AND IMPLEMENTATION FEATURE INTERACTIONS

UNDESIRED

PRODUCTS

DB with transactions without statistics

measuring transactions per second

(larger and slower than necessary)

DB with statistics without transactions

trying to measure transactions

per second(?)

27

Page 28: 17-708 Software Product Lines: Concepts and Implementation ...ckaestne/17708/19_featureinteraction.pdf · 17-708 SOFTWARE PRODUCT LINES: CONCEPTS AND IMPLEMENTATION FEATURE INTERACTIONS

MODULES

Stat Lock

DB

Stat Lock

DB

Database

Statistics Transactions

Txn-StatsLockStat Lock

DB

Stat

Where to implement

transactions/sec

How to create product without

transactions but with statistics

transactions/sec really a feature?

28

Page 29: 17-708 Software Product Lines: Concepts and Implementation ...ckaestne/17708/19_featureinteraction.pdf · 17-708 SOFTWARE PRODUCT LINES: CONCEPTS AND IMPLEMENTATION FEATURE INTERACTIONS

MULTIPLE IMPL.

Variability Impl. Effort Binary Size & Perf. Code Quality

Products

29

Page 30: 17-708 Software Product Lines: Concepts and Implementation ...ckaestne/17708/19_featureinteraction.pdf · 17-708 SOFTWARE PRODUCT LINES: CONCEPTS AND IMPLEMENTATION FEATURE INTERACTIONS

DOCUMENT

DEPENDENCIES

Products

Variability Impl. Effort Binary Size & Perf. Code Quality

30

Page 31: 17-708 Software Product Lines: Concepts and Implementation ...ckaestne/17708/19_featureinteraction.pdf · 17-708 SOFTWARE PRODUCT LINES: CONCEPTS AND IMPLEMENTATION FEATURE INTERACTIONS

MOVING SOURCE

CODE

Variability Impl. Effort Binary Size & Perf. Code Quality

Products

31

Page 32: 17-708 Software Product Lines: Concepts and Implementation ...ckaestne/17708/19_featureinteraction.pdf · 17-708 SOFTWARE PRODUCT LINES: CONCEPTS AND IMPLEMENTATION FEATURE INTERACTIONS

CHANGE BEHAVIOR

Variability Impl. Effort Binary Size & Perf. Code Quality

Products

32

Page 33: 17-708 Software Product Lines: Concepts and Implementation ...ckaestne/17708/19_featureinteraction.pdf · 17-708 SOFTWARE PRODUCT LINES: CONCEPTS AND IMPLEMENTATION FEATURE INTERACTIONS

PREPROCESSOR

Variability Impl. Effort Binary Size & Perf. Code Quality

#ifdef TXN

lock();

#ifdef STAT

lockCount++;

#endif

#endif

Products

33

Page 34: 17-708 Software Product Lines: Concepts and Implementation ...ckaestne/17708/19_featureinteraction.pdf · 17-708 SOFTWARE PRODUCT LINES: CONCEPTS AND IMPLEMENTATION FEATURE INTERACTIONS

GLUE CODE MODULES

Variability Impl. Effort Binary Size & Perf. Code Quality

Products

34

Page 35: 17-708 Software Product Lines: Concepts and Implementation ...ckaestne/17708/19_featureinteraction.pdf · 17-708 SOFTWARE PRODUCT LINES: CONCEPTS AND IMPLEMENTATION FEATURE INTERACTIONS

OVERVIEW

su

ng

Va

riab

ility

Effo

rt

Siz

e &

Pe

rf.

Qu

ality

Multiple impl

Dependency

Move source code

Change behavior

Preprocessor

Glue code modules

35

Page 36: 17-708 Software Product Lines: Concepts and Implementation ...ckaestne/17708/19_featureinteraction.pdf · 17-708 SOFTWARE PRODUCT LINES: CONCEPTS AND IMPLEMENTATION FEATURE INTERACTIONS

EXPERIENCE

BERKELEY DB

Dependencies?

• Would render important features de-facto mandatory

Change behavior?

• undesired

Glue code module?

• Extracted 76% of statistics code into 9 modules

• possible but labor intensive

Preprocessor

• Faster, easier

• Scattered code

36

Page 37: 17-708 Software Product Lines: Concepts and Implementation ...ckaestne/17708/19_featureinteraction.pdf · 17-708 SOFTWARE PRODUCT LINES: CONCEPTS AND IMPLEMENTATION FEATURE INTERACTIONS

Scale

Page 38: 17-708 Software Product Lines: Concepts and Implementation ...ckaestne/17708/19_featureinteraction.pdf · 17-708 SOFTWARE PRODUCT LINES: CONCEPTS AND IMPLEMENTATION FEATURE INTERACTIONS

Scale

Page 39: 17-708 Software Product Lines: Concepts and Implementation ...ckaestne/17708/19_featureinteraction.pdf · 17-708 SOFTWARE PRODUCT LINES: CONCEPTS AND IMPLEMENTATION FEATURE INTERACTIONS

Scale

Page 40: 17-708 Software Product Lines: Concepts and Implementation ...ckaestne/17708/19_featureinteraction.pdf · 17-708 SOFTWARE PRODUCT LINES: CONCEPTS AND IMPLEMENTATION FEATURE INTERACTIONS

REMINDER: VARIABILITY

MANAGEMENT

see mass customization in automotive

Identify relevant variability

Reduce unnecessary variation to avoid interactions and optional code problems

Page 41: 17-708 Software Product Lines: Concepts and Implementation ...ckaestne/17708/19_featureinteraction.pdf · 17-708 SOFTWARE PRODUCT LINES: CONCEPTS AND IMPLEMENTATION FEATURE INTERACTIONS

FURTHER READING

Calder, Muffy, Mario Kolberg, Evan H. Magill, and Stephan Reiff-Marganiec. "Feature interaction: a critical review and considered forecast." Computer Networks 41, no. 1 (2003): 115-141.