Research Article

A Granular Hierarchical Multiview Metrics Suite for Statecharts Quality

Table 1

Metrics suite for a statechart (at the state and at the statechart diagram levels).

Metric nameMetric definition

Indegree I(s) of a state s (fan-in)The total number of entering transitions into s

Outdegree O(s) of a state s (fan-out)The total number of exiting transitions from s

NSS(s) number of direct source states into sThe total number of states that are direct source states of entering transitions into s

NTS(s) number of direct target states from sThe total number of states that are direct target states of exiting transitions from s

Number of actions associated to the state NA(s)The total number of distinct actions associated to the state that exists on outgoing transitions from this state under focus

Number of events associated to the state NE(s)The total number of distinct events associated to the state that exists on outgoing transitions from this state under focus

Number of states NS(s)The total number of states including simple states as well as composite states that are the constituent parts of the substatechart under measurement

Number of states at a single depth level NSL(sc)The total number of states including simple states as well as composite states that are the constituent parts of all the substatecharts viewed at a single given depth level

Conceptual depth of the statechart CD(sc)The conceptual depth of the statechart CD(sc), which is the maximum value of conceptual depths of all states that are the constituent parts of the statechart. Due to nesting levels and overlapping, we take the maximum

Number of internal transitions NIT(s)The total number of transitions where both the source state and the target state are within the enclosure of the composite state s. Outgoing and incoming transitions to the composite state s under study are ignored

Number of Interlevel intrahierarchy external transitions NIET(s)The total number of external interlevel transitions crossing two or more levels in the state hierarchy, from or into s

Number of deeper external cross-hierarchy transitions NDET(s)Number of deeper cross-hierarchy transitions relative to depth(s) crossing in other parts of the statechart, from or into s

(NIET(s) + NDET(s))/((I(s) + O(s))A ratio ranging in [0, 1]

McCabe's cyclomatic complexity CC(s)CC(s) = NIT(s) − NS(s) + 2