100% found this document useful (3 votes)
10 views108 pages

Software Product Line Refactoring Guide

The document discusses software product line engineering and refactoring. It describes how product line approaches can improve productivity, time to market and quality but require upfront investment. It also discusses challenges with manual extraction of shared assets and the need for product line refactoring techniques to facilitate extraction and evolution of product line artifacts. The document proposes the concept of product line refactoring and the use of refactoring templates or catalogs.

Uploaded by

api-26754918
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (3 votes)
10 views108 pages

Software Product Line Refactoring Guide

The document discusses software product line engineering and refactoring. It describes how product line approaches can improve productivity, time to market and quality but require upfront investment. It also discusses challenges with manual extraction of shared assets and the need for product line refactoring techniques to facilitate extraction and evolution of product line artifacts. The document proposes the concept of product line refactoring and the use of refactoring templates or catalogs.

Uploaded by

api-26754918
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Software product line

refactoring
Paulo Borba
Informatics Center
Federal University of Pernambuco

phmb@[Link]

Thursday, July 23, 2009


Software product line
No Clouds
.java
.xml
Moving Clouds

.aj
Static Clouds
.jpg

reusable related
assets products

Thursday, July 23, 2009


PL approach improves...

• productivity (development and


maintenance)
• time to market
• quality

Thursday, July 23, 2009


But not before you have
it up and running!
PL approach
Non-PL approach

total
cost

0 2 4 6 8
products
Thursday, July 23, 2009
We can reduce upfront
investments and risks...

• with extractive and reactive PL


approaches
• when existing products share a
significant amount of code (design, test,
and requirements artifacts)

Thursday, July 23, 2009


Product line
bootstrapping...
Common
Product 1
reusable assets

Product 2 Startup On demand

Main 1 Main 2
independently
developed products

Thursday, July 23, 2009


through variant
extraction
Startup

Main 1
Common

Product 1 Common

Product 2 Common Startup On demand

Main 1 Main 2
Main 2

On demand

Thursday, July 23, 2009


Product line evolution:
variant extraction from
shared assets
Clouds

Common
Common !
Clouds

Startup On demand
Startup On demand
Main 1 Main 2
Main 1 Main 2

Thursday, July 23, 2009


Useful for progressive
porting...

different devices,
more than 500
builds…

Thursday, July 23, 2009


Manual extraction...

• tedious
• risky
• compromises promised benefits on
other dimensions of cost and risk

Thursday, July 23, 2009


PL extraction and
evolution can benefit
from refactorings...
behavior-preserving
source-to-source
transformations that
improve some quality factors
Thursday, July 23, 2009
Program refactoring is
not enough!
Startup

Clouds
Main 1
Common
Common !
Product 1 Common Clouds

Product 2 Common Startup On demand


Startup On demand
Main 1 Main 2
Main 2 Main 1 Main 2

On demand

conflicting
assets
Thursday, July 23, 2009
and does not deal with
specific PL artifacts
Clouds
Rain of fire
Common !
Clouds
Clouds Image loading

Startup On demand
On demand Startup
Main 1 Main 2

Rain of fire [Link], [Link]


On Demand Main 2, On demand
Start Up Main 1, [Link]
Clouds [Link]

Thursday, July 23, 2009


So we need PL
refactoring...

• notion
• templates (catalogue)

Thursday, July 23, 2009


Thursday, July 23, 2009
Agenda
• PL concepts
• PL and population refactoring
• Refactoring of individual PL
artifacts
• Refactoring catalogues
• Research challenges
Thursday, July 23, 2009
Automatic product
generation is enabled
by...

• feature models
• configuration knowledge

Thursday, July 23, 2009


Mobile Media

Thursday, July 23, 2009


Feature model

Mobile Media

Media Management Screen Size

Photo Music Send Photo Sorting 128x149 240x320

Send Photo Photo

Thursday, July 23, 2009


Product configuration is
valid feature selection
Mobile Media

Media Management Screen Size

Photo Music Send Photo Sorting 128x149 240x320

Send Photo Photo

{Photo, SendPhoto, 240x320}

{Music, Photo, 240x320}


