• No se han encontrado resultados

This section defines metrics that are consistent with the formal framework for software measurements as defined by Briand et al. [Bri+96]. This section is based on the CMMN formalization described in Section 3.3. Although this thesis is interested in complexity, it also defines size and length metrics because, as concluded by Muketha et al. [Muk+10a], size and length are similar to the complexity activity metrics proposed by Cardoso [Car07b]. The section starts by defining three size metrics, followed by length and complexity metrics.

Definition 7.1. (Size metric): The size of a model C denoted by CS(C) is defined as the

cardinality of E,

CS(C) = |E|

The size of a module pzq is defined as the cardinality of Ez,

CS(pzq) = |Ez| By Equation (3.3.1) it follows that,

CS(C) = |E| = X z∈L |Ez| = X z∈L CS(pzq)

Note that CS can be informally calculated by counting the nodes in the forest graph of elements E of a model C.

Note that,

Size for Figure 3.4 is CS(example1) = |E| = 1. Size for Figure 3.5 is CS(example2) = |E| = 4. Size for Figure 3.6 is CS(example3) = |E| = 8. Size for pxq in Figure 3.6 is CS(pxq) = |Ex|= 7.

Size for pyq in Figure 3.6 is CS(pyq) = |Ey|= 3.

Size for pzq in Figure 3.6 is CS(pzq) = |Ez|= 1.

In addition to the size metric CS(C), a set of size sub-metrics were defined that correspond to the number of different elements in E. Table 7.2 includes these sub-metrics.

Table 7.2: Size counters Type Counter Description

Scope

CSSC(C) Number of cases

CSSS(C) Number of stages

CSSDS(C) Number of discretionary stages

CSSP F(C) Number of plan fragments

Data CSDI(C) Number of case file items

Plan

CSP T(C) Number of tasks

CSP DT(C) Number of discretionary tasks

CSP E(C) Number of event listeners

CSP M(C) Number of milestones

Optional CSOC(C) Number of connectors

Decorator

CASDCP(C) Number of collapsed planning table decorators

CASDEP(C) Number of expanded planning table decorators

CASDAC(C) Number of autocomplete decorators

CASDC(C) Number of collapsed decorators

CASDE(C) Number of expanded decorators

CASDM A(C) Number of manual activation decorators

CASDRN(C) Number of repetition decorators

CASDR(C) Number of required decorators

Sentry CASSE(C) Number of entry criteria sentries

CASSX(C) Number of exit criteria sentries

Marker

CASM H(C) Number of non-blocking human markers

CASM P(C) Number of process markers

CASM C(C) Number of case markers

CASM HB(C) Number of participant markers

CASM T(C) Number of timer markers

Definition 7.2. (Annotator size metric): The number of annotators in a model C denoted by

CAS(C) is defined as the cardinality of A,

CAS(C) = |A|

We also define counters corresponding to a number of different annotators in A. Table 7.2 includes these counters.

Note that,

Size for Figure 3.5 is CAS(example2) = |E| = 3. Size for Figure 3.6 is CAS(example3) = |E| = 6.

Definition 7.3. (Total size metric): The total size of a model C denoted by CTS(C) is defined

as the cardinality of E plus the cardinality of A,

CTS(C) = |E| + |A| = CS + CAS

Note that,

Size for Figure 3.4 is CTS(example1) = |E| = 1. Size for Figure 3.5 is CTS(example2) = |E| = 7. Size for Figure 3.6 is CTS(example3) = |E| = 14.

Definition 7.4. (Length metric): The length of a model C denoted by CL(C) is defined as the

maximum nesting depth of a model. The length CL(C) can be calculated by the following algorithm:

1: function CL(C)

2: int m ← 0

3: for each case-plan c ∈ L do

4: m ← max(m, depth(m, c)) 5: end for 6: return m 7: end function 8: 9: function depth(s) 10: int d ← 0 11: if s /M then 12: return 0 13: end if

14: for all e in scope s do

15: d ← max(d, depth(e))

16: end for

17: return d+ 1

y a b c x z e d Depth 1 2 3

Figure 7.1: Tree view of elements in Example 3

The length of a module pzq is defined as the maximum nesting depth of the module, and can be calculated using the following algorithm:

1: function CL(pzq)

2: assert(z ∈ M)

3: return depth(z)

4: end function

As shown in Figure 7.1, the elements E of a model C can be organized as a forest graph where each tree is a case element module. We used the CMMN element icons to represent the nodes of the tree. Figure 7.1 shows a forest with two trees pxq, pzq, and a subtree pyq. It also shows six leaves, namely d, e, a, b, c, and z.

Note that,

Length for Figure 3.4 is CL(example1) = 1. Length for Figure 3.5 is CL(example2) = 2. Length for Figure 3.6 is CL(example3) = 3. Length for pxq in Figure 3.6 is CL(pxq) = 3. Length for pyq in Figure 3.6 is CL(pyq) = 2. Length for pzq in Figure 3.6 is CL(pzq) = 1.

Definition 7.5. (Complexity metric): The complexity of a model C denoted by CC(C) is

defined as: CC(C) =      0 if C = ∅ P i∈E∪AWi if C 6= ∅

Where, the weight Wi, is given in Table 7.3.

The complexity of a model resembles a cognitive complexity metric with cognitive weights. There are several cognitive complexity metrics that have been defined for Business Process

Management (BPM) [Çoş14; GL06a; GL06b; SW03]. However, those cognitive complexity metrics are not applicable to CMMN because they are based on control structures [Fig+10] like sequence, branching, iterations, etc., which are not present in CMMN. For the CMMN complexity metric CC(C), we assign weights to elements in E and annotators in A. The weights were assigned based on the researcher’s intuition. Higher weights were given to less frequently used elements and to annotators that increased the number of elements in the visual canvas because less frequently used elements require better recall capabilities by users and clutter by annotators makes the model more difficult to read.

The complexity of a module pzq is defined as,

CC(pzq) = X

i∈Ez∪Az Wi

Note that,

Complexity for Figure 3.4 is CC(example1) = 1. Complexity for Figure 3.5 is CC(example2) = 7 (weights w=1, o=1, p=0, q=1, k=1, l=0, j=3).

Complexity for Figure 3.6 is CC(example3) = 11

(weights z=1, x=1, a=2, b=0, c=1, y=1, d=1, e=1, h=1, i=0, j=0, k=1, l=0, m=1). Complexity for pxq in Figure 3.6 is CC(pxq) = 10

(weights x=1, a=2, b=0, c=1, y=1, d=1, e=1, h=1, i=0, j=0, k=1, l=0, m=1). Complexity for pyq in Figure 3.6 is CC(pyq) = 3

(weights y=1, d=1, e=1).

Complexity for pzq in Figure 3.6 is CC(pzq) = 1.

Table 7.3:CMMN weights

E ∪ A Description Weight

case element 1

stage element 1

+ discretionary stage element 2

Table 7.3 – Continued from previous page

E ∪ A Description Weight

plan fragment element 3

case file item element 1

task element 1

discretionary task element 2

event listener element 2

milestone element 1

connector (sentry) element 0

collapsed planning table 1

expanded planning table 2

autocomplete 2 + collapsed 0 - expanded 1 manual activation 1 # repetition 1 ! required 1

entry criterion with associated connector 1 entry criterion without a connector 2 exit criterion with associated connector 1 exit criterion without a connector 3

non-blocking human 1

process 0

case referring to a case element not in this model 0 case referring to a case element in this model 1

participant 0

timer 0