icsm10b.ppt
TRANSCRIPT
![Page 1: ICSM10b.ppt](https://reader033.vdocuments.net/reader033/viewer/2022060118/558bcbb5d8b42af46f8b45dd/html5/thumbnails/1.jpg)
Playing with RefactoringIdentifying Extract Class Opportunities through Game TheoryGabriele Bavota*, Rocco Oliveto*, Andrea De Lucia*
Giuliano Antoniol✝, Yann-Gaël Guéhéneuc✝
* DMI, University of Salerno, Fisciano (SA), Italy✝ DGIGL, École Polytechnique de Montreál, Québec, Canada
![Page 2: ICSM10b.ppt](https://reader033.vdocuments.net/reader033/viewer/2022060118/558bcbb5d8b42af46f8b45dd/html5/thumbnails/2.jpg)
contents
ContextRefactoring Software Systems: Why and How
Game Theory BackgroundThe Prisoner’s Dilemma
Game Theory meets SEGame-based Extract Class Refactoring
![Page 3: ICSM10b.ppt](https://reader033.vdocuments.net/reader033/viewer/2022060118/558bcbb5d8b42af46f8b45dd/html5/thumbnails/3.jpg)
Game TheoryBackground
The Prisoner’s Dilemma
![Page 4: ICSM10b.ppt](https://reader033.vdocuments.net/reader033/viewer/2022060118/558bcbb5d8b42af46f8b45dd/html5/thumbnails/4.jpg)
Game Theory- is a branch of mathematics widely applied in
the social sciences
- capture behavior in strategic situations, in which an individual’s success in making choices depends on the choices of others
- a game consists of:
• a set of players (2 or more);• a set of moves available to those players;• payoffs for each combination of moves
![Page 5: ICSM10b.ppt](https://reader033.vdocuments.net/reader033/viewer/2022060118/558bcbb5d8b42af46f8b45dd/html5/thumbnails/5.jpg)
The Prisoner’s Dilemma
TomTom
confess not confess
Sallyconfess (5, 5) (0, 7)
Sallynot confess (7, 0) (4, 4)
![Page 6: ICSM10b.ppt](https://reader033.vdocuments.net/reader033/viewer/2022060118/558bcbb5d8b42af46f8b45dd/html5/thumbnails/6.jpg)
The Prisoner’s Dilemma
TomTom
confess not confess
Sallyconfess (5, 5) (0, 7)
Sallynot confess (7, 0) (4, 4)
NASHEQUILIBRIUM
![Page 7: ICSM10b.ppt](https://reader033.vdocuments.net/reader033/viewer/2022060118/558bcbb5d8b42af46f8b45dd/html5/thumbnails/7.jpg)
Game Theory: Summarizing
- Natural application in strategic situations
- How to find a compromise between contrasting goals (Nash Equilibrium)
- In software engineering:
• optimal solution to many problems involves finding a compromise between contrasting goals, e.g., create classes with high cohesion and low coupling
![Page 8: ICSM10b.ppt](https://reader033.vdocuments.net/reader033/viewer/2022060118/558bcbb5d8b42af46f8b45dd/html5/thumbnails/8.jpg)
Context
Refactoring Software Systems: Why and How
![Page 9: ICSM10b.ppt](https://reader033.vdocuments.net/reader033/viewer/2022060118/558bcbb5d8b42af46f8b45dd/html5/thumbnails/9.jpg)
Refactoring ... Why?- Changing software without modifying its
external behaviour
- Improve non-functional attributes of the software?
- Software evolution ... continuous changes
- Changes cause a drift of the original design, reducing its quality, e.g., Class Cohesion
![Page 10: ICSM10b.ppt](https://reader033.vdocuments.net/reader033/viewer/2022060118/558bcbb5d8b42af46f8b45dd/html5/thumbnails/10.jpg)
Focusing on Class Cohesion- How strongly related and focused the
various responsibilites of a class are
- High cohesion is desiderable ... easier maintenance
classclassclass
classclassclass
class
- Programmers often add wrong responsibilities to a class
- The class becomes too complex and its cohesion decreases
![Page 11: ICSM10b.ppt](https://reader033.vdocuments.net/reader033/viewer/2022060118/558bcbb5d8b42af46f8b45dd/html5/thumbnails/11.jpg)
Focusing on Class Cohesion- How strongly related and focused the
various responsibilites of a class are
- High cohesion is desiderable ... easier maintenance
classclass
class Extract Class Refactoring
Splitting a class with many responsibilities into different classes
![Page 12: ICSM10b.ppt](https://reader033.vdocuments.net/reader033/viewer/2022060118/558bcbb5d8b42af46f8b45dd/html5/thumbnails/12.jpg)
Game Theorymeets SE
Game-based Extract Class Refactoring
![Page 13: ICSM10b.ppt](https://reader033.vdocuments.net/reader033/viewer/2022060118/558bcbb5d8b42af46f8b45dd/html5/thumbnails/13.jpg)
Playing with RefactoringModelling a
non-cooperative game
..choosing the better strategy
T
S
m2 m3 m4 N
m2
m3
m4
N
m1
m5
(-1.00, -1.00)
(-1.00, -1.00)
(0.49, 0.22) (0.70, 0.80) (0.70, 0.50)
(-0.49, -0.24) (0.21, 0.58) (0.21, 0.28)
(-0.21, -0.58)(-0.70, -0.80) (-1.00, -1.00) (0.00, -0.30)
(0.29, 0.22)(-0.20, 0.00) (0.50, 0.80) (-1.00, -1.00)
![Page 14: ICSM10b.ppt](https://reader033.vdocuments.net/reader033/viewer/2022060118/558bcbb5d8b42af46f8b45dd/html5/thumbnails/14.jpg)
Playing with RefactoringModelling a
non-cooperative game
..choosing the better strategy
T
S
m2 m3 m4 N
m2
m3
m4
N
m1
m5
(-1.00, -1.00)
(-1.00, -1.00)
(0.49, 0.22) (0.70, 0.80) (0.70, 0.50)
(-0.49, -0.24) (0.21, 0.58) (0.21, 0.28)
(-0.21, -0.58)(-0.70, -0.80) (-1.00, -1.00) (0.00, -0.30)
(0.29, 0.22)(-0.20, 0.00) (0.50, 0.80) (-1.00, -1.00)
(-1, -1) if i = j
![Page 15: ICSM10b.ppt](https://reader033.vdocuments.net/reader033/viewer/2022060118/558bcbb5d8b42af46f8b45dd/html5/thumbnails/15.jpg)
Playing with RefactoringModelling a
non-cooperative game
..choosing the better strategy
T
S
m2 m3 m4 N
m2
m3
m4
N
m1
m5
(-1.00, -1.00)
(-1.00, -1.00)
(0.49, 0.22) (0.70, 0.80) (0.70, 0.50)
(-0.49, -0.24) (0.21, 0.58) (0.21, 0.28)
(-0.21, -0.58)(-0.70, -0.80) (-1.00, -1.00) (0.00, -0.30)
(0.29, 0.22)(-0.20, 0.00) (0.50, 0.80) (-1.00, -1.00)
0.70 = sim(m1, m2) - sim(m1, m4)
![Page 16: ICSM10b.ppt](https://reader033.vdocuments.net/reader033/viewer/2022060118/558bcbb5d8b42af46f8b45dd/html5/thumbnails/16.jpg)
Playing with RefactoringModelling a
non-cooperative game
..choosing the better strategy
T
S
m2 m3 m4 N
m2
m3
m4
N
m1
m5
(-1.00, -1.00)
(-1.00, -1.00)
(0.49, 0.22) (0.70, 0.80) (0.70, 0.50)
(-0.49, -0.24) (0.21, 0.58) (0.21, 0.28)
(-0.21, -0.58)(-0.70, -0.80) (-1.00, -1.00) (0.00, -0.30)
(0.29, 0.22)(-0.20, 0.00) (0.50, 0.80) (-1.00, -1.00)
0.70 = sim(m1, m2) - sim(m1, m4)
COHESION COUPLING
![Page 17: ICSM10b.ppt](https://reader033.vdocuments.net/reader033/viewer/2022060118/558bcbb5d8b42af46f8b45dd/html5/thumbnails/17.jpg)
Playing with RefactoringModelling a
non-cooperative game
..choosing the better strategy
T
S
m2 m3 m4 N
m2
m3
m4
N
m1
m5
(-1.00, -1.00)
(-1.00, -1.00)
(0.49, 0.22) (0.70, 0.80) (0.70, 0.50)
(-0.49, -0.24) (0.21, 0.58) (0.21, 0.28)
(-0.21, -0.58)(-0.70, -0.80) (-1.00, -1.00) (0.00, -0.30)
(0.29, 0.22)(-0.20, 0.00) (0.50, 0.80) (-1.00, -1.00)
![Page 18: ICSM10b.ppt](https://reader033.vdocuments.net/reader033/viewer/2022060118/558bcbb5d8b42af46f8b45dd/html5/thumbnails/18.jpg)
Playing with RefactoringModelling a
non-cooperative game
..choosing the better strategy
T
S
m2 m3 m4 N
m2
m3
m4
N
m1
m5
(-1.00, -1.00)
(-1.00, -1.00)
(0.49, 0.22) (0.70, 0.80) (0.70, 0.50)
(-0.49, -0.24) (0.21, 0.58) (0.21, 0.28)
(-0.21, -0.58)(-0.70, -0.80) (-1.00, -1.00) (0.00, -0.30)
(0.29, 0.22)(-0.20, 0.00) (0.50, 0.80) (-1.00, -1.00)
NASHEQUILIBRIUM
![Page 19: ICSM10b.ppt](https://reader033.vdocuments.net/reader033/viewer/2022060118/558bcbb5d8b42af46f8b45dd/html5/thumbnails/19.jpg)
Playing with RefactoringModelling a
non-cooperative game
..choosing the better strategy
T
S
m2 m3 m4 N
m2
m3
m4
N
m1
m5
(-1.00, -1.00)
(-1.00, -1.00)
(0.49, 0.22) (0.70, 0.80) (0.70, 0.50)
(-0.49, -0.24) (0.21, 0.58) (0.21, 0.28)
(-0.21, -0.58)(-0.70, -0.80) (-1.00, -1.00) (0.00, -0.30)
(0.29, 0.22)(-0.20, 0.00) (0.50, 0.80) (-1.00, -1.00)
NASHEQUILIBRIUM
![Page 20: ICSM10b.ppt](https://reader033.vdocuments.net/reader033/viewer/2022060118/558bcbb5d8b42af46f8b45dd/html5/thumbnails/20.jpg)
Playing with RefactoringModelling a
non-cooperative game
..choosing the better strategy
T
S
m2 m3
m4
N
m2
m3
m4
N
m1
m5
(-1.00, -1.00)
(-1.00, -1.00)
(0.49, 0.22) (0.70, 0.80) (0.70, 0.50)
(-0.49, -0.24) (0.21, 0.58) (0.21, 0.28)
(-0.21, -0.58)(-0.70, -0.80) (-1.00, -1.00) (0.00, -0.30)
(0.29, 0.22)(-0.20, 0.00) (0.50, 0.80) (-1.00, -1.00)
NASHEQUILIBRIUM
![Page 21: ICSM10b.ppt](https://reader033.vdocuments.net/reader033/viewer/2022060118/558bcbb5d8b42af46f8b45dd/html5/thumbnails/21.jpg)
Playing with RefactoringModelling a
non-cooperative game
..choosing the better strategy
T
S
m2 m3
m4
N
m2
m3
m4
N
m1
m5
(-1.00, -1.00)
(-1.00, -1.00)
(0.49, 0.22) (0.70, 0.80) (0.70, 0.50)
(-0.49, -0.24) (0.21, 0.58) (0.21, 0.28)
(-0.21, -0.58)(-0.70, -0.80) (-1.00, -1.00) (0.00, -0.30)
(0.29, 0.22)(-0.20, 0.00) (0.50, 0.80) (-1.00, -1.00)
NASHEQUILIBRIUM
![Page 22: ICSM10b.ppt](https://reader033.vdocuments.net/reader033/viewer/2022060118/558bcbb5d8b42af46f8b45dd/html5/thumbnails/22.jpg)
Playing with RefactoringModelling a
non-cooperative game
..choosing the better strategy
T
S m3 N
m3
N
m1
m5
(-1.00, -1.00) (0.21, 0.28)
(0.29, 0.22) (-1.00, -1.00)
m4
m2
![Page 23: ICSM10b.ppt](https://reader033.vdocuments.net/reader033/viewer/2022060118/558bcbb5d8b42af46f8b45dd/html5/thumbnails/23.jpg)
Playing with RefactoringModelling a
non-cooperative game
..choosing the better strategy
T
S m3 N
m3
N
m1
m5
(-1.00, -1.00) (0.21, 0.28)
(0.29, 0.22) (-1.00, -1.00)
m4
m2 NASHEQUILIBRIUM
![Page 24: ICSM10b.ppt](https://reader033.vdocuments.net/reader033/viewer/2022060118/558bcbb5d8b42af46f8b45dd/html5/thumbnails/24.jpg)
Playing with RefactoringModelling a
non-cooperative game
..choosing the better strategy
T
S
m3
N
m3
N
m1
m5
(-1.00, -1.00) (0.21, 0.28)
(0.29, 0.22) (-1.00, -1.00)
m4
m2 NASHEQUILIBRIUM
![Page 25: ICSM10b.ppt](https://reader033.vdocuments.net/reader033/viewer/2022060118/558bcbb5d8b42af46f8b45dd/html5/thumbnails/25.jpg)
Playing with RefactoringModelling a
non-cooperative game
..choosing the better strategy
T
S N
m3
N
m1
m5
(-1.00, -1.00) (0.21, 0.28)
(0.29, 0.22) (-1.00, -1.00)
m4
m2 NASHEQUILIBRIUM
m3
![Page 26: ICSM10b.ppt](https://reader033.vdocuments.net/reader033/viewer/2022060118/558bcbb5d8b42af46f8b45dd/html5/thumbnails/26.jpg)
PreliminaryEvaluation
Game-based Extract Class Refactoring
![Page 27: ICSM10b.ppt](https://reader033.vdocuments.net/reader033/viewer/2022060118/558bcbb5d8b42af46f8b45dd/html5/thumbnails/27.jpg)
Case Study Design
Goal Systems Metrics
RQ1 Comparison with Pareto Optimum ArgoUML, JHotDraw F-measure
RQ2Comparison with others Extract Class Refactoring approaches ArgoUML, JHotDraw F-measure
![Page 28: ICSM10b.ppt](https://reader033.vdocuments.net/reader033/viewer/2022060118/558bcbb5d8b42af46f8b45dd/html5/thumbnails/28.jpg)
Experiment Execution
method1...methodn
attr1...attrm
Original Class C1
method1...methods
attr1...attrm
Original Class C1
method1...methodn
attr1...attrm
Original Class Ci
method1...methodn
attr1...attrm
Original Class C1
method1...methody
attr1...attrm
Original Class C1
method1...methodn+s
attr1...attrm+k
Mutated Class Ci + Cj
method1...methodn
attr1...attrm
Original Class C1
method1...methods
attr1...attrm
Original Class C1
method1...methodk
attr1...attrh
Refactored Class C'i
Input
original system
System mutation
Comparision of orginal
and mutated system
mutated system
refactored system
System refactoring
results
88%
F-MEASURE
![Page 29: ICSM10b.ppt](https://reader033.vdocuments.net/reader033/viewer/2022060118/558bcbb5d8b42af46f8b45dd/html5/thumbnails/29.jpg)
Results
System Game Theory
Pareto Optimum
MaxFlowMinCut
ArgoUML 90% 88% 77%
JHotDraw 85% 82% 76%
![Page 30: ICSM10b.ppt](https://reader033.vdocuments.net/reader033/viewer/2022060118/558bcbb5d8b42af46f8b45dd/html5/thumbnails/30.jpg)
Conclusion andFuture Work
![Page 31: ICSM10b.ppt](https://reader033.vdocuments.net/reader033/viewer/2022060118/558bcbb5d8b42af46f8b45dd/html5/thumbnails/31.jpg)
Conclusion...
The first recommendation system that exploits game theory techniques
![Page 32: ICSM10b.ppt](https://reader033.vdocuments.net/reader033/viewer/2022060118/558bcbb5d8b42af46f8b45dd/html5/thumbnails/32.jpg)
Conclusion...
Preliminary evaluation of the proposed approach
![Page 33: ICSM10b.ppt](https://reader033.vdocuments.net/reader033/viewer/2022060118/558bcbb5d8b42af46f8b45dd/html5/thumbnails/33.jpg)
...and Future Work
investigate about other kind of games, e.g., cooperative game
direct comparison with clustering and search-based approach
apply Game Theory to Software Re-modularization
![Page 34: ICSM10b.ppt](https://reader033.vdocuments.net/reader033/viewer/2022060118/558bcbb5d8b42af46f8b45dd/html5/thumbnails/34.jpg)
Thank you!
Questions and/or comments
Gabriele BavotaPhD StudentDMI - University of [email protected]