{Music, SendPhoto, 240x320}

{Music, Photo, 240x320, 128x149}

Thursday, July 23, 2009


But how are features
realized in terms of PL
assets?

How products are


actually created?
Thursday, July 23, 2009
Configuration knowledge
Mobile Media [Link], ...
Photo [Link], ...
Music [Link], ...
Photo " Music [Link], ...
Photo ! Music [Link], ...
! !

Thursday, July 23, 2009


Feature interaction
Mobile Media [Link], ...
Photo [Link], ...
Music [Link], ...
Photo " Music [Link], ...
Photo ! Music [Link], ...
! !

Thursday, July 23, 2009


CK evaluation
Mobile Media [Link], ...
Photo [Link], ...
Music [Link], ...
Photo " Music [Link], ... {Music, Photo, 240x320}
Photo ! Music [Link], ...
! !

{[Link], ..., [Link], ...,[Link], ...,


[Link], ..., [Link], ...}

Thursday, July 23, 2009


Advanced CKs

Thursday, July 23, 2009


CK avoids...
• scattering of configuration info
• base model dependence on feature
model
• feature model pollution, one-to-one
mapping between features and aspects
• limitation to a single variability
mechanism

Thursday, July 23, 2009


Now dealing with
conflicting assets
Clouds
Rain of fire
Common !
Clouds
Clouds Image loading

Startup On demand
On demand Startup
Main 1 Main 2

Rain of fire [Link], [Link]


On Demand Main 2, On demand
Start Up Main 1, [Link]
Clouds [Link]

Thursday, July 23, 2009


Assets mapping


class Main {
Main 1 ...new StartUp(...);...
}

class Main {
Main 2 ↦ ...new OnDemand(...);...
}
..
.

Thursday, July 23, 2009


Composing CK and
mapping
! !
On Demand Main 2, On demand
{Start Up} Start Up Main 1, Startup
On Demand ! Start Up [Link]
! !

{Main 1, Startup,
[Link], ...}

Thursday, July 23, 2009


Software product line
refactoring
Paulo Borba
Informatics Center
Federal University of Pernambuco

phmb@[Link]

Thursday, July 23, 2009


Agenda
• PL concepts
• PL and population refactoring
• Refactoring of individual PL
artifacts
• Refactoring catalogues
• Research challenges
Thursday, July 23, 2009
Product line artifacts
Rain of fire

Clouds Image loading

On demand Startup

Rain of fire [Link], [Link]


On Demand Main 2, [Link]
Start Up Main 1, [Link]
Clouds [Link]

Thursday, July 23, 2009


Code
only?
Thursday, July 23, 2009
No!
Any asset with a notion of
refinement
(preservation of observable
behavior)

Thursday, July 23, 2009


Program refinement

p
⊑
q
when q is at least as good as p in the
sense that it will satisfy every input-
output specification satisfied by p

Thursday, July 23, 2009


Could be less precise
too!

Resulting PL refactoring
notion as precise as this
refinement notion...
Thursday, July 23, 2009
Class declaration
refinement
c
⊑



d
a, m

when

a c ⋅ m
⊑
a d ⋅ m

Thursday, July 23, 2009


Refinement templates
class B extends A class B extends A
ads pub a : T; ads
ops ops
end end
class C extends B = class C extends B
cds, m
pub a : T; ads’ ads’
ops’ ops’
end end

(→) a is not declared by the subclasses of B in cds


(←) ...
Thursday, July 23, 2009
Product line concepts
Rain of fire
⊑


Clouds Image loading

On demand Startup

Rain of fire [Link], [Link]


On Demand Main 2, [Link]
Start Up Main 1, [Link]
Clouds [Link]

Thursday, July 23, 2009


Feature model semantics

[[F ]]
is the set of all
valid product configurations of F

Thursday, July 23, 2009


Valid configurations
semantics

A {A, B,...}
[[ ]] = {A, C,...}
B C …

Thursday, July 23, 2009


CK semantics
[[K ]]
is a function that maps configurations into
sets of assets names, in such a way that

a ∈ [[K ]]c

