4. Modularity Analysis
We have described how the assessment phase was organized in three stages
. This section presents the results for the ¯rst two stages, where we analyze
the initial modularity of each OO and AO solutions of the HW base version
. Then we analyze their stability throughout the change scenarios
. We used a metrics suite (Table 2 summarizes each metric used in this case
study) that quantified three fundamental modularity attributes, namely separation
way, supporting the generation of comparable results. The size metric group also
includes metrics for both general system attributes (e.g. Number of Lines of Code)
and metrics that are speci¯c to design by contract such as Number of Preconditions
(NOPre). The size metrics related to DbC are useful to quantify reuse of design by
contract code in existing systems. In addition, this suite introduces three new metrics
for quantifying SoC. They measure the degree to which a single concern
(design by contract, in the case of this study) in the system maps to: (i) components
(i.e. classes and aspects) based on the metric Concern Di®usion over Components
(CDC), (ii) operations (i.e. methods and advice) based on the metric Concern
Di®usion over Operations (CDO), and (iii) lines of code based on the metric
Concern Di®usion over Lines of Code (CDLOC). The majority of these metrics can
be collected automatically by applying an existing measurement tool [13]. Additionally,
we used the AOP metrics tool to collect the coupling (CBC) metric.
The SoC metrics require the manual "shadowing" of the code (i.e. identifying
which segment of code contributes to the DbC concern such as pre- and postconditions).
Although the mapping of DbC features to the source code is not
completely automated, it is facilitated with tool support. For all the employed
metrics, a lower value implies a better result. Detailed discussions about the metrics
appear elsewhere. The complete description of the gathered data, measurement
tools, and shadowed code is also available at.