Metrics. Basili’s work Basili et al., A Validation of Object- Oriented Design Metrics As Quality...

Post on 18-Dec-2015

216 views 4 download

Transcript of Metrics. Basili’s work Basili et al., A Validation of Object- Oriented Design Metrics As Quality...

Metrics

Basili’s work

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

• Predictors of fault-prone classes?

• 8 medium sized information management systems

Metric

• CBO metric: 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.

Hypothesis

• H-CBO: Highly coupled classes are more fault-prone than weakly coupled classes.

Result

• Indeed, highly coupled classes are more fault-prone than weakly coupled classes.

– Corollary: Classes that follow the LoD are less coupled and are therefore less fault-prone.

Demeter Motivation

• V. Basili 1996: classes with less coupling are less error prone.

• Demeter reduces the coupling in two stages: – Following the Law of Demeter using standard

object-oriented techniques eliminates the obviously bad coupling.

– Traversal strategies reduce the coupling further by coupling only with (distant) stable friends.