iff there is a row in K that contains a and its


expression evaluates to true according to c

Thursday, July 23, 2009


CK evaluation semantics

λc. if F ∈ c then
F [Link]
[[ ]] = {[Link]}
... ...

Thursday, July 23, 2009


A PL is a tuple...
(F, A, K )
✓K refers only to F and A
✓for any c ∈ [[F ]],
A ⟨[[K ]]c⟩
is a valid program
Thursday, July 23, 2009
Invalid CKs

• missing entry therefore missing


assets
• incompatible entries therefore
incompatible assets

Thursday, July 23, 2009


PL refactorings

behavior-preserving
source-FM-CK
transformations that
improve some quality factors

Thursday, July 23, 2009


Beyond source code
Mobile Media Mobile Media

Media Management Screen Size Media Management Screen Size

!
Photo Music Send Photo Sorting 128x149 240x320 Photo Audio Send Photo Sorting 128x149 240x320
Send Photo Photo Send Photo Photo

[Link] [Link]
Mobile Media [Link], ... Mobile Media [Link], ...
Photo [Link], ... Photo [Link], ... !
Music [Link], ... ! Audio ! [Link], ...
Photo " Music [Link], ... ! Photo " Audio [Link], ...
Photo ! Music [Link], ... ! Photo ! Audio [Link], ...
! ! ! !

[Link] ![Link]

PL renaming refactoring
Thursday, July 23, 2009
Beyond program
behavior
1 6
! 5

2 4
!

3 3
! 2

4
! 1

PL products PL' products

Thursday, July 23, 2009


Extension without
impacting user base
Mobile Media Mobile Media

Media Management Screen Size Media Management Screen Size

!
Photo Music Send Photo Sorting 128x149 240x320 Photo Music Send Photo Sorting Copy 128x149 240x320
Send Photo Photo Send Photo Photo

[Link] [Link] !
Mobile Media [Link], ... Mobile Media [Link], ... [Link]
Photo [Link], ... Photo [Link], ...
Music [Link], ... Music [Link], ...
Photo " Music [Link], ... Photo " Music [Link], ...
Photo ! Music [Link], ... Photo ! Music [Link], ...
! ! ! Copy [Link], ...
! Copy ! Photo [Link], ...
[Link] ! ! [Link]

add optional feature


refactoring
Thursday, July 23, 2009
Formalizing refactoring

Behavior Quality
preservation factors

Thursday, July 23, 2009


Product line refinement
(F, A, K) ⊑ (Fʼ, Aʼ, Kʼ)

whenever

∀ c ∈ [[F ]] ⋅ ∃ cʼ ∈ [[Fʼ ]] ⋅
A ⟨[[K ]]c⟩ ⊑ Aʼ ⟨[[Kʼ ]]cʼ⟩

Thursday, July 23, 2009


Product line refactoring
PL ⋘ PLʼ

whenever

PL ⊑ PLʼ
PLʼ is better than PL

Thursday, July 23, 2009


PL renaming refactoring
Mobile Media Mobile Media

Media Management Screen Size Media Management Screen Size

!
Photo Music Send Photo Sorting 128x149 240x320 Photo Audio Send Photo Sorting 128x149 240x320
Send Photo Photo Send Photo Photo

[Link] [Link]
Mobile Media [Link], ... Mobile Media [Link], ...
Photo [Link], ... Photo [Link], ... !
Music [Link], ... ! Audio ! [Link], ...
Photo " Music [Link], ... ! Photo " Audio [Link], ...
Photo ! Music [Link], ... ! Photo ! Audio [Link], ...
! ! ! !

[Link] ![Link]

Thursday, July 23, 2009


Focus on products, not
feature names
Mobile Media Mobile Media

Media Management Screen Size Media Management Screen Size

!
Photo Music Send Photo Sorting 128x149 240x320 Photo Audio Send Photo Sorting 128x149 240x320
Send Photo Photo Send Photo Photo

[Link] [Link]
Mobile Media [Link], ... Mobile Media [Link], ...
Photo [Link], ... Photo [Link], ... !
Music [Link], ... ! Audio ! [Link], ...
Photo " Music [Link], ... ! Photo " Audio [Link], ...
Photo ! Music [Link], ... ! Photo ! Audio [Link], ...
! ! ! !

