Effect of slice scope on data slice-based class cohesion metrics

Yuming Zhou,Baowen Xu
DOI: https://doi.org/10.3969/j.issn.1003-7985.2008.02.010
2008-01-01
Abstract:This paper suggests that a single class rather thanmethods should be used as the slice scope to compute classcohesion. First, for a given attribute, the statements in allmethods that last define the attribute are computed. Then, theforward and backward data slices for this attribute are generatedby using the class as the slice scope and are combined to computethe corresponding class data slice. Finally, the class cohesion iscomputed based on all class data slices for the attributes.Compared to traditional cohesion metrics that use methods as theslice scope, the proposed metrics that use a single class as slicescope take into account the possible interactions between themethods. The experimental results show that class cohesion canbe more accurately measured when using the class as the slicescope.
What problem does this paper attempt to address?