Measurement Metrics for Object Oriented Design

4,938 views

Published on

Measurement Metrics for Object Oriented Design

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

No Downloads
Views
Total views
4,938
On SlideShare
0
From Embeds
0
Number of Embeds
147
Actions
Shares
0
Downloads
195
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Measurement Metrics for Object Oriented Design

  1. 1. A Metric Suite for Object Oriented Design<br />Shyam R. Chidamber and Chris F. Kemerer<br />Ari Wibisono<br />BambangAdhi<br />AchmadRohman<br />
  2. 2. Outline<br />
  3. 3. Contribution <br />
  4. 4. Research Probelms<br />
  5. 5. Theoritical Criticism<br />
  6. 6. OO design and development.<br />
  7. 7. Objective <br />
  8. 8. Theory Base for OO Metrics<br />
  9. 9. Measurement Theory Base<br />
  10. 10. Empirical Data Collection<br />
  11. 11. Software Dev Organization<br />
  12. 12. Results<br />
  13. 13. Metric 1 : Weighted Method Per Class<br />
  14. 14. Character Graphics<br />
  15. 15. Matrix 1 : Weight Method per Class<br />Case Study : Character Graphics<br />Number of Class Observed : 8<br />Number of Method Observed : 59<br />
  16. 16. How TO ObserveD<br />
  17. 17. Cyclomatic complexity<br />
  18. 18. Weight Method per Class (Statistics)<br />
  19. 19. Weight Method per Class (Character Graphics)<br />
  20. 20. WMC Result<br />Cyclomatic Complexity<br />Testability<br />Understandability<br />(SATC 1995)<br />
  21. 21. Matrix 3 : Depth of Inheritance Tree<br />DIT is the maximum length from a node to the root (base class)<br />Viewpoints:<br />Lower level subclasses inherit a number of methods making behavior harder to predict<br />Deeper trees indicate greater design complexity <br />
  22. 22. Matrix 2 : Depth of inheritance Tree<br />
  23. 23. Matrix 2 : Depth of inheritance Tree<br />
  24. 24. Matrix 3 : Number of Children<br /><ul><li>NOC is the number of subclasses immediately subordinate to a class
  25. 25. Viewpoints:
  26. 26. As NOC grows, reuse increases - but the abstraction may be diluted
  27. 27. Depth is generally better than breadth in class hierarchy, since it promotes reuse of methods through inheritance
  28. 28. Classes higher up in the hierarchy should have more sub-classes then those lower down
  29. 29. NOC gives an idea of the potential influence a class has on the design: classes with large number of children may require more testing</li></li></ul><li>Matrix 3 : Number of Children <br />
  30. 30. Matrix 4 : Class between objects<br /><ul><li>CBO is the number of collaborations between two classes (fan-out of a class C)
  31. 31. the number of other classes that are referenced in the class C (a reference to another class, A, is an reference to a method or a data member of class A)
  32. 32. Viewpoints:
  33. 33. As collaboration increases reuse decreases
  34. 34. High fan-outs represent class coupling to other classes/objects and thus are undesirable
  35. 35. High fan-ins represent good object designs and high level of reuse
  36. 36. Not possible to maintain high fan-in and low fan outs across the entire system </li></li></ul><li>Matrix 4 : Class between objects<br />
  37. 37. Matrix 4 : Class between objects<br />
  38. 38. Metric 5: Response For a Class (RFC)<br />
  39. 39. Metric 5: Response For a Class (RFC)<br /><ul><li>Jikasebuah class terdiriatasbanyak method, besarkemungkinankompleksitasdari class semakintinggi
  40. 40. Dan jikabanyak method dapatdipanggiluntukmeresponspesan yang diterimaolehsebuahobyekdarisuatu class besarkemungkinanpemeliharaandan testing menjadilebihkompleks.
  41. 41. Responsuntukmetriks class bertujuanuntukmengukurbanyaknya method lokaldanbanyaknya method yang dipanggiloleh method lokal
  42. 42. Tidakterdapatnilai threshold spesifikpadametriks RFC. NamunChidamber and Kemerermenyarankansemakinbesarnilai RFC, semakinbesar level pemahaman yang diperlukansebagaibagiandari tester</li></li></ul><li>Metric 5: Response For a Class (RFC)<br /><ul><li>Definisi
  43. 43. RFC = |RS| dimana RS adalah himpunan respons untuk class yang diberikan
  44. 44. RS = {M} Uall i {Ri}
  45. 45. dimana {Ri} = himpunan method-method yang dipanggil oleh method i dan
  46. 46. {M} = himpunan semua method-method dalam class
  47. 47. Ilustrasi definisi di atas :
  48. 48. A::f1() memanggil B::f2()
  49. 49. A::f2() memanggil C::f1()
  50. 50. A::f3() memanggil A::f4()
  51. 51. A::f4() tidak memanggil method lain
  52. 52. Then RS = {A::f1, A::f2, A::f3, A::f4} U {B::f2} U {C::f1} U {A::f4}
  53. 53. = {A::f1, A::f2, A::f3, A::f4, B::f2, C::f1} sehingga RFC = 6</li></li></ul><li>Metric 5: Response For a Class (RFC)<br />
  54. 54. Metric 5: Response For a Class (RFC)<br />
  55. 55. Metric 6: Lack of Cohesion in Methods (LCOM)<br />
  56. 56. Metric 6: Lack of Cohesion in Methods (LCOM)<br /><ul><li>Cohesion sebuah class adalahkarakteristikseberapadekat method-method lokalterhubungdenganvariabel-variabellokaldalamsebuah class. S.R Chidamber and C.F Kemereradalah yang pertamamendefiniskanmetriks LCOM pada 1991
  57. 57. Metriks LCOM adalahnilaiketidaksamaan method-method dalamsebuah class
  58. 58. Nilai LCOM yang tinggidalamsebuah class mengindikasikanlebihbaikjika class tersebutdipecahmenjadiduaataulebih sub-class. Hal inikarena class tersebutmungkinterlalubanyakmempunyaitugasuntukdilakukansehinggaakanlebihbaikuntukmenggunakanobyek yang lebihspesifik.</li></li></ul><li>Metric 6: Lack of Cohesion in Methods (LCOM)<br /><ul><li>DefinisiChidamber-Kemerer
  59. 59. Terdapatsebuah class C1 dengan n method M1, M2, …, Mn. Dengan {Ij} = himpunanvariabel instance yang digunakanoleh method Mi. Terdapatsebanyak n himpunan {I1}, …, {In}. Dengan P = {(Ii, Ij) | Ii ∩ Ij = ø} dan Q = {(Ii, Ij) | Ii ∩ Ij ≠ ø}. Jikasemuahimpunan n {I1}, …, {In} adalah ø makakemudian P = ø.
  60. 60. LCOM = |P| - |Q|, if |P| > |Q|. Otherwise LCOM = 0
  61. 61. Definisihimpunan yang tidakberisisan yang diusulkanChidamber-Kemerersepertinyaambigudankemudiandidefinisikanulangoleh Li dan Henry.</li></li></ul><li>Metric 6: Lack of Cohesion in Methods (LCOM)<br /><ul><li>Definisi Li-Henry
  62. 62. LCOM* = banyaknyahimpunantidakberirisandari method-method lokal; tidakadaduahimpunanberirisan; sembarangdaridua method dalamhimpunan yang sama yang sharing sedikitnyasatulokalvariabel instance; dari 0 sampai N; dimana N bernilai integer positif</li></li></ul><li>Metric 6: Lack of Cohesion in Methods (LCOM)<br />
  63. 63. Metric 6: Lack of Cohesion in Methods (LCOM)<br />
  64. 64. Reference<br /><ul><li>Chidamber S.R., Kemerer, C.F.: "A metrics suite for object-oriented Design", IEEE Transactions on SW Engineering, Vol. 20, No.6, June 1994
  65. 65. FabrizioRiguzzi:"A Survey of Software Metrics", UniversitàdegliStudidi Bologna, July 1996
  66. 66. Lionel Briand, Khaled El Emam, SandroMorasca :"On the Application of Measurement Theory in Software Engineering",International Software Engineering Research Network technical report #ISERN-95-04
  67. 67. Magnus Andersson, PatrikVestergren : "Object-Oriented Design Quality Metrics", Uppsala Master’s Theses in Computer Science 276, 2004-06-07, ISSN 1100-1836, Information Technology Computing Science Department Uppsala University Sweden</li></li></ul><li>Reference<br /><ul><li>The Project Manager’s Guide to Software Engineering’s Best Practice, Mark J. Christensen and Richard H. Thayer, IEEE Computer Society Press
  68. 68. Norman Fenton:"Software Measurement: A Necessary Scientific Basis", IEEE TRANSACTIONS ON SOFTWARE ENGINEERING. VOL. 20, NO. 3, MARCH I994 I99
  69. 69. Everald E. Mills : “ Software Metrics”, SEI Curriculum Module SEI-CM-12-1.1, Software Engineering Institute, Carnegie Mellon University, December 1988
  70. 70. Goal-Question-Metrics files on the internet</li></li></ul><li>Conclusion<br />Padapenelitianinitelahdikembangkandandiimplentasikansejumlah software metrikuntuk OO desain.Metrikiniberdasarkanteoripengukurandanjugamerefleksikan viewpoint daripengalamanpengembang software OO. <br />
  71. 71. Conclusion<br />Dalampengevaluasianmetrikinidenganmencocokandengankriteriastandar, hal yang dicocokanyaitu :<br />Memilikisejumlahproperti yang diinginkan.<br />Menyarankanbeberapacaradimanapendekatan OO mungkinberbedadalamhalfiturdesain yang diinginkanataudiperlukandaripendekatantradisional.<br />
  72. 72. Conclusion<br />Clearly, future or further research are designed to further investigate these apparent differences seem necessary. <br />

×