[Link] ![Link]

{Music, 240x320} {Audio, 240x320}

{[Link], [Link], ...} {[Link], [Link], ...}

class Music {...} class Audio {...}

Thursday, July 23, 2009


Add optional feature
refactoring
Mobile Media Mobile Media

Media Management Screen Size Media Management Screen Size

!
Photo Music Send Photo Sorting 128x149 240x320 Photo Music Send Photo Sorting Copy 128x149 240x320
Send Photo Photo Send Photo Photo

[Link] [Link] !
Mobile Media [Link], ... Mobile Media [Link], ... [Link]
Photo [Link], ... Photo [Link], ...
Music [Link], ... Music [Link], ...
Photo " Music [Link], ... Photo " Music [Link], ...
Photo ! Music [Link], ... Photo ! Music [Link], ...
! ! ! Copy [Link], ...
! Copy ! Photo [Link], ...
[Link] ! ! [Link]

Thursday, July 23, 2009


Safety for existing users
Mobile Media Mobile Media

Media Management Screen Size Media Management Screen Size

!
Photo Music Send Photo Sorting 128x149 240x320 Photo Music Send Photo Sorting Copy 128x149 240x320
Send Photo Photo Send Photo Photo

[Link] [Link] !
Mobile Media [Link], ... Mobile Media [Link], ... [Link]
Photo [Link], ... Photo [Link], ...
Music [Link], ... Music [Link], ...
Photo " Music [Link], ... Photo " Music [Link], ...
Photo ! Music [Link], ... Photo ! Music [Link], ...
! ! ! Copy [Link], ...
! Copy ! Photo [Link], ...
[Link] ! ! [Link]

{Music, 240x320} {Music, 240x320}

{[Link], [Link], ...} {[Link], [Link], ...}

class Music {...} class Music {...}

Thursday, July 23, 2009


No guarantees for new
users
Mobile Media Mobile Media

Media Management Screen Size Media Management Screen Size

!
Photo Music Send Photo Sorting 128x149 240x320 Photo Music Send Photo Sorting Copy 128x149 240x320
Send Photo Photo Send Photo Photo

[Link] [Link] !
Mobile Media [Link], ... Mobile Media [Link], ... [Link]
Photo [Link], ... Photo [Link], ...
Music [Link], ... Music [Link], ...
Photo " Music [Link], ... Photo " Music [Link], ...
Photo ! Music [Link], ... Photo ! Music [Link], ...
! ! ! Copy [Link], ...
! Copy ! Photo [Link], ...
[Link] ! ! [Link]

{Music, 240x320} {Music, 240x320, Copy}

{[Link], [Link], ...}

class Music {...} ?


Thursday, July 23, 2009
Useful evolution, but not
refactoring
Mobile Media Mobile Media

Media Management Screen Size Media Management Screen Size

!
Photo Music Send Photo Sorting 128x149 240x320 Photo Audio Send Photo Sorting 128x149 240x320
Send Photo Photo Send Photo Photo
[Link] [Link]
Mobile Media [Link], ... Mobile Media [Link], ...
Photo [Link], ... Photo [Link], ...
! !
Music [Link], ... ! Audio ! [Link], ...
Photo " Music [Link], ... ! Photo " Audio [Link], ...
Photo ! Music [Link], ... ! Photo ! Audio [Link], ...
! ! ! !

[Link] ![Link]

Audio

Thursday, July 23, 2009


Refactoring applies when
the intention is to...

• improve internal structure


• increase configurability
• preserve observable behavior

Thursday, July 23, 2009


Reducing configurability,
not refactoring
Mobile Media Mobile Media

Media Management Screen Size Media Management Screen Size


!
Photo Music Send Photo Sorting 128x149 240x320 Photo Music Send Photo Sorting 240x320
Send Photo Photo Send Photo Photo

