Modelling Software for Structure Metrics
P.M. van den Broek, K.G. van den Berg · University of Twente Research Information · 1993
In the approach to structural software metrics, software is modelled by means of flowgraphs. A tacit assumption in this approach is that the structure of a program is reflected by the structure of the flowgraph. When only the flow of control between commands is considered this assumption is valid; it is no longer valid however when also the control flow inside expressions is consid-ered. In this chapter, we introduce structure graphs for the modelling of software. Structure graphs can, just as flowgraphs, be uniquely decomposed into a hierarchy of indecomposable prime structures. We show how programs in an imperative language can be modelled by means of structure graphs in such a way that the structure of a program is always reflected by the structure of the corresponding structure graph. We give a prototype implementation for the mapping of programs of a small example language to structure graphs, and for the decomposition of structure graphs into a hierarchy of indecomposable structure graphs.