Table 2: Size and coupling metrics results.
System Version LOC NOA NOO VS CBC
Threads 74 4 11 4 5
ProdCons JCSP 52 2 9 3 7
AJCSP 22 0 5 3 0
Threads 190 10 26 5 7
Bingo JCSP 174 14 23 4 11
AJCSP 138 6 20 4 3
the same functionalities for each version of the appli-
cations. This is important to perform a fair compari-
son.
In the measurement process, the data was partially
gathered by the AJATO measurement tool
1
. It sup-
ports some metrics: LOC, NOA, NOO. Additionally,
we used the AOP metrics tool
2
to collect CBC and
VS. Eventually, we collected the SoC metrics (CDC,
CDO, LOCC, DOSC, DOSM, and DOTC) (Sant’anna
et al., 2003; Eaddy et al., 2008) manually.
4.2 Study Results
This subsection presents the results of the measure-
ment process. The data have been collected based on
the set of defined metrics. The presentation is orga-
nized in two parts. First, we describe the results for
the separation of concerns metrics. Then, we present
the results for the size and coupling metrics.
4.2.1 Separation of Concerns Measures
Table 1 shows the results for the SoC metrics. The
AJCSP versions of the target systems performed bet-
ter than the other two versions. The application of
the SoC metrics was useful to quantify how effective
was the separation of the concurrencycontrol concern
in the target systems. In relation to the measure of
CDC, all target systems present similar results for the
three implemented versions. By considering the VS
metric from Table 2, we can observe (using the CDC
metric) that the concurrency concern crosscuts almost
the components of the target systems in all versions.
Thus, we can conclude that none of three versions
of the target systems provides a good separation of
concern regarding scattering. Code scattering is one
symptom that indicates that a system fails to modular-
ize a particular concern that is implemented in multi-
ple components (classes) (Laddad, 2003). Since all
versions demonstrated to be too scattered in relation
to their components, we employed the DOSC metric.
With the DOSC, we can quantify exactly the degree
of how scattered the concurrency concern is in each
1
http://www.teccomm.les.inf.puc-rio.br/emagno/ajato/
2
http://aopmetrics.tigris.org/
version of the target systems. After measurement, we
realized that the AJCSP version presented the worst
results in implementing the concurrency control by its
components. This is due to the annotative approach
imposed by AJCSP.
Even though the AJCSP approach presents the
worst results for code scattering across components,
our approach is superior for both CDO and DOSM
metrics. We employed such metrics to quantify and
measure the degree of how scattered the concurrency
concern is in relation to all operations in the tar-
get systems. We observed that except our approach,
the other two (threads and JCSP) presented higher
CDO and DOSM. In fact, the AJCSP implementation
presents 0 for both CDO and DOSM. This divergence
is a direct consequence of the strategy we adopted for
annotating the concurrency behavior in classes. Since
we put all annotations before a class definition, we
decouple the methods (operations) from the concur-
rency concern code. As a result, we have a more leg-
ible code which implements only the business con-
cern. By considering the four metrics for scattering
measurement, the AJCSP approach is the answer for
the first research question (RQ1).
Code tangling is another symptom of non-
modularization of a particular concern (Laddad,
2003). Code tangling is caused when a component
handles multiple concerns simultaneously. Hence, to
measure the degree of tangling of the concerns (con-
currency and business) implemented by the three ver-
sions of the target systems, we employed the DOTC
metric. The AJCSP approach showed to be less tan-
gled when compared with the other approaches. We
can easily notice that by reasoning in how the AJCSP
approach is achieved. So, since we concentrate the
concurrency concern code as annotations in the be-
ginning of a class, this way, the rest of the code is
dedicated only to the business concern implementa-
tion. As a result, the code became less tangled with
the concurrency control code. The main reason is
that the concurrency concern code appears in several
methods of a class in the other approaches. This can
observed in the CDO and DOSM metrics previously
discussed. As a consequence of our approach, the tan-
gling degree is inversely proportional to a system size
(LOC metric in Table 2). Thus, the greater the lines
of code of a system is, the lower degree of tangling it
is. Therefore, this answer the second research ques-
tion (RQ2).
Finally, regarding LOCC (Lines of Concern Code)
metric, we can observe that since AJCSP concentrates
the concurrency concern implementation into a sin-
gle place, it requires less lines of concern code to im-
plement such a concern in contrast to the other ap-
ICSOFT 2010 - 5th International Conference on Software and Data Technologies
230