[Link] [Link]
Mobile Media [Link], ... [Link] Mobile Media [Link], ...
Photo [Link], ... Photo [Link], ...
Music [Link], ... Music [Link], ...
Photo ! Music Photo ! Music !
[Link], ... [Link], ...
!
128x149 [Link] ! !
! !
[Link] [Link]

{Music, 128x149} ?

Thursday, July 23, 2009


Not preserving behavior,
not refactoring
Mobile Media Mobile Media

Media Management Screen Size Media Management Screen Size

!
Photo Music Send Photo Sorting 128x149 240x320 Photo Music Send Photo Sorting Copy 128x149 240x320
Send Photo Photo Send Photo Photo

[Link] [Link] !
Mobile Media [Link], ... Mobile Media [Link], ... [Link]
Photo [Link], ... Photo [Link], ...
Music [Link], ... Music [Link], ...
Photo " Music [Link], ... Photo " Music [Link], ...
Photo ! Music [Link], ... Photo ! Music [Link], ...
! ! ! Copy [Link], ...
! Copy ! Photo [Link], ...
[Link] ! ! [Link]

{Music, 240x320} {Music, 240x320, Copy}

Thursday, July 23, 2009


Remembering PL
refinement
(F, A, K) ⊑ (Fʼ, Aʼ, Kʼ)

whenever

∀ c ∈ [[F ]] ⋅ ∃ cʼ ∈ [[Fʼ ]] ⋅
A ⟨[[K ]]c⟩ ⊑ Aʼ ⟨[[Kʼ ]]cʼ⟩

Thursday, July 23, 2009


Simplifying checking...

[[K]] = [[K′ ]]

implies

(F, A, K) ⊑ (F, A, K′)

Thursday, July 23, 2009


bypassing program
refinement

∀ c ∈ [[F ]] ⋅ ∃ cʼ ∈ [[Fʼ ]] ⋅
[[K ]]c = [[Kʼ ]]cʼ

implies

(F, A, K) ⊑ (F′, A, K′)


Thursday, July 23, 2009
Not done yet!
Startup

Clouds
Main 1
Common

Product 1 Common
? Common !
Clouds

Product 2 Common Startup On demand


Startup On demand
Main 1 Main 2
Main 2 Main 1 Main 2

On demand

program PL
refactoring refactoring

Thursday, July 23, 2009


Product as a single-
product PL

({Root}, A, Root ⇉ domain(A))

product is the image of A

Thursday, July 23, 2009


Matching products
PL1

! 6
2
5
!
3 4

! 3

2
3 !
1
!
4
PL

PL2

Thursday, July 23, 2009


Population refinement

PL1 PL2 ⊑ PL

whenever

PL1 ⊑ PL ∧ PL 2 ⊑ PL

Thursday, July 23, 2009


Population refactoring

PL1 PL2 ⋘ PL

whenever

PL1 PL2 ⊑ PL
PL is better than PL 1 and PL2

Thursday, July 23, 2009


PL and population
refactoring
Mobile Media Mobile Media

Media Management Screen Size Media Management Screen Size

!
Photo Music Send Photo Sorting 128x149 240x320 Photo Music Send Photo Sorting Copy 128x149 240x320
Send Photo Photo Send Photo Photo

[Link] [Link] !
Mobile Media [Link], ... Mobile Media [Link], ... [Link]
Photo [Link], ... Photo [Link], ...
Music [Link], ... Music [Link], ...
Photo " Music [Link], ... Photo " Music [Link], ...
Photo ! Music [Link], ... Photo ! Music [Link], ...
! ! ! Copy [Link], ...
! Copy ! Photo [Link], ...
[Link] ! ! [Link]

Thursday, July 23, 2009


Software product line
refactoring
Paulo Borba
Informatics Center
Federal University of Pernambuco

phmb@[Link]

Thursday, July 23, 2009


Agenda
• PL concepts
• PL and population refactoring
• Refactoring of individual PL
artifacts
• Refactoring catalogues
• Research challenges
Thursday, July 23, 2009
Remembering PL
refinement
(F, A, K) ⊑ (Fʼ, Aʼ, Kʼ)

whenever

