51. Modeling History
to Understand Software Evolution
Inauguraldissertation der
Philosophisch-naturwissenschaftlichen
Fakultät der Universität Bern
vorgelegt von
Tudor Gîrba
von Rumänien
Leiter der Arbeit:
Prof. Dr. Stéphane Ducasse
Prof. Dr. Oscar Nierstrasz
Institut für Informatik und
angewandte Mathematik
52. Modeling History
to Understand Software Evolution
Inauguraldissertation der
Philosophisch-naturwissenschaftlichen
Fakultät der Universität Bern
vorgelegt von
Tudor Gîrba
von Rumänien
Leiter der Arbeit:
Prof. Dr. Stéphane Ducasse
Prof. Dr. Oscar Nierstrasz
Institut für Informatik und
angewandte Mathematik
To provide a generic
meta-model for
expressing software
evolution analyses,
we need to recognize
evolution as an explicit
phenomenon and model
it as a first class entity.
88. whitespace is a resource a resource
whitespace
whitespace
whitespace is a resource
is a resource
whitespace is a resourceis a resource is a is a resource
whitespace is whitespace
whitespace
whitespace is a whitespace is a resource
resource
whitespace is a is a is aresource
resource
whitespace is a resource
whitespacewhitespace is a resource
resource
whitespace whitespace
whitespaceaisresource is a resource resource a resource
a resource
whitespace is a whitespace is
resource
whitespaceresource resource
is awhitespace
resource
whitespace is aisresource
whitespace is a resource whitespace resource
whitespace is a is a resource whitespace is a is whitespace is a is a resource
whitespacewhitespace is a resourceresourceisaaresource
whitespace is a
whitespace resource
whitespace is a
resource
whitespace is a is a resource
whitespace resource
whitespace is a resource
whitespace isisaaresource
whitespacewhitespace is a resource whitespacea resource
resource
whitespace is
whitespace is a resource
whitespace is a resource
is a resource
whitespace is a resource whitespace is awhitespace a resource
resource
whitespace is a resource
whitespace is a resource whitespace is a resourceawhitespace is
whitespace is aisresource
whitespace
resource
whitespaceresource a resourceresourceisaaresource
is a resource whitespace is resource
whitespace is a resource
whitespacewhitespace is
is a
whitespace is a resource is a resource whitespace is a
whitespace
whitespace
whitespace is a resource
whitespace is a resource whitespace is a resource is a resource
whitespace
whitespace is is resource
whitespace is a resource
whitespace is a resourcea a resource
whitespace
whitespace is a resource resource
whitespace iswhitespaceresource whitespace is a whitespace is a resource
ais aaresource resource
resource is a
whitespace is a resourcea
whitespace
whitespace is resource
whitespace isis a resource
is a is a is
whitespace is a whitespace isis whitespace is aa a resource resource
whitespace
whitespace aisresource aisresource whitespaceresource resource a resource
whitespaceais a resourceresource whitespaceresource resource resource
resource is awhitespace a a whitespace is resource a
resourcewhitespace is is
whitespace whitespace a
whitespace
whitespace is is is awhitespacewhitespace whitespacearesource resource
whitespace resource aaresourcea resource whitespacea is is aisresource
resource is is whitespace
whitespace
is resource
a
whitespaceisawhitespaceisisresource whitespacewhitespaceresource is a resource
whitespace resourcea resource resourcewhitespace
aresource is aaresourcewhitespace a isresource
resource a resource is whitespaceresource
a whitespace
whitespace resource a
whitespaceresource resourcea resource isiswhitespace aisresource
whitespaceiswhitespace iswhitespace isisaaresource
is is
whitespacewhitespace a is whitespace is a resource resource is ais a resource
whitespaceisiswhitespace is whitespace whitespace is whitespace
aaiswhitespace aisresourceisaaresource isaaresource
whitespaceiswhitespace a resource whitespace is a resource resourceresource
aresource whitespaceis isisaaresource whitespace resource
whitespaceisresourcea resource whitespace isis aresource
whitespace is whitespacewhitespace isis awhitespace is is is a resource
aresource awhitespace resource a resource
whitespace isaaaresource a resourceresourceresource is whitespace a a
whitespacewhitespace isresource resource aisresource aaresource
a is
resource a a is whitespace
whitespace iswhitespace whitespaceresourcea resourceresource resource
whitespace whitespace whitespaceresourcea
whitespaceiswhitespaceis resourcewhitespacewhitespaceresourceresource
whitespaceresource resourceresource whitespaceisresource a
is iswhitespaceaa resourceisaaresource resource
a resourceresourcewhitespace aa is a a is is
is
whitespaceiswhitespace aaresource whitespacewhitespaceawhitespace is a resource
resourcea resourceaawhitespace isiswhitespace
is
whitespacewhitespace is a resourceresource
whitespacewhitespacewhitespaceresourceiswhitespaceresourceaisresourceresource
aaresourceis isisaaresourceawhitespaceisaaaresource
whitespacewhitespaceis is a whitespace is resource resource
whitespaceresourceisresourceresource whitespaceresource is a resource
whitespacewhitespace a isawhitespace
is isis
a
whitespace whitespaceisisresource whitespace iswhitespace
whitespace aaresourceaisis resource resourceaaresource
is resource resource
a resourceais is aresourcewhitespacewhitespace
whitespaceaaisresourcea resourcewhitespaceisisiswhitespace is aaresource
iswhitespace whitespacea a resource resource
whitespace a
whitespace is whitespace whitespace whitespace is resource
resourceis
whitespace
whitespace resource whitespace whitespace is whitespace is a resource
iswhitespace is a resource whitespace isaaresource
whitespace is a iswhitespace isaaresourceresource
whitespacewhitespaceresource
whitespace is aisresource whitespace is a resource resource
whitespaceiswhitespace is a resource resourcewhitespace whitespace is a resource
iswhitespace
is
whitespace isaa awhitespace resource
whitespacewhitespace
whitespace
whitespace whitespace isisa aresourceisis a resource a resource
resource
is resource
whitespace a resource a
whitespace whitespaceresourcewhitespace whitespacearesource
whitespace isisresource whitespace awhitespace iswhitespace is a resource
is a resource a resourcewhitespace is isisaaresource
a a whitespace isisaawhitespace aisa is whitespace is a resource
whitespace is is resource resource
resource
whitespace
resource
resourceresource
whitespacea resource is resource whitespace isaa resource
resource
whitespace iswhitespaceresource whitespace whitespace is a resource
whitespace isisaa resource aaresource
whitespace
resource
whitespace isisa resourceis whitespace whitespace a resource resource
whitespace a resource whitespace isisaaresourceis resource
whitespace a resource is a resource a resource
is a is
whitespace is
whitespace whitespace is a resource whitespace is a
whitespace
whitespace iswhitespaceresource is whitespacewhitespaceisisa aaresource
is a is resource whitespace is resourceresource
whitespaceis whitespace awhitespacewhitespace is resource
is
whitespace resource whitespace is isaaresource
whitespace resource whitespace resource resource
a
whitespaceresource resourceresourceresourcewhitespace is a resource
whitespace is a is a a is a whitespace a whitespace is a resource
whitespace is resource
a isis
resource
whitespaceresourceisaaresourcea resourceresource isresource
whitespaceisis aresource resource whitespacewhitespaceresourcea resource
isa a whitespace is is whitespace whitespaceaaisisaaresource
whitespace a resource resource a resource whitespaceaa resource
whitespaceis a resource
whitespace
whitespace
whitespace resource resourcea resource aiswhitespace a resource
is is whitespace whitespace ais isresource
a
whitespace is ais resource
whitespace a a isawhitespace is whitespaceresource
is
whitespace isis whitespaceisisresourceresourcea resourcewhitespaceaisis a resource
whitespacewhitespaceresourcewhitespaceresource a is is resource
whitespace whitespace whitespaceisisaisresource
whitespace resourcewhitespacewhitespaceiswhitespaceis
whitespace awhitespace aaresourceresource
whitespacewhitespaceaisresource iswhitespace isiswhitespace resourceresource
awhitespace awhitespace iswhitespaceaawhitespace
resource
whitespace whitespaceaisisaawhitespaceaisis whitespacearesource a resource
isis aisis resource
a resource resource is awhitespaceresource
resource a whitespace
is is resource
whitespace
resource resourceais whitespace is a a
whitespace a aresourceresource
is whitespace is resource
whitespacewhitespaceresource is a whitespace a isa aresource resource
a is aiswhitespace whitespace aresource a
resource resource resource a resource
resourceis resource
whitespace aresource
whitespacewhitespaceaaisresourceisresource whitespace
is whitespace aresourcewhitespace
a is resource whitespace
resource resource
whitespacea
whitespace isisawhitespacea awhitespaceiswhitespaceisis is a resource
whitespace is resourcea is resource isa resource
whitespace aiswhitespaceais isisaaresourceis aisiswhitespace is a resource
a whitespace a awhitespace whitespace
resource
whitespaceresourceawhitespace resourcewhitespace is a resource
whitespaceiswhitespace whitespace
whitespaceaaresourceis is resourceis a resource
whitespaceresource resource
whitespace is whitespace aaresource
resource
whitespace resource
aresource a resourcea whitespace is a
is
whitespace iswhitespaceresource is a resourceresourceresource resource
whitespace is aisresource whitespace a resource a
whitespace is a a resource
whitespace is
is
whitespace is aisresourcewhitespace resource is a resource is a resource
is
whitespace
whitespacewhitespaceresource
whitespaceaaresource resource
whitespace is is resourcewhitespace a resource
a is is awhitespace is
whitespace is a resource whitespace is a
whitespace
a resource
whitespace is a isa aresource whitespacewhitespace is resource
whitespace
resource
whitespace is resource
whitespaceresourceiswhitespacea a resource resource resource
is a resource whitespace resource is a
whitespace isis resourcea a resource
whitespace iswhitespace
a is
whitespace whitespace is
whitespace is a
whitespace is a resource
whitespace is a resource
whitespace is a resource is a resource whitespace is a resource
whitespace
iswhitespaceresource
a resource is a resource
whitespace is a resource whitespace whitespaceais is a resource
whitespace resource
whitespace is a resource whitespaceresource whitespace a resource
whitespace is a is
whitespace resourceresource
whitespace resource
whitespace a a resource
whitespace is a is ais is aisresource
whitespace resource
whitespace is whitespace whitespace is a resource
whitespace is ais a resource
whitespace is a resource is a resource is a resource
a whitespace whitespace
is a resource
whitespace is a resource
whitespace is a resource whitespace is a resourceresource
is a resource whitespace is aisresource
whitespace a
whitespace is a resource whitespace resource
whitespace is a
whitespace is a resource
89. whitespace is a resource a resource
whitespace
whitespace
whitespace is a resource
is a resource
whitespace is a resourceis a resource is a is a resource
whitespace is whitespace
whitespace
whitespace is a whitespace is a resource
resource
whitespace is a is a is aresource
resource
whitespace is a resource
whitespacewhitespace is a resource
resource
whitespace whitespace
whitespaceaisresource is a resource resource a resource
a resource
whitespace is a whitespace is
resource
whitespaceresource resource
is awhitespace
resource
whitespace is aisresource
whitespace is a resource whitespace resource
whitespace is a is a resource whitespace is a is whitespace is a is a resource
whitespacewhitespace is a resourceresourceisaaresource
whitespace is a
whitespace resource
whitespace is a
resource
whitespace is a is a resource
whitespace resource
whitespace is a resource
whitespace isisaaresource
whitespacewhitespace is a resource whitespacea resource
resource
whitespace is
whitespace is a resource
whitespace is a resource
is a resource
whitespace is a resource whitespace is awhitespace a resource
resource
whitespace is a resource
whitespace is a resource whitespace is a resourceawhitespace is
whitespace is aisresource
whitespace
resource
whitespaceresource a resourceresourceisaaresource
is a resource whitespace is resource
whitespace is a resource
whitespacewhitespace is
is a
whitespace is a resource is a resource whitespace is a
whitespace
whitespace
whitespace is a resource
whitespace is a resource whitespace is a resource is a resource
whitespace
whitespace is is resource
whitespace is a resource
whitespace is a resourcea a resource
whitespace
whitespace is a resource resource
whitespace iswhitespaceresource whitespace is a whitespace is a resource
ais aaresource resource
resource is a
whitespace is a resourcea
whitespace
whitespace is resource
whitespace isis a resource
is a is a is
whitespace is a whitespace isis whitespace is aa a resource resource
whitespace
whitespace aisresource aisresource whitespaceresource resource a resource
whitespaceais a resourceresource whitespaceresource resource resource
resource is awhitespace a a whitespace is resource a
resourcewhitespace is is
whitespace whitespace a
whitespace
whitespace is is is awhitespacewhitespace whitespacearesource resource
whitespace resource aaresourcea resource whitespacea is is aisresource
resource is is whitespace
whitespace
is resource
a
whitespaceisawhitespaceisisresource whitespacewhitespaceresource is a resource
whitespace resourcea resource resourcewhitespace
aresource is aaresourcewhitespace a isresource
resource a resource is whitespaceresource
a whitespace
whitespace resource a
whitespaceresource resourcea resource isiswhitespace aisresource
whitespaceiswhitespace iswhitespace isisaaresource
is is
whitespacewhitespace a is whitespace is a resource resource is ais a resource
whitespaceisiswhitespace is whitespace whitespace is whitespace
aaiswhitespace aisresourceisaaresource isaaresource
whitespaceiswhitespace a resource whitespace is a resource resourceresource
aresource whitespaceis isisaaresource whitespace resource
whitespaceisresourcea resource whitespace isis aresource
whitespace is whitespacewhitespace isis awhitespace is is is a resource
aresource awhitespace resource a resource
whitespace isaaaresource a resourceresourceresource is whitespace a a
whitespacewhitespace isresource resource aisresource aaresource
a is
resource a a is whitespace
whitespace iswhitespace whitespaceresourcea resourceresource resource
whitespace whitespace whitespaceresourcea
whitespaceiswhitespaceis resourcewhitespacewhitespaceresourceresource
whitespaceresource resourceresource whitespaceisresource a
is iswhitespaceaa resourceisaaresource resource
a resourceresourcewhitespace aa is a a is is
is
whitespaceiswhitespace aaresource whitespacewhitespaceawhitespace is a resource
resourcea resourceaawhitespace isiswhitespace
is
whitespacewhitespace is a resourceresource
whitespacewhitespacewhitespaceresourceiswhitespaceresourceaisresourceresource
aaresourceis isisaaresourceawhitespaceisaaaresource
whitespacewhitespaceis is a whitespace is resource resource
whitespaceresourceisresourceresource whitespaceresource is a resource
whitespacewhitespace a isawhitespace
is isis
a
whitespace whitespaceisisresource whitespace iswhitespace
whitespace aaresourceaisis resource resourceaaresource
is resource resource
a resourceais is aresourcewhitespacewhitespace
whitespaceaaisresourcea resourcewhitespaceisisiswhitespace is aaresource
iswhitespace whitespacea a resource resource
whitespace a
whitespace is whitespace whitespace whitespace is resource
resourceis
whitespace
whitespace resource whitespace whitespace is whitespace is a resource
iswhitespace is a resource whitespace isaaresource
whitespace is a iswhitespace isaaresourceresource
whitespacewhitespaceresource
whitespace is aisresource whitespace is a resource resource
whitespaceiswhitespace is a resource resourcewhitespace whitespace is a resource
iswhitespace
is
whitespace isaa awhitespace resource
whitespacewhitespace
whitespace
whitespace whitespace isisa aresourceisis a resource a resource
resource
is resource
whitespace a resource a
whitespace whitespaceresourcewhitespace whitespacearesource
whitespace isisresource whitespace awhitespace iswhitespace is a resource
is a resource a resourcewhitespace is isisaaresource
a a whitespace isisaawhitespace aisa is whitespace is a resource
whitespace is is resource resource
resource
whitespace
resource
resourceresource
whitespacea resource is resource whitespace isaa resource
resource
whitespace iswhitespaceresource whitespace whitespace is a resource
whitespace isisaa resource aaresource
whitespace
resource
whitespace isisa resourceis whitespace whitespace a resource resource
whitespace a resource whitespace isisaaresourceis resource
whitespace a resource is a resource a resource
is a is
whitespace is
whitespace whitespace is a resource whitespace is a
whitespace
whitespace iswhitespaceresource is whitespacewhitespaceisisa aaresource
is a is resource whitespace is resourceresource
whitespaceis whitespace awhitespacewhitespace is resource
is
whitespace resource whitespace is isaaresource
whitespace resource whitespace resource resource
a
whitespaceresource resourceresourceresourcewhitespace is a resource
whitespace is a is a a is a whitespace a whitespace is a resource
whitespace is resource
a isis
resource
whitespaceresourceisaaresourcea resourceresource isresource
whitespaceisis aresource resource whitespacewhitespaceresourcea resource
isa a whitespace is is whitespace whitespaceaaisisaaresource
whitespace a resource resource a resource whitespaceaa resource
whitespaceis a resource
whitespace
whitespace
whitespace resource resourcea resource aiswhitespace a resource
is is whitespace whitespace ais isresource
a
whitespace is ais resource
whitespace a a isawhitespace is whitespaceresource
is
whitespace isis whitespaceisisresourceresourcea resourcewhitespaceaisis a resource
whitespacewhitespaceresourcewhitespaceresource a is is resource
whitespace whitespace whitespaceisisaisresource
whitespace resourcewhitespacewhitespaceiswhitespaceis
whitespace awhitespace aaresourceresource
whitespacewhitespaceaisresource iswhitespace isiswhitespace resourceresource
awhitespace awhitespace iswhitespaceaawhitespace
resource
whitespace whitespaceaisisaawhitespaceaisis whitespacearesource a resource
isis aisis resource
a resource resource is awhitespaceresource
resource a whitespace
is is resource
whitespace
resource resourceais whitespace is a a
whitespace a aresourceresource
is whitespace is resource
whitespacewhitespaceresource is a whitespace a isa aresource resource
a is aiswhitespace whitespace aresource a
resource resource resource a resource
resourceis resource
whitespace aresource
whitespacewhitespaceaaisresourceisresource whitespace
is whitespace aresourcewhitespace
a is resource whitespace
resource resource
whitespacea
whitespace isisawhitespacea awhitespaceiswhitespaceisis is a resource
whitespace is resourcea is resource isa resource
whitespace aiswhitespaceais isisaaresourceis aisiswhitespace is a resource
a whitespace a awhitespace whitespace
resource
whitespaceresourceawhitespace resourcewhitespace is a resource
whitespaceiswhitespace whitespace
whitespaceaaresourceis is resourceis a resource
whitespaceresource resource
whitespace is whitespace aaresource
resource
whitespace resource
aresource a resourcea whitespace is a
is
whitespace iswhitespaceresource is a resourceresourceresource resource
whitespace is aisresource whitespace a resource a
whitespace is a a resource
whitespace is
is
whitespace is aisresourcewhitespace resource is a resource is a resource
is
whitespace
whitespacewhitespaceresource
whitespaceaaresource resource
whitespace is is resourcewhitespace a resource
a is is awhitespace is
whitespace is a resource whitespace is a
whitespace
a resource
whitespace is a isa aresource whitespacewhitespace is resource
whitespace
resource
whitespace is resource
whitespaceresourceiswhitespacea a resource resource resource
is a resource whitespace resource is a
whitespace isis resourcea a resource
whitespace iswhitespace
a is
whitespace whitespace is
whitespace is a
whitespace is a resource
whitespace is a resource
whitespace is a resource is a resource whitespace is a resource
whitespace
iswhitespaceresource
a resource is a resource
whitespace is a resource whitespace whitespaceais is a resource
whitespace resource
whitespace is a resource whitespaceresource whitespace a resource
whitespace is a is
whitespace resourceresource
whitespace resource
whitespace a a resource
whitespace is a is ais is aisresource
whitespace resource
whitespace is whitespace whitespace is a resource
whitespace is ais a resource
whitespace is a resource is a resource is a resource
a whitespace whitespace
is a resource
whitespace is a resource
whitespace is a resource whitespace is a resourceresource
is a resource whitespace is aisresource
whitespace a
whitespace is a resource whitespace resource
whitespace is a
whitespace is a resource
fill it for a reason
121. least one of the recently most changed classes is among the
most changed classes in the near˛future relative to version i.
˛ S 0 ✓ S,
˛
If the assumption holds for version i0 |we n
˛ |S = have a hit.
(0 <formally T opM (S, n)Yesterday’s Weather hit function
n < 1) define the = S 0 ˛
(5)
We
˛ 8x 2 S 0 , 8y 2 S S 0
˛
˛ M (x) > M (y)
applied on version i of a system history S and given the two
threshold values t1 and t2 as follows:
For a system version i, we compare the set of class
histories twith the highest LENOM 1..i values (the candi(i > 1; 1 , t2
1)
8
dates set) with the set of the class histories (S, t1) highwith the
> 1, T opLEN OM1..i
>
<
est EENOM i..n valuesYesterday’s Weatheri..n (S, The Yester(the really-changed set). t2) on;
T opEEN OM applied 6=
We formally define, t2 ) =
the
Y Wi (S, t1
(6)
0, T opLEN OM1..i (S, t1)of these
day’s Weather assumption given if threshold values
>
>
:
n versions of a system history S holdsop the intersection = ;
two
T one class history belongs
sets as in Equation that is at least EEN OMi..n (S, t2)
t1 and t2 is not empty, 7.
to both sets. This means that for the classes in version i at
Yesterday’s Weather is computed by counting the hits for
least one of, the recently most changed classes is among the
all (n > 2; t1 and dividing them by the total number of posversions t2 1)
Pn 1
most changed classes in the near future relative to version i.
sible hits. Thus, we obtain the result(S, t1 , t2 )
i=2 Y Wi as a percentage with
Y W1..n (S, 1 , t2 ) for
If the assumption tholds = version i we have a hit. (7)
values between 0% and 100%. n 2
We formally define the Yesterday’s Weather hit function
122. yesterdayWeatherProbabilityWithTopPreviousWENM: topPreviousWENM
andTopCurrentENM: topCurrentENM
| currentVersions previousClassHistoriesSortedByWENM
yesterdayWeatherHits last2VersionsTopHistories last2Versions
last2HistoriesSortedByENM x valuesCount previousVersionsTopHistories
previousVersionsTopHistoriesNames over |
currentVersions := OrderedCollection new.
currentVersions addLast: (self allVersionNames at: 1).
yesterdayWeatherHits := 0.
(2 to: self allVersionNames size) do: [: i |
self smelly: 'this algorithm is too big and complex'.
previousClassHistoriesSortedByWENM := (self classHistories
selectFromReferenceVersionCollection: currentVersions)
sortBy: [:a :b | a value getWENM >= b value getWENM].
currentVersions addLast: (self allVersionNames at: i).
previousVersionsTopHistories := OrderedCollection new.
x := previousClassHistoriesSortedByWENM first value getWENM.
valuesCount := 0.
previousClassHistoriesSortedByWENM do: [ :each |
(each value getWENM ~= x) ifTrue: [
valuesCount := valuesCount + 1. x:= each value getWENM].
(valuesCount < topPreviousWENM) ifTrue: [
previousVersionsTopHistories addLast: each]
].
last2VersionsTopHistories := OrderedCollection new.
last2Versions := OrderedCollection new.
last2Versions addLast: (self allVersionNames at: (i-1)).
last2Versions addLast: (self allVersionNames at: i).
123. valuesCount := valuesCount + 1. x:= each value getWENM].
(valuesCount < topPreviousWENM) ifTrue: [
previousVersionsTopHistories addLast: each]
].
last2VersionsTopHistories := OrderedCollection new.
last2Versions := OrderedCollection new.
last2Versions addLast: (self allVersionNames at: (i-1)).
last2Versions addLast: (self allVersionNames at: i).
last2HistoriesSortedByENM := (self classHistories
selectFromReferenceVersionCollection: last2Versions)
sortBy: [:a :b | a value getWENM >= b value getWENM].
x := last2HistoriesSortedByENM first value getENM.
valuesCount := 0.
last2HistoriesSortedByENM do: [ :each |
(each value getENM ~= x) ifTrue: [
valuesCount := valuesCount + 1. x:= each value getENM].
(valuesCount < topCurrentENM) ifTrue: [
last2VersionsTopHistories addLast: each]
].
previousVersionsTopHistoriesNames := previousVersionsTopHistories
collect: [ :each | each value name].
over := false.
last2VersionsTopHistories do: [:each |
((previousVersionsTopHistoriesNames includes: (each value name))
and: [over not]) ifTrue: [
yesterdayWeatherHits := yesterdayWeatherHits + 1. over := true].
].
].
^yesterdayWeatherHits/(self size - 1) asFloat.
124. yesterdayWeatherProbabilityWithTopPreviousWENM: topPreviousWENM
andTopCurrentENM: topCurrentENM
| currentVersions previousClassHistoriesSortedByWENM
yesterdayWeatherHits last2VersionsTopHistories last2Versions
last2HistoriesSortedByENM x valuesCount previousVersionsTopHistories
previousVersionsTopHistoriesNames over |
currentVersions := OrderedCollection new.
currentVersions addLast: (self allVersionNames at: 1).
yesterdayWeatherHits := 0.
(2 to: self allVersionNames size) do: [: i |
self smelly: 'this algorithm is too big and complex'.
previousClassHistoriesSortedByWENM := (self classHistories
selectFromReferenceVersionCollection: currentVersions)
sortBy: [:a :b | a value getWENM >= b value getWENM].
currentVersions addLast: (self allVersionNames at: i).
previousVersionsTopHistories := OrderedCollection new.
x := previousClassHistoriesSortedByWENM first value getWENM.
valuesCount := 0.
previousClassHistoriesSortedByWENM do: [ :each |
(each value getWENM ~= x) ifTrue: [
valuesCount := valuesCount + 1. x:= each value getWENM].
(valuesCount < topPreviousWENM) ifTrue: [
previousVersionsTopHistories addLast: each]
].
last2VersionsTopHistories := OrderedCollection new.
last2Versions := OrderedCollection new.
last2Versions addLast: (self allVersionNames at: (i-1)).
last2Versions addLast: (self allVersionNames at: i).
125. yesterdayWeatherProbabilityWithTopPreviousWENM: topPreviousWENM
andTopCurrentENM: topCurrentENM
| currentVersions previousClassHistoriesSortedByWENM
yesterdayWeatherHits last2VersionsTopHistories last2Versions
last2HistoriesSortedByENM x valuesCount previousVersionsTopHistories
previousVersionsTopHistoriesNames over |
currentVersions := OrderedCollection new.
currentVersions addLast: (self allVersionNames at: 1).
yesterdayWeatherHits := 0.
(2 to: self allVersionNames size) do: [: i |
self smelly: 'this algorithm is too big and complex'.
previousClassHistoriesSortedByWENM := (self classHistories
selectFromReferenceVersionCollection: currentVersions)
sortBy: [:a :b | a value getWENM >= b value getWENM].
currentVersions addLast: (self allVersionNames at: i).
previousVersionsTopHistories := OrderedCollection new.
x := previousClassHistoriesSortedByWENM first value getWENM.
valuesCount := 0.
previousClassHistoriesSortedByWENM do: [ :each |
(each value getWENM ~= x) ifTrue: [
valuesCount := valuesCount + 1. x:= each value getWENM].
(valuesCount < topPreviousWENM) ifTrue: [
previousVersionsTopHistories addLast: each]
].
last2VersionsTopHistories := OrderedCollection new.
last2Versions := OrderedCollection new.
last2Versions addLast: (self allVersionNames at: (i-1)).
last2Versions addLast: (self allVersionNames at: i).
138. ets is not empty, that is at least one class history belongs
o both sets. This means that for the classes in version i at
east one of the recently most changed classes is among the
most changed classes in the near future relative to version i.
past
f the assumption holds for version i we have a hit.
We formally define the Yesterday’s Weather hit function
pplied on version i of a system history S and given the two
hreshold values t1 and t2 as follows:
(i > 1; t1 , t2
1)
Y Wi (S, t1 , t2 ) =
8
> 1,
>
<
> 0,
>
:
T opLEN OM1..i (S, t1)
T opEEN OMi..n (S, t2) 6= ;
T opLEN OM1..i (S, t1)
T opEEN OMi..n (S, t2) = ;
Versions
future
YW
Figure 5. The compu
Weather.
Example. In Figure 4 we
Yesterday’s Weather with re
6 versions of a system with
Yesterday’s Weather when c
present one. Therefore, the
versions, and the 5th and 6th
We also consider the di
really-changed set to be 3, t
(6)
Yesterday’s Weather is computed by counting the hits for
ll versions and dividing them by the total number of posible hits. Thus, we obtain the result as a percentage with
alues between 0% and 100%.
4
139. hit
hit
hit
YW = 3 / 8 = 37%
Wehit
formally define the Yesterday’s Weather applied on
hit
hit
hit
hit
hit
hit
n versions of a system history S given two threshold values
YW = 7 / 8 = 87%
t1 and t2 as in Equation 7.
(n > 2; t1 , t2
1)
Y W1..n (S, t1 , t2 ) =
Pn
1
i=2
Y Wi (S, t1 , t2 )
n 2
(7)
140. We formally define the Yesterday’s Weather hit function
applied on version i of a system history S and given the two
threshold values t1 and t2 as follows:
(i > 1; t1 , t2
1)
8
> 1,
>
<
T opLEN OM1..i (S, t1)
T opEEN OMi..n (S, t2) 6= ;
Y Wi (S, t1 , t2 ) =
(6)
0, T opLEN OM1..i (S, t1)
>
>
:
T opEEN OMi..n (S, t2) = ;
formally define the Yesterday’s Weather applied on
We
n versions of a system history S given two threshold values
Yesterday’s Weather is
t1 and t2 as in Equation 7. computed by counting the hits for
all versions and dividing them by the total number of possible hits.>Thus,t2 obtain the result as a percentage with
(n 2; t1 , we 1)
values between 0% and 100%.Pn 1 Y Wi (S, t1 , t2 )
Y W1..n (S, t1 , t2 ) =
i=2
n
2
(7)
4