![Page 1: Chaos Theory for Software Evolution Rui Gustavo Crespo Technical University of Lisbon](https://reader031.vdocuments.site/reader031/viewer/2022032414/56649efa5503460f94c0c806/html5/thumbnails/1.jpg)
Chaos Theory for
Software Evolution
Rui Gustavo CrespoTechnical University of Lisbon
![Page 2: Chaos Theory for Software Evolution Rui Gustavo Crespo Technical University of Lisbon](https://reader031.vdocuments.site/reader031/viewer/2022032414/56649efa5503460f94c0c806/html5/thumbnails/2.jpg)
2/22Software Evolution Behaviours
Laws of Software Evolution (1)
MM Lehman informal laws of software evolution1
Continuing change: a program used in a real-world environment must change.
Increasing entropy: the program structure becomes more complex, unless efforts are made to avoid the complexity.
Statistically smooth growth: the global system metrics appear locally stochastic in time and space but are self-regulating and statistically smooth.
1Lehman, M.M.: Programs, Life Cycles and Laws of Software Evolution. IEEE Special Issue on Software Engineering, 68(9), 1060-1076
![Page 3: Chaos Theory for Software Evolution Rui Gustavo Crespo Technical University of Lisbon](https://reader031.vdocuments.site/reader031/viewer/2022032414/56649efa5503460f94c0c806/html5/thumbnails/3.jpg)
3/22Software Evolution Behaviours
Laws of Software Evolution (2)
Valid laws must be:-1. Unambiguous: the underlying system model must be
clear (better formally).2. Falsifiable: model predictions are checked against
collected data and the law remains valid until tests fail.
Thesis: Program organization plays a role in maintenance,
and may be measured with LRC (“Long-range correlation”) metrics.
Program evolution follows Verhulst population model.
![Page 4: Chaos Theory for Software Evolution Rui Gustavo Crespo Technical University of Lisbon](https://reader031.vdocuments.site/reader031/viewer/2022032414/56649efa5503460f94c0c806/html5/thumbnails/4.jpg)
4/22Software Evolution Behaviours
F2(l) = [BW(l,l0)]2 - [BW(l,l0)]2
BW(l,l0) = BW(l0+l)-BW(l0)
LRC metrics (1)
1. Encode symbols (data types int, struct,... and instruction keywords if, while,...) with a balanced numeric code.
2. Identify the Brownian walk graph BW
BW(0) = 0
BW(n) = BW(n-1) + Code(Sn)
3. Evaluate the root of mean square flutuation about the average of displacement.
![Page 5: Chaos Theory for Software Evolution Rui Gustavo Crespo Technical University of Lisbon](https://reader031.vdocuments.site/reader031/viewer/2022032414/56649efa5503460f94c0c806/html5/thumbnails/5.jpg)
5/22Software Evolution Behaviours
LRC metrics (2)
10 0
10 1
10 2
10 3
10 4
10 0
10 1
10 2
10 3
F(l) l
= 0.5, random programs
0.5<<1, meaningful programs
![Page 6: Chaos Theory for Software Evolution Rui Gustavo Crespo Technical University of Lisbon](https://reader031.vdocuments.site/reader031/viewer/2022032414/56649efa5503460f94c0c806/html5/thumbnails/6.jpg)
6/22Software Evolution Behaviours
0
0.2
0.4
0.6
0.8
1
0 5 10 15 20 25 30 35 40
Number
Alp
ha
LRC metrics (3)
[A] values for 36 compilers, coded in C
Average: 0,82
![Page 7: Chaos Theory for Software Evolution Rui Gustavo Crespo Technical University of Lisbon](https://reader031.vdocuments.site/reader031/viewer/2022032414/56649efa5503460f94c0c806/html5/thumbnails/7.jpg)
7/22Software Evolution Behaviours
LRC metrics (4)
for 36 random programs, same keyword distribution (similar results for same number of lines)
0
0.2
0.4
0.6
0 5 10 15 20 25 30 35 40
Number
Alp
ha
Average: 0,48
![Page 8: Chaos Theory for Software Evolution Rui Gustavo Crespo Technical University of Lisbon](https://reader031.vdocuments.site/reader031/viewer/2022032414/56649efa5503460f94c0c806/html5/thumbnails/8.jpg)
8/22Software Evolution Behaviours
0
0.2
0.4
0.6
0.8
1
0 5 10 15 20 25 30 35 40
Number
Alp
ha
LRC metrics (5)
values for 36 random C programs, same number of lines, same keyword distribution
Average: 0,62
![Page 9: Chaos Theory for Software Evolution Rui Gustavo Crespo Technical University of Lisbon](https://reader031.vdocuments.site/reader031/viewer/2022032414/56649efa5503460f94c0c806/html5/thumbnails/9.jpg)
9/22Software Evolution Behaviours
LRC metrics (6)
values for source and object files are strongly correlated
y = 0.1802x + 0.5713
R2 = 0.8212
0.6800
0.6900
0.7000
0.7100
0.7200
0.7300
0.7400
0.0000 0.2000 0.4000 0.6000 0.8000 1.0000
Source program Alpha
Ob
ject
pro
gra
m A
lph
a
![Page 10: Chaos Theory for Software Evolution Rui Gustavo Crespo Technical University of Lisbon](https://reader031.vdocuments.site/reader031/viewer/2022032414/56649efa5503460f94c0c806/html5/thumbnails/10.jpg)
10/22Software Evolution Behaviours
Process dynamics (1)
Pierre Verhulst, Belgian mathematician, studied models of human population growth in the 19th century Growth with unlimited resources
du/dt=u, >0
Solution is an exponential function u(t)=u(t0)e(t-t0)
Growth with limited resourcesdu/dt=(-u)u, is the upper limit
Xt+1 = Xt(1-Xt) Xt \in [0,1], \in [0,4]
Verhulst model, or logistic map
![Page 11: Chaos Theory for Software Evolution Rui Gustavo Crespo Technical University of Lisbon](https://reader031.vdocuments.site/reader031/viewer/2022032414/56649efa5503460f94c0c806/html5/thumbnails/11.jpg)
11/22Software Evolution Behaviours
Process dynamics (2)
=1.1
0
0.2
0.4
0.6
0.8
1
1 4 7 10 13 16 19 22 25 28 31 34 37 40 43 46 49 52 55 58
![Page 12: Chaos Theory for Software Evolution Rui Gustavo Crespo Technical University of Lisbon](https://reader031.vdocuments.site/reader031/viewer/2022032414/56649efa5503460f94c0c806/html5/thumbnails/12.jpg)
12/22Software Evolution Behaviours
Process dynamics (3)
=2.9
0
0.2
0.4
0.6
0.8
1
1 4 7 10 13 16 19 22 25 28 31 34 37 40 43 46 49 52 55 58
![Page 13: Chaos Theory for Software Evolution Rui Gustavo Crespo Technical University of Lisbon](https://reader031.vdocuments.site/reader031/viewer/2022032414/56649efa5503460f94c0c806/html5/thumbnails/13.jpg)
13/22Software Evolution Behaviours
Process dynamics (4)
=3.4
0
0.2
0.4
0.6
0.8
1
1 4 7 10 13 16 19 22 25 28 31 34 37 40 43 46 49 52 55 58
Oscilation period is 2n
![Page 14: Chaos Theory for Software Evolution Rui Gustavo Crespo Technical University of Lisbon](https://reader031.vdocuments.site/reader031/viewer/2022032414/56649efa5503460f94c0c806/html5/thumbnails/14.jpg)
14/22Software Evolution Behaviours
Process dynamics (5)
BTW, predator and prey populations (e.g., wolves and rabbits), are ruled by the same kind of equations dr/dt=(- w)r
dw/dt=(r - )w
Solution of the differential equations are sinusoidal functions, with different phases
-1.5
-1
-0.5
0
0.5
1
1.5
1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31
Rabbit
Wolf
![Page 15: Chaos Theory for Software Evolution Rui Gustavo Crespo Technical University of Lisbon](https://reader031.vdocuments.site/reader031/viewer/2022032414/56649efa5503460f94c0c806/html5/thumbnails/15.jpg)
15/22Software Evolution Behaviours
Process dynamics (6)
=3.8
0
0.2
0.4
0.6
0.8
1
1 4 7 10 13 16 19 22 25 28 31 34 37 40 43 46 49 52 55 58
The behaviour is cahotic
![Page 16: Chaos Theory for Software Evolution Rui Gustavo Crespo Technical University of Lisbon](https://reader031.vdocuments.site/reader031/viewer/2022032414/56649efa5503460f94c0c806/html5/thumbnails/16.jpg)
16/22Software Evolution Behaviours
Process dynamics (7)
Software processes also “compete” for resources (time, man-power, …)
Interaction between components is non-linear: small changes in a module may stop other modules to work properly
Proposal: link Verhulst values toProgram organization, and Ideas formation
![Page 17: Chaos Theory for Software Evolution Rui Gustavo Crespo Technical University of Lisbon](https://reader031.vdocuments.site/reader031/viewer/2022032414/56649efa5503460f94c0c806/html5/thumbnails/17.jpg)
17/22Software Evolution Behaviours
Process dynamics (8)
norm = 2|-0.5|; = t+1/t(1-t)
Ideas formation Ideas covergence Single Idea Implementation
Time
Pro
duct
Att
ribu
tes
InformationCriativity
Pro
cess
For
m
Chaos Bifurcation Normal
3,4 03,0
![Page 18: Chaos Theory for Software Evolution Rui Gustavo Crespo Technical University of Lisbon](https://reader031.vdocuments.site/reader031/viewer/2022032414/56649efa5503460f94c0c806/html5/thumbnails/18.jpg)
18/22Software Evolution Behaviours
Process dynamics (9)
BeanMetaData.java versions in JBOSS (Jul 2000-Oct 2002)
Chaotic Normal
0
1
2
3
4
5
6
1.1
1.4
1.7
1.10
1.13
1.15
.2.1
1.18
1.21
1.23
.2.1
1.23
.2.4
1.26
1.29
1.32
1.35
1.38
1.39
.2.2
1.40
Version
Bifurcation
![Page 19: Chaos Theory for Software Evolution Rui Gustavo Crespo Technical University of Lisbon](https://reader031.vdocuments.site/reader031/viewer/2022032414/56649efa5503460f94c0c806/html5/thumbnails/19.jpg)
19/22Software Evolution Behaviours
Process dynamics (10)
0100200300400500600700800
1.1
1.4
1.7
1.10
1.13
1.15
.2.1
1.18
1.21
1.23
.2.1
1.23
.2.4
1.26
1.29
1.32
1.35
1.38
1.39
.2.2
1.40
Version
LO
C
![Page 20: Chaos Theory for Software Evolution Rui Gustavo Crespo Technical University of Lisbon](https://reader031.vdocuments.site/reader031/viewer/2022032414/56649efa5503460f94c0c806/html5/thumbnails/20.jpg)
20/22Software Evolution Behaviours
Process dynamics (11)
EJBVerifier20.java versions in JBOSS (May 2000-Sep 2002)
Chaotic
Normal
00.5
11.5
22.5
33.5
4
1.1
1.3
1.5
1.7
1.9
1.11
1.13
1.15
1.17
1.17
.2.2
1.18
1.20
1.22
1.24
1.25
1.27
Version
Bifurcation
![Page 21: Chaos Theory for Software Evolution Rui Gustavo Crespo Technical University of Lisbon](https://reader031.vdocuments.site/reader031/viewer/2022032414/56649efa5503460f94c0c806/html5/thumbnails/21.jpg)
21/22Software Evolution Behaviours
Process dynamics (12)
0
500
1000
1500
2000
2500
3000
1.1
1.3
1.5
1.7
1.9
1.11
1.13
1.15
1.17
1.17
.2.2
1.18
1.20
1.22
1.24
1.25
1.27
Version
LO
C
![Page 22: Chaos Theory for Software Evolution Rui Gustavo Crespo Technical University of Lisbon](https://reader031.vdocuments.site/reader031/viewer/2022032414/56649efa5503460f94c0c806/html5/thumbnails/22.jpg)
22/22Software Evolution Behaviours
It is possible to measure program organization and automatically highlight version behaviours
Next steps:Check LRC validity and Verhulst model in other
applications / languages / process phases Improve Verhulst model (sometimes, >4) Identify faster algorithms
Cardoso,AI; Kokol,P.; Lenic,M.; Crespo,R.G.; Complexity-based Evaluation of Systems Evolution; in Advances in UML/XML Based Software Evolution;IRM Press; 2004 (in print)
Conclusions