∀ c ∈ [[F ]] ⋅ ∃ cʼ ∈ [[Fʼ ]] ⋅
A ⟨[[K ]]c⟩ ⊑ Aʼ ⟨[[Kʼ ]]cʼ⟩

Thursday, July 23, 2009


PL and population
refactoring
Mobile Media Mobile Media

Media Management Screen Size Media Management Screen Size

!
Photo Music Send Photo Sorting 128x149 240x320 Photo Music Send Photo Sorting Copy 128x149 240x320
Send Photo Photo Send Photo Photo

[Link] [Link] !
Mobile Media [Link], ... Mobile Media [Link], ... [Link]
Photo [Link], ... Photo [Link], ...
Music [Link], ... Music [Link], ...
Photo " Music [Link], ... Photo " Music [Link], ...
Photo ! Music [Link], ... Photo ! Music [Link], ...
! ! ! Copy [Link], ...
! Copy ! Photo [Link], ...
[Link] ! ! [Link]

Thursday, July 23, 2009


Refactoring catalogue...
allow us to forget the
formal definition when
performing refactoring
activities

Thursday, July 23, 2009


but refinement
catalogue
is the essence!

Thursday, July 23, 2009


Add optional feature
refactoring, specific case
Mobile Media Mobile Media

Media Management Screen Size Media Management Screen Size

!
Photo Music Send Photo Sorting 128x149 240x320 Photo Music Send Photo Sorting Copy 128x149 240x320
Send Photo Photo Send Photo Photo

[Link] [Link] !
Mobile Media [Link], ... Mobile Media [Link], ... [Link]
Photo [Link], ... Photo [Link], ...
Music [Link], ... Music [Link], ...
Photo " Music [Link], ... Photo " Music [Link], ...
Photo ! Music [Link], ... Photo ! Music [Link], ...
! ! ! Copy [Link], ...
! Copy ! Photo [Link], ...
[Link] ! ! [Link]

Thursday, July 23, 2009


Add optional feature
refinement template
F' n!a
F ⋮
n!a n' ! a'


P
P ! e m
e m ⋮ ⋮
⋮ ⋮ e' m'
O
⋮ ⋮

¬O ¬e'

Thursday, July 23, 2009


Alternative notation

A ! A'
A F
F "
K e n
K!
O ⋮ ⋮

¬O ¬e

Thursday, July 23, 2009


PL renaming refactoring
Mobile Media Mobile Media

Media Management Screen Size Media Management Screen Size

!
Photo Music Send Photo Sorting 128x149 240x320 Photo Audio Send Photo Sorting 128x149 240x320
Send Photo Photo Send Photo Photo

[Link] [Link]
Mobile Media [Link], ... Mobile Media [Link], ...
Photo [Link], ... Photo [Link], ... !
Music [Link], ... ! Audio ! [Link], ...
Photo " Music [Link], ... ! Photo " Audio [Link], ...
Photo ! Music [Link], ... ! Photo ! Audio [Link], ...
! ! ! !

[Link] ![Link]

Thursday, July 23, 2009


