1 / 18

A Validation of Object-Oriented Design Metrics As Quality Indicators

A Validation of Object-Oriented Design Metrics As Quality Indicators. Basili et al. IEEE TSE Vol. 22, No. 10, Oct. 96. Abstract. Suite of OOD metrics by Chidamber. Predictors of fault-prone classes? Can be used as early quality indicators? Other study: frequence of maintenance changes.

angelo
Download Presentation

A Validation of Object-Oriented Design Metrics As Quality Indicators

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. A Validation of Object-Oriented Design Metrics As Quality Indicators Basili et al. IEEE TSE Vol. 22, No. 10, Oct. 96

  2. Abstract • Suite of OOD metrics by Chidamber. • Predictors of fault-prone classes? • Can be used as early quality indicators? • Other study: frequence of maintenance changes. • 8 medium sized information management systems

  3. Metric • CBO: coupling between object classes: a class is coupled to another one if it uses its member functions and/or instance variables. CBO = number of classes to which a given class is coupled.

  4. Connection to Law of Demeter • Following LoD or reducing the number of violations reduces CBO because LoD only allows good coupling.

  5. Law of Demeter: Violation class A {public: void m(); P p(); B b; }; class B {public: C c; }; class C {public: void foo(); }; class P {public: Q q(); }; class Q {public: void bar(); }; void A::m() { this.b.c.foo(); this.p().q().bar();} CBO(A) = 4 CBO(A)= {B,C,P,Q} With LoD: CBO(A) = 2

  6. Metric • RFC: response for a class. This is the number of methods that can potentially be executed in response to a message received by an object of that class.

  7. Connection to Law of Demeter • Following LoD or reducing the number of violations reduces RFC because LoD allows fewer methods to be called.

  8. Assume data member access through get method Law of Demeter: Violation class A {public: void m(); P p(); B b; }; class B {public: C c; }; class C {public: X foo(); }; class P {public: Q q(); }; class Q {public: Y bar(); }; void A::m() { this.b.c.foo(); this.p().q().bar();} RFC(A) = 6 RFC(A)= {b,c,p,q,foo,bar} With LoD: RFC(A) = 4 RFC(A)= {b,p,foo2,bar2} But …

  9. Assume data member access through get method Law of Demeter: Violation With LoD: RFC(A) = 4 RFC(B) = 2 RFC(P) = 2 8 class A {public: void m(); P p(); B b; }; class B {public: C c; void foo2() {c.foo();}; class C {public: X foo(); }; class P {public: Q q(); void bar2(){q().bar(); }; class Q {public: Y bar(); }; void A::m() { this.b.foo2(); this.p().bar2();} Without LoD: 6 + 0 + 0 = 6 LoD spreads RFC but it might increase it!

  10. Assume data member access through get method Law of Demeter: Violation Illustrate better separation RFC(A) = 4 RFC(B) = 2 RFC(P) = 2 8 class A {public: void m(); P p(); B b; }; class B {public: C c; }; class C {public: X foo(); }; class P {public: Q q(); }; class Q {public: Y bar(); }; void A::m() { X x=M.cg.fetch(this,”from A to X”); Y y=M.cg.fetch(this,”from A to Y”);} RFC(A)={fetch} With LoD: RFC(A) = 1 CBO(A)= {DJ.ClassGraph}

  11. Class Diagram m from A to X c foo() b B C X A q() bar() p() from A to Y Y P Q

  12. Hypotheses • H-CBO: Highly coupled classes are more fault-prone than weakly coupled classes because they depend more heavily on methods and objects defined elsewhere. • H-RFC: Classes with larger response sets implement more complex functionalities and are, therefore, more fault-prone.

  13. RFC (on projects) Y • X axis: values of metric. • Y axis: number of classes. Probability of fault detection increases X

  14. CBO (on projects) Y • X axis: values of metric. • Y axis: number of classes. Probability of fault detection increases X

  15. Results • RFC is very significant. The H-RFC hypothesis is supported. • CBO is significant, particularly for UI classes.

  16. Analysis Methodology • Response variable: binary: was a fault detected in a class during testing? • Used logistic regression, a standard technique used in experimental sciences. • Alternatives would be: classification trees, optimized set reduction, or neural networks.

  17. Study Participants • Four months • Students in a class on OO software analysis and design • Control differences in skills: randomly grouped into eight teams. • Used blocking: eight most experienced students randomly assigned to a different group.

  18. Development Process for Video Store Application • Sequential software engineering life-cycle model based on waterfall model: analysis, design, implementation, testing and repair. • Requirement and design document were checked. • OMT (Rumbaugh) was used • C++ with MotifApp, GNU library, database library.

More Related