What history can tell us

795 views

Published on

I used this set of slides for a talk I gave at the Qualimetrie Club, Paris on June 2009.

Published in: Education, Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

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

No notes for slide

What history can tell us

  1. 1. what history can tell us Tudor Gîrba www.tudorgirba.com
  2. 2. 2002
  3. 3. PhD 2002 2005
  4. 4. PhD PostDoc 2002 2005 2009
  5. 5. PhD PostDoc 2002 2005 2009 Consultant eng.ch w ww.sw-
  6. 6. { { } } { { } } for wa rd en gin eer ing
  7. 7. ing eer gin en rd wa for { { { { { { { { } } } actual development } } } } } { }
  8. 8. ing eer rev gin ers en ee rd ng wa ine for eri ng { { { { { { { { } } } actual development } } } } } { }
  9. 9. e.uni be.ch m oos
  10. 10. 03 ucasse 20 Lanza, D
  11. 11. { { } } { { } } for wa rd en gin eer ing actual development er ing g ine e en ev ers r { { }} } { { { } }
  12. 12. { { } } { { } } for wa rd en gin eer ing reverse engineering actual development er ing g ine e en ev ers r { { }} } { { { } }
  13. 13. 001 Lehma n etal, 2
  14. 14. commit time Wu etal ,2 004
  15. 15. Evolution Matrix shows changes in classes Idle class Pulsar class Supernova class White dwarf class 2002 ucasse, Lanza, D
  16. 16. 2002 ucasse, Lanza, D
  17. 17. eta-model? h at is the m w
  18. 18. { { { { } } } } { } complex, large { { { {
  19. 19. { { { { { { { { { { { { { { { { { { { { { { { { } } } } } } } } } } } } } } } } } } } { } } { } } { } } { } } { } } { } { { { { { { { { { { { { { { { { { { { { { { { { } } } } } } } } } } } } } } } } } } } { } } { } } { } } { } } { } } { } { { { { { { { { { { { { { { { { { { { { { { { { } } } } } } } } } } } } } } } } } } } { } } { } } { } } { } } { } } { } { { { { { { { { { { { { { { { { { { { { { { { { } } } } } } } } } } } } } } } } } } } { } } { } } { } } { } } { } } { }
  20. 20. eta-model? h at is the m w
  21. 21. 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
  22. 22. Idle class Pulsar class Supernova class White dwarf attributes class methods Class
  23. 23. Idle class Pulsar class Supernova class White dwarf attributes class methods Class
  24. 24. Idle class history Pulsar class history Supernova class history White dwarf ClassHistory class history isPulsar isIdle
  25. 25. System Version Class Version
  26. 26. System Version Class Class History Version
  27. 27. System System History Version Class Class History Version
  28. 28. System System History Version Class Class History Version
  29. 29. History Version History Version
  30. 30. ry exp licitl0y5 dels h isto 0 Girba 2 H ismo mo History Version History Version
  31. 31. what changed? when, how? 2 4 3 5 7 2 2 3 4 9 2 2 1 2 3 2 2 2 2 2 1 5 3 4 4
  32. 32. Evolution of LENOM(C) = ∑ |NOMi(C)-NOMi-1(C)| 2i-n Number of Methods LENOM(C) = 4 + 2 + 1 + 0 = 7 1 5 3 4 4 4 Gîrba etal 200
  33. 33. Latest Evolution of LENOM(C) = ∑ |NOMi(C)-NOMi-1(C)| 2i-n Number of Methods Earliest Evolution of EENOM(C) = ∑ |NOMi(C)-NOMi-1(C)| 22-i Number of Methods LENOM(C) = 4 2-3 + 2 2-2 + 1 2-1 + 0 20 = 1.5 1 5 3 4 4 EENOM(C) = 4 20 + 2 2-1 + 1 2-2 + 0 2-3 = 5.25 4 Gîrba etal 200
  34. 34. ENOM LENOM EENOM 2 4 3 5 7 7 3.5 3.25 2 2 3 4 9 7 5.75 1.37 2 2 1 2 3 3 1 2 2 2 2 2 2 0 0 0 1 5 3 4 4 7 1.25 5.25
  35. 35. ENOM LENOM EENOM balanced changer 7 3.5 3.25 late changer 7 5.75 1.37 3 1 2 dead stable 0 0 0 early changer 7 1.25 5.25
  36. 36. mea suredENOM ry ca n be LENOM EENOM Histo balanced changer 7 3.5 3.25 late changer 7 5.75 1.37 3 1 2 dead stable 0 0 0 early changer 7 1.25 5.25
  37. 37. Evolution Number of Methods Stability Number of Lines of Code Historical Max of Cyclomatic Complexity Growth Trend Number of Modules ... ...
  38. 38. common wisdom: recently changed parts are likely to change in the near future
  39. 39. common wisdom: recently changed parts are likely to change in the near future r eally?
  40. 40. 30% 90%
  41. 41. present
  42. 42. past present
  43. 43. past future present
  44. 44. past future present
  45. 45. past future present
  46. 46. past future prediction hit present
  47. 47. past future YesterdayWeatherHit(present): past:=histories.topLENOM(start, present) future:=histories.topEENOM(present, end) past.intersectWith(future).notEmpty() prediction hit present
  48. 48. Yesterday’s Weather shows the localization of change hit hit hit YW = 3 / 8 = 37% hit hit hit hit hit hit hit YW = 7 / 8 = 87% 04 Girba etal, 20
  49. 49. Detection Strategies are metric-based queries to detect design flaws
  50. 50. God Class: class.ATFD() > FEW & class.WMC() >= VERY HIGH & class.TCC() < ONE THIRD
  51. 51. God Class: class.ATFD() > FEW & class.WMC() >= VERY HIGH & class.TCC() < ONE THIRD f it is s table? what i
  52. 52. Harmless God Class: classhistory.last.isGodClass() & classhistory.STABILITY(NOM) >= VERY HIGH 2004 Rat iu etal,
  53. 53. A A A A A B C B C B C B B D D D E ver .1 ver. 2 ver. 3 ver. 4 ver. 5
  54. 54. A A A A A A A A A A A A A A A A A A A A B C B C B C B B B C B C B C B B B C B C B C B B B C B C B C B B D D D E D D D E D D D E D D D E ver .1 ver. 2 ver. 3 ver. 4 ver. 5 ver .1 ver. 2 ver. 3 ver. 4 ver. 5 ver .1 ver. 2 ver. 3 ver. 4 ver. 5 ver .1 ver. 2 ver. 3 ver. 4 ver. 5 A A A A A A A A A A A A A A A A A A A A B C B C B C B B B C B C B C B B B C B C B C B B B C B C B C B B D D D E D D D E D D D E D D D E ver .1 ver. 2 ver. 3 ver. 4 ver. 5 ver .1 ver. 2 ver. 3 ver. 4 ver. 5 ver .1 ver. 2 ver. 3 ver. 4 ver. 5 ver .1 ver. 2 ver. 3 ver. 4 ver. 5 A A A A A A A A A A A A A A A A A A A A B C B C B C B B B C B C B C B B B C B C B C B B B C B C B C B B D D D E D D D E D D D E D D D E ver .1 ver. 2 ver. 3 ver. 4 ver. 5 ver .1 ver. 2 ver. 3 ver. 4 ver. 5 ver .1 ver. 2 ver. 3 ver. 4 ver. 5 ver .1 ver. 2 ver. 3 ver. 4 ver. 5 A A A A A A A A A A A A A A A A A A A A B C B C B C B B B C B C B C B B B C B C B C B B B C B C B C B B D D D E D D D E D D D E D D D E ver .1 ver. 2 ver. 3 ver. 4 ver. 5 ver .1 ver. 2 ver. 3 ver. 4 ver. 5 ver .1 ver. 2 ver. 3 ver. 4 ver. 5 ver .1 ver. 2 ver. 3 ver. 4 ver. 5
  55. 55. System System History Version Class Class History Version
  56. 56. System System History Version Inheritance Version Class Class History Version
  57. 57. System System History Version Inheritance Inheritance History Version Class Class History Version
  58. 58. A A A A A B C B C B C B B D D D E ver .1 ver. 2 ver. 3 ver. 4 ver. 5 A is persistent, B is stable, C was removed, E is newborn ...
  59. 59. A A A A A A B C B C B C B B C B D D D E ver .1 ver. 2 ver. 3 ver. 4 ver. 5 D E A is persistent, B is stable, C was removed, E is newborn ... 05 Girba etal, 20
  60. 60. Hierarchy Evolution reveals evolution patterns 05 Girba etal, 20
  61. 61. 1 2 3 4 5 6 A A B B E C D E C D 99 8 Ga ll etal, 1
  62. 62. 1 2 3 4 5 6 A B C D Version E
  63. 63. 1 2 3 4 5 6 A B C D Version E changed
  64. 64. 1 2 3 4 5 6 A History changed(i) B C D Version E changed
  65. 65. 1 2 3 4 5 6 A B C D E
  66. 66. {A, B, C, D, E} 1 2 3 4 5 6 Ø A {A, D, B} {A, E, C, D} {2} {6} B {D, B} {A, D} {A, E, C} C FCA {2, 4} {2, 6} {5, 6} D {D} {A} {C} E {2, 4, 6} {2, 5, 6} {3, 5, 6} Ø {1, 2, 3, 4, 5, 6}
  67. 67. {A, B, C, D, E} 1 2 3 4 5 6 Ø A {A, D, B} {A, E, C, D} {2} {6} B {D, B} {A, D} {A, E, C} C FCA {2, 4} {2, 6} {5, 6} D {D} {A} {C} E {2, 4, 6} {2, 5, 6} {3, 5, 6} Ø {1, 2, 3, 4, 5, 6} 0 7 Girba etal, 20
  68. 68. Parallel Inheritance add simultaneously children to several classes Shotgun Surgery change several classes simultaneously, but do not add methods
  69. 69. { { } } { { } } for wa rd en gin eer ing reverse engineering actual development n g e eri n gin rs ee r eve { { }} } { { { } }
  70. 70. Tudor Gîrba www.tudorgirba.com creativecommons.org/licenses/by/3.0/

×