PL renaming refinement
template
n!a m' ! a[A'/A]
n' ! a' n' ! a' [A'/A]
F ⋮ F' ⋮
!
e m e[F'/F] m[m'/n]
c ⋮ ⋮ c [F'/F] ⋮ ⋮

p!p[A'/A] for any p belonging to the


language of the assets in a

Thursday, July 23, 2009


Composing
transformations: deriving
more elaborate
refinements from basic
ones

Thursday, July 23, 2009


Feature renaming

A A
F F'
e n ! e[F'/F] n
⋮ ⋮ ⋮ ⋮
c c [F'/F]

Thursday, July 23, 2009


Renaming asset name

n!a m' ! a
n' ! a' n' ! a'
F ⋮ ! F ⋮

e m e m[m'/n]
⋮ ⋮ ⋮ ⋮

Thursday, July 23, 2009


Renaming asset
declaration

n!a n ! a[A'/A]
⋮ ⋮
F ! F
K K

p!p[A'/A] for any p belonging to the


language of the assets in a

Thursday, July 23, 2009


Clouds extraction

Clouds

Rain of fire Common


Rain of fire
NewCommon

Image loading Clouds Image loading


Startup On demand
Startup On demand
Main 1 Main 2
On demand Startup On demand Startup Main 1 Main 2

Rain of fire [Link], [Link]


Rain of fire [Link], [Link]
On Demand Main 2, [Link]
On Demand Main 2, [Link] Start Up Main 1, [Link]
Start Up Main 1, [Link] Clouds [Link]

{StartUp} {StartUp, Clouds}

Thursday, July 23, 2009


Extracting optional
feature
n!b

n!a m' ! b'
⋮ ⋮
n' ! a' P n' ! a'
⋮ ⋮
P
e m
! e m
⋮ ⋮ O ⋮ ⋮
O m'

a ! b b'
b and a' do not depend on b'

Thursday, July 23, 2009


Extract before-execution
eds
eds
class C { priv aspect A {
class C {
fds before(context) :
fds
mds exec(C.m) &&
= mds
T m(pds) { bind(context) {
T m(pds) {
body’; body’[cthis/this]
body
body }
}
} }
}
}
(→) bodyʼ does not declare or use local variables;
bodyʼ does not call super;...
Thursday, July 23, 2009
Refactoring and
refinement catalogues
consist of these kinds of
transformation
templates...
with a completeness
result
Thursday, July 23, 2009
Focus on a particular
artifact

n!a n ! a[A'/A]
⋮ ⋮
F ! F
K K

p!p[A'/A] for any p belonging to the


language of the assets in a
Renaming asset declaration
Thursday, July 23, 2009
Need for individual
refinement notions and
catalogues for different
PL artifacts

Thursday, July 23, 2009


Assets mapping
refinement

n!a ! n ! a[A'/A]
⋮ ⋮

p!p[A'/A] for any p belonging to the


language of the assets in a

Thursday, July 23, 2009


Assets mapping
refinement
A ⊑ Aʼ
when

domain(A) = domain(Aʼ )
∀ a ∈ domain(A)⋅A(a) ⊑ Aʼ (a)
Thursday, July 23, 2009
Bad smell in feature
models
Mobile Media

Media Management Screen Size

Photo Music Send Photo Sorting 128x149 240x320

Send Photo Photo


Sorting (Photo ! Music)

Thursday, July 23, 2009


Feature model
equivalence
F = Fʼ
when

[[F ]] = [[Fʼ ]]

Thursday, July 23, 2009


Replace alternative

P
P
= Q R
Q R

Q ¬R ! R ¬Q

Thursday, July 23, 2009


Replace or

P
P
=
Q R
Q R

P (Q ! R)

Thursday, July 23, 2009


Remove optional

P
P
=
Q
Q
Q P

Thursday, July 23, 2009


Reducing to constraints...

P P
P P P
P
= = =
Q R Q R
Q R Q R Q
Q
Q ¬R ! R ¬Q P (Q ! R) Q P

Thursday, July 23, 2009


Refactoring a feature
model...

Thursday, July 23, 2009


by moving features
around

Thursday, July 23, 2009


Single-product PL
refactoring is product
refactoring

P⊑Q

pl(P) ⊑ pl(Q)

Thursday, July 23, 2009


Compositionality
theorem

F = Fʼ ∧ A = Aʼ ∧ K = Kʼ

(F, A, K) = (Fʼ, Aʼ, Kʼ)

Thursday, July 23, 2009


FLiP

Thursday, July 23, 2009


Conclusions
• Refactoring as a tool for PL
extraction and evolution
• Catalogues have to be developed
• Other properties
• Feature and variation mining
• Feature modularization
Thursday, July 23, 2009
Thank
you!
Thursday, July 23, 2009
Acknowledgements
Rohit Rodrigo
Márcio Gheyi Bonifácio
Ribeiro Leopoldo Vander
Teixeira Alves

Carlos Sérgio
Tiago Pontual Soares
Massoni Fernando
Castor
Thursday, July 23, 2009
Software product line
refactoring
Paulo Borba
Informatics Center
Federal University of Pernambuco

phmb@[Link]

Thursday, July 23, 2009

You might also like