1. Nasir AliNasir Ali, Wei Wu, Giuliano Antoniol, Max Di Penta,, Wei Wu, Giuliano Antoniol, Max Di Penta,
Yann-Gaël Guéhéneuc, Jane Huffman HayesYann-Gaël Guéhéneuc, Jane Huffman Hayes
MoMS: Multi-objective Miniaturization ofMoMS: Multi-objective Miniaturization of
SoftwareSoftware
ICSM 2011
8. Pre-requirement Elicitation andPre-requirement Elicitation and
ConsolidationConsolidation
§ We need pre-requirement documents:We need pre-requirement documents:
§ What do we have?
§ What do our customers want?
§ What is the weight of each customer?
§ We obtain and vet a list of requirements fromWe obtain and vet a list of requirements from
diverse stakeholdersdiverse stakeholders
§ We structure requirements by mapping them intoWe structure requirements by mapping them into
a representation suitable for grouping viaa representation suitable for grouping via
pattern-recognition and similarity-basedpattern-recognition and similarity-based
clusteringclustering
ICSM 2011
10. Features to SizeFeatures to Size
§ Traceability relations are tagged with:Traceability relations are tagged with:
§ Size information
§ IDs and weights of customers requiring the feature
§ Features are divided into:Features are divided into:
§ Compulsory
§ Cherry on the pie
§ Selected features must lead to a compilableSelected features must lead to a compilable
system:system:
§ Extra code may be needed just to make sure that the
system compiles and runs
ICSM 2011
11. Features to CPU ConsumptionFeatures to CPU Consumption
§ Assumption: CPU cycles/consumption is related to energyAssumption: CPU cycles/consumption is related to energy
consumption:consumption:
§ The higher the CPU consumption, the lower the battery life
§ Binder’s JP2 profiling tool: comprehensive calling-contextBinder’s JP2 profiling tool: comprehensive calling-context
profiles:profiles:
§ Exact number of executed bytecodes for each calling context
§ Caveat: modern hardware architecture prevent exactCaveat: modern hardware architecture prevent exact
estimation based on bytecode countingestimation based on bytecode counting
§ But: bytecode counting is a good approximation of run time
algorithmic complexity.
§ The lower the number of executed bytecodes, the lower the CPU
time, the lower the battery consumption
ICSM 2011
12. Requirements to Features
Scenario 1
(feature a)
Scenario N
(feature z)
Scenario 2
(feature b)
…
Run System
Trace 1
Trace 2
Trace N
…
ICSM 2011
13. Dynamic Information*Dynamic Information*
§ Call tree:Call tree:
§ Integrate call tree information for each executed feature with
static traceability relations to count executed bytecodes
§ Evaluate CPU consumption at method level: accumulateEvaluate CPU consumption at method level: accumulate
into call-tree top nodes the counts of lower nodes:into call-tree top nodes the counts of lower nodes:
§ Top nodes thus stores sub-tree bytecode counts
§ Top nodes account for all executed bytecodes, including JARs
and utility methods
§ Caveat:Caveat:
§ Some feature may not be completely implemented
§ Some feature may not be executed due to missing
components
ICSM 2011
14. Miniaturization ProblemMiniaturization Problem
§ We would like to:We would like to:
§ Minimize size and CPU consumption
§ Maximize customer satisfaction
§ Constraints may be imposed on search space:Constraints may be imposed on search space:
§ Max available memory, max CPU power, customers
who must be satisfied
§ Generate a Pareto surface:Generate a Pareto surface:
§ Project Pareto surface onto a Pareto front
§ Final decision to the managerFinal decision to the manager
ICSM 2011
15. Miniaturization Problem (cont’d)*Miniaturization Problem (cont’d)*
{ }
{ }
{ }
{ }
{ } intervalaniswhere...HCsconstraint
ofsetameetmustthatRPpropertiesareThere
;...IUunitstionimplementaofsetahaveWe
features;OFFimplementsprogramedminiaturizA
features;desiredicustomerlist...FEach
features;optionaldesiredcustomer...OF
features;compulsoryComFofsetA
assigned;Vv0value""hascustomerEach
customers;L...
1
K
1
1i
1
max
1
jk
M
iNi
L
L
hchchc
iuiu
ff
FF
ccC
i
=
Ì
=
Í¢
=
=
££
=
ICSM 2011
16. Miniaturization Problem (cont’d)*Miniaturization Problem (cont’d)*
§ Traceability creates aTraceability creates a
function Impl that, given afunction Impl that, given a
feature, assignsfeature, assigns
implementation unitsimplementation units
§ Each implementation unitEach implementation unit
has properties, e.g., eachhas properties, e.g., each
method have a size and amethod have a size and a
CPU consumptionCPU consumption
§ The CustomerThe Customer
Satisfaction Ratio (CSR)Satisfaction Ratio (CSR)
is defined as:is defined as:
L
V
v
F
FF
FCSR
iL
i
i
i
max
1
)(
´
¢Ç
=¢
å=
ICSM 2011
17. Miniaturization Problem (cont’d)*Miniaturization Problem (cont’d)*
§ Maximize CSR(F’)Maximize CSR(F’)
means minimizemeans minimize
–CSR(F’)–CSR(F’)
§ For a given set ofFor a given set of
features F’, thefeatures F’, the
implementation unitsimplementation units
and the overalland the overall
properties are:properties are: ( )
( )( )ComFFImplProp'
ComFFImpl'
È¢=
È¢=
P
IU
ICSM 2011
18. Miniaturization Problem (cont’d)*
( )[ ]{ }
( ) ( )[ ] iKi
F
hcppp
FCSROF
ÎÈ="
È-
Î
i1i
2'
p:ComFF'ImplProp......|p
:such that
ComFF'ImplProp),'(min
Notice that ( )( )ComFFImplProp Ȣ
is actually an array of sizes and CPU consumptions.
Thus, a solution is a surface:
CSR = FUNC(size, CPU consumption)
ICSM 2011
20. NSGA-II ParametersNSGA-II Parameters
§ We used JMETAL:We used JMETAL:
§ Mutation probability 4%
§ Crossover 90%
§ Evaluation number 25,000
§ High iteration number to ensure that we did notHigh iteration number to ensure that we did not
miss good solutionsmiss good solutions
ICSM 2011
24. SIP Projection CSR vs. Size vs. CPUSIP Projection CSR vs. Size vs. CPU
ICSM 2011
25. Lessons LearnedLessons Learned
§ The miniaturization process is feasible but thereThe miniaturization process is feasible but there
are challenges:are challenges:
§ Traceability recovery and accuracy of traced links
§ Collecting dynamic information is difficult:
§ Missing or not 100% implemented features
§ CPU consumption difficult to run:
§ We are still completing SIP
§ Some system (SIP) may exhibit tangledSome system (SIP) may exhibit tangled
dependencies and there may be no sweet spotdependencies and there may be no sweet spot
ICSM 2011
26. ConclusionConclusion
§ The porting problem was modeled as aThe porting problem was modeled as a
multi-objective minimization problemmulti-objective minimization problem
§ Equations can accommodate a wide range ofEquations can accommodate a wide range of
propertiesproperties
§ The process can be automated thus savingThe process can be automated thus saving
considerable manual effort in selecting featuresconsiderable manual effort in selecting features
to be ported:to be ported:
§ Yet not in validating traceability links if links do not exist
ICSM 2011