ICSM10b.ppt

93 views
73 views

Published on

Published in: Technology, Economy & Finance
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
93
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
1
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

ICSM10b.ppt

  1. 1. Playing with RefactoringIdentifying Extract ClassOpportunities 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
  2. 2. Game Theory BackgroundThe Prisoner’s DilemmaContextRefactoring Software Systems:Why and HowGame Theory meets SEGame-based Extract Class Refactoring contents
  3. 3. Game TheoryBackground The Prisoner’s Dilemma
  4. 4. 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
  5. 5. The Prisoner’s Dilemma Tom confess not confess confess (5, 5) (0, 7) Sally not confess (7, 0) (4, 4)
  6. 6. The Prisoner’s Dilemma Tom confess not confess EQU NASH confess (5, 5) ILIB RIU (0, 7) M Sally not confess (7, 0) (4, 4)
  7. 7. 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
  8. 8. ContextRefactoring Software Systems: Why and How
  9. 9. 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
  10. 10. Focusing on Class Cohesion - How strongly related and focused the various responsibilites of a class are - High cohesion is desiderable ... easier maintenance class class class - Programmers often add wrong class responsibilities to a class classclass - The class becomes too complex and itsclass cohesion decreases
  11. 11. Focusing on Class Cohesion - How strongly related and focused the various responsibilites of a class are - High cohesion is desiderable ... easier maintenanceclass Extract Class Refactoring Splitting a class with many responsibilitiesclass class into different classes
  12. 12. Game Theorymeets SEGame-based Extract Class Refactoring
  13. 13. no M n-c odePlaying with Refactoring oo l per ling ati a ve ga me ..choosing the better strategy T m5 m2 m3 m4 N S m2 (-1.00, -1.00) (0.49, 0.22) (0.70, 0.80) (0.70, 0.50) m3 (-0.49, -0.24) (-1.00, -1.00) (0.21, 0.58) (0.21, 0.28) m1 m4 (-0.70, -0.80) (-0.21, -0.58) (-1.00, -1.00) (0.00, -0.30) N (-0.20, 0.00) (0.29, 0.22) (0.50, 0.80) (-1.00, -1.00)
  14. 14. no M n-c odePlaying with Refactoring oo l per ling ati a ve ga me ..choosing the better strategy(-1, -1) if i = j T m5 m2 m3 m4 N S m2 (-1.00, -1.00) (0.49, 0.22) (0.70, 0.80) (0.70, 0.50) m3 (-0.49, -0.24) (-1.00, -1.00) (0.21, 0.58) (0.21, 0.28) m1 m4 (-0.70, -0.80) (-0.21, -0.58) (-1.00, -1.00) (0.00, -0.30) N (-0.20, 0.00) (0.29, 0.22) (0.50, 0.80) (-1.00, -1.00)
  15. 15. no M n-c odePlaying with Refactoring oo l per ling ati a ve ga me ..choosing the better strategy T m5 0.70 = sim(m1, m2) - sim(m1, m4) m2 m3 m4 N S m2 (-1.00, -1.00) (0.49, 0.22) (0.70, 0.80) (0.70, 0.50) m3 (-0.49, -0.24) (-1.00, -1.00) (0.21, 0.58) (0.21, 0.28) m1 m4 (-0.70, -0.80) (-0.21, -0.58) (-1.00, -1.00) (0.00, -0.30) N (-0.20, 0.00) (0.29, 0.22) (0.50, 0.80) (-1.00, -1.00)
  16. 16. no M n-c odePlaying with Refactoring oo l per ling ati a ve ga me ..choosing the better strategy COHESION COUPLING T m5 0.70 = sim(m1, m2) - sim(m1, m4) m2 m3 m4 N S m2 (-1.00, -1.00) (0.49, 0.22) (0.70, 0.80) (0.70, 0.50) m3 (-0.49, -0.24) (-1.00, -1.00) (0.21, 0.58) (0.21, 0.28) m1 m4 (-0.70, -0.80) (-0.21, -0.58) (-1.00, -1.00) (0.00, -0.30) N (-0.20, 0.00) (0.29, 0.22) (0.50, 0.80) (-1.00, -1.00)
  17. 17. no M n-c odePlaying with Refactoring oo l per ling ati a ve ga me ..choosing the better strategy T m5 m2 m3 m4 N S m2 (-1.00, -1.00) (0.49, 0.22) (0.70, 0.80) (0.70, 0.50) m3 (-0.49, -0.24) (-1.00, -1.00) (0.21, 0.58) (0.21, 0.28) m1 m4 (-0.70, -0.80) (-0.21, -0.58) (-1.00, -1.00) (0.00, -0.30) N (-0.20, 0.00) (0.29, 0.22) (0.50, 0.80) (-1.00, -1.00)
  18. 18. no M n-c odePlaying with Refactoring oo l per ling ati a ve ga me ..choosing the better strategy T m5 m2 m3 m4 N EQU NASH S m2 (-1.00, -1.00) (0.49, 0.22) (0.70,B ILI 0.80) (0.70, 0.50) RIU M m3 (-0.49, -0.24) (-1.00, -1.00) (0.21, 0.58) (0.21, 0.28) m1 m4 (-0.70, -0.80) (-0.21, -0.58) (-1.00, -1.00) (0.00, -0.30) N (-0.20, 0.00) (0.29, 0.22) (0.50, 0.80) (-1.00, -1.00)
  19. 19. no M n-c odePlaying with Refactoring oo l per ling ati a ve ga me ..choosing the better strategy T m5 m2 m3 m4 N EQU NASH S (-1.00, -1.00) (0.49, 0.22) (0.70,B ILI 0.80) (0.70, 0.50) RIU M m3 (-0.49, -0.24) (-1.00, -1.00) (0.21, 0.58) (0.21, 0.28) m1 m4 (-0.70, -0.80) (-0.21, -0.58) (-1.00, -1.00) (0.00, -0.30) m2 N (-0.20, 0.00) (0.29, 0.22) (0.50, 0.80) (-1.00, -1.00)
  20. 20. no M n-c odePlaying with Refactoring oo l per ling ati a ve ga me ..choosing the better strategy T m5 m4 m2 m3 N EQU NASH S (-1.00, -1.00) (0.49, 0.22) (0.70,B ILI 0.80) (0.70, 0.50) RIU M m3 (-0.49, -0.24) (-1.00, -1.00) (0.21, 0.58) (0.21, 0.28) m1 m4 (-0.70, -0.80) (-0.21, -0.58) (-1.00, -1.00) (0.00, -0.30) m2 N (-0.20, 0.00) (0.29, 0.22) (0.50, 0.80) (-1.00, -1.00)
  21. 21. no M n-c odePlaying with Refactoring oo l per ling ati a ve ga me ..choosing the better strategy T m5 m4 m2 m3 N EQU NASH S (-1.00, -1.00) (0.49, 0.22) (0.70,B ILI 0.80) (0.70, 0.50) RIU M m3 (-0.49, -0.24) (-1.00, -1.00) (0.21, 0.58) (0.21, 0.28) m1 m4 (-0.70, -0.80) (-0.21, -0.58) (-1.00, -1.00) (0.00, -0.30) m2 N (-0.20, 0.00) (0.29, 0.22) (0.50, 0.80) (-1.00, -1.00)
  22. 22. no M n-c odePlaying with Refactoring oo l per ling ati a ve ga me ..choosing the better strategy T m5 m4 S m3 N m3 (-1.00, -1.00) (0.21, 0.28) m1 m2 N (0.29, 0.22) (-1.00, -1.00)
  23. 23. no M n-c odePlaying with Refactoring oo l per ling ati a ve ga me ..choosing the better strategy T m5 m4 S m3 N m3 (-1.00, -1.00) (0.21, 0.28) m1 m2 EQU NASH N (0.29,B0.22) ILI (-1.00, -1.00) RIU M
  24. 24. no M n-c odePlaying with Refactoring oo l per ling ati a ve ga me ..choosing the better strategy T m5 m4 m3 S N m3 (-1.00, -1.00) (0.21, 0.28) m1 m2 EQU NASH N (0.29,B0.22) ILI (-1.00, -1.00) RIU M
  25. 25. no M n-c odePlaying with Refactoring oo l per ling ati a ve ga me ..choosing the better strategy T m5 m4 m3 S N m3 (-1.00, -1.00) (0.21, 0.28) m1 m2 EQU NASH N (0.29,B0.22) ILI (-1.00, -1.00) RIU M
  26. 26. PreliminaryEvaluation Game-based Extract Class Refactoring
  27. 27. Case Study Design Goal Systems Metrics RQ1 Comparison with Pareto Optimum ArgoUML, JHotDraw F-measure Comparison with others Extract RQ2 Class Refactoring approaches ArgoUML, JHotDraw F-measure
  28. 28. Experiment Execution original system mutated system Original Class Mutated Class Original Original Original Original Ci Ci + Cj Class C1 Class C1 attr1 Class C1 attr1 Class C1 Input attr1 ...attr1 System mutation attr1 ...attr1 ... ... ... ... attrm attrm+k attrm attrm attrm attrm method1 method1 method11 method11 ...method ...method ... ... ... ... methodn methodn+s methodsn method methodyn method System refactoring results Refactored Original Original Class Ci F-MEASURE Class C1 attr1 Class C1 attr1 Comparision of orginal ...attr1 ... ... 88% attrh attrm and mutated system attrm method1 method11 ...method ... ... methodk methodsn method refactored system
  29. 29. Results Game Pareto MaxFlow System Theory Optimum MinCut ArgoUML 90% 88% 77% JHotDraw 85% 82% 76%
  30. 30. Conclusion andFuture Work
  31. 31. Conclusion... The first recommendation system that exploits game theory techniques
  32. 32. Conclusion... Preliminary evaluation of the proposed approach
  33. 33. ...and Future Work direct comparison with clustering and search-based approach investigate about other kind of games, e.g., cooperative game apply Game Theory to Software Re-modularization
  34. 34. Thank you! Questions and/or commentsGabriele BavotaPhD StudentDMI - University of Salernogbavota@unisa.it

×