|
Abstract : |
We consider ways of measuring the cohesion of program fragments based upon techniques for program slicing, following the work of Ott et al [12, 2, 13, 11, 10]. The approach is based on the idea that the intersection of a program's slices represents that part of the fragment which is cohesive. We produce cohesion metrics that are structurally identical to those of Ott and Thuss [13], the difference is that we consider different ways of measuring the significance of the intersection of a program's slices. We introduce expression metrics, to calculate the significance of the code in the intersection of slices, arguing that this approach may provide better answers than the `Lines of Code ' approach implicit in much of the literature [12, 10, 13]. The substitution of the `Lines of Code ' metric with alternative metrics, within the metrics defined by Ott and Thuss, motivates the consideration of metrics as higher--order functions, expressed in a pure functional programming language. This provides us with many convenient notational conventions with which to construct new metrics by partial application and instantiation of function--valued parameters, within such higher--order metrics. We also raise some new issues concerning the computability of a cohesion metric, based upon program slices, indicating that the approach may, in some cases give an over--large value for cohesion. 1, |