<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>OCL Framework to Verify Extra-Functional Properties in Component and Connector Models</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Shahar Maoz</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Ferdinand Mehlan</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Jan Oliver Ringert</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Bernhard Rumpe</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Michael von Wenckstern</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>School of Computer Science, Tel Aviv University</institution>
          ,
          <country country="IL">Israel</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Software Engineering, RWTH Aachen University</institution>
          ,
          <country country="DE">Germany</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>-We present an OCL framework and tool for the description and verification of consistency rules of extra-functional properties (EFPs) in component and connector (C&amp;C) models. The framework is based on our previously defined structure of EFP consistency rules using selection, aggregation, and comparison operators, and provides C&amp;C specific OCL functions and configurations that allow engineers to succinctly express EFP consistency rules for C&amp;C models. Further, the extension of OCL is twofold. First, constraints may contain C&amp;C specific expressions and second, expressions natively support measurement units as required in specifications of EFPs. We have extended the OCL verification process to support the novel extensions and to automatically generate meaningful positive and negative witnesses for consistency and inconsistency. We implemented the approach within the MontiCore framework for the C&amp;C modeling language MontiArc. Initial evaluation shows that it is expressive and scales to large, industrial sized C&amp;C models.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>I. INTRODUCTION</title>
      <p>
        Component and connector (C&amp;C) models are used in many
application domains of software engineering, from
cyberphysical and embedded systems to web services and enterprise
applications. The structure of C&amp;C models consists of
components at different containment levels, their typed interaction
points, and connectors between them [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ]. In addition to
functional properties, extra-functional properties (EFPs) play
an important role in the development of C&amp;C models [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ],
[
        <xref ref-type="bibr" rid="ref19">19</xref>
        ]–[
        <xref ref-type="bibr" rid="ref21">21</xref>
        ]. Important examples of EFPs include
worst-caseexecution-time (WCET), memory and power consumption,
security properties, and traceability [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ], [
        <xref ref-type="bibr" rid="ref16">16</xref>
        ], [
        <xref ref-type="bibr" rid="ref18">18</xref>
        ].
      </p>
      <p>
        Recently, we have presented a non-invasive technique for
adding EFPs to C&amp;C models by means of tagging
languages [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ]. Importantly, this technique requires no changes
to the meta-model of the C&amp;C language. In addition, we
have suggested a generic structure for EFP consistency rules
based on selection, aggregation, and comparison operators.
Conceptually, a consistency rule states for a C&amp;C element
and an EFP whether the EFP value is consistent with the EFP
values of other C&amp;C elements. Technically, consistency rules
are constraints that are satisfied iff the EFP value is consistent.
Consistency is determined by comparison to aggregated EFP
values of related C&amp;C elements as defined by the selection,
aggregation, and comparison operators of consistency rules.
      </p>
      <p>
        In this paper we are interested in the concrete formalization
of EFP consistency rules and in their automated analysis.
We propose to leverage the popular and expressive Object
Constraint Language [
        <xref ref-type="bibr" rid="ref25">25</xref>
        ] (OCL) and its analysis capabilities
for the definition and analysis of EFP consistency of C&amp;C
models.
      </p>
      <p>Our first contribution is a C&amp;C-specific extension of
OCL. The extension allows the definition of C&amp;C consistency
constraints based on clean mathematical C&amp;C definitions; all
implementation specific details, such as more complex types
from the meta-model or abstract-syntax representations are
abstracted away by providing C&amp;C specific OCL
configurations and powerful type-inference mechanisms when checking
consistency.</p>
      <p>
        Our second contribution extends OCL with support
for measurement units and an automatic mechanism to
produce witnesses for EFP consistency checking results.
First, many EFPs, describing physical properties of C&amp;C
models, e.g., WCET, power consumption, or memory usage,
contain physical units, e.g., seconds, Watts, or sizes. Thus,
to enable domain experts define EFP consistency rules, a
constraint language for EFPs naturally should support
automatic unit comparison and conversion . Second, our previously
defined mathematical framework [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ] structures the definition
of consistency rules. This general structure allows to
automatically generate positive and negative witnesses for consistency
checking results. These witnesses intuitively demonstrate the
reasons for consistency or inconsistency of a C&amp;C model.
      </p>
      <p>Our third contribution is an initial evaluation of
checking EFP consistency of an industrial sized C&amp;C
model. Specifically, we used our tool to verify four selected
consistency rules on an industrial sized Autonomous Driver
Assistance System (ADAS) model. The ADAS model consists
of about 1,400 components and 4,500 ports, and 2,800 tagged
EFP values. Our examples and evaluation show that (i) our
OCL based approached is expressive enough for defining
complex consistency constraints, and (ii) that the performance
of our implementation for checking these consistency rules
scales to large models.</p>
      <p>In the next section we present a running example. Sect. III
gives background on C&amp;C models and consistency rules of
EFPs. Sect. IV and Sect. V present our OCL framework and
example constraints, Sect. VI presents the implementation, and
Sect. VII presents a case study in which the framework is used.
Sect. VIII present related work, and Sect. IX concludes.</p>
    </sec>
    <sec id="sec-2">
      <title>II. RUNNING EXAMPLE Consider the sensor block of a weather balloon system as shown in Fig. 1 (for textual syntax, see Fig. 2). The sensor</title>
      <p>component type
instance name
block of component type WBalloonSens consists of various
components: a temperature sensor (component instance temp
of component type Temp), two GPS sensors (component
instances gps1 and gps2 of component type GPS), and a
controller (component instance controller of component
type Controller). The controller periodically pushes sensor
data to another system in order to save it. The position of the
balloon is important for recovery after landing. Position data
from GPS is pushed to an antenna system, which relays the
position to ground control.</p>
      <p>One EFP in our running example is power consumption (tag
power). The component types and the component instances
in Fig. 1 are tagged with estimated power consumption, e.g.,
the component type GPS is tagged with power=2500mW
and its component instance gps1 is tagged with power=2W.
The weather balloon will be running on a limited power
supply and power consumption has to be budgeted carefully.
Hence, the sensor block is required to consume at most 5W
(see power property of component type WBalloonSens
in Fig. 1). Based on this extra-functional property of the
parent component requirements for subcomponent types are
added: Temp consumes at most 400mW , the GPS sensors
GPS 2500mW each, and the controller 10mW .</p>
      <p>However, the declaration of power consumption EFPs
in this model is inconsistent. The subcomponents require
5410mW when only 5W are defined by component type
WBalloonSens (note that it would be consistent when
taking the component instances and not types into account,
which together consume 4910mW ).</p>
      <p>Another EFP in our running example is the
worst-caseexecution-time (WCET, tag wcet) of components. As we
assume independent execution of all components and the WCET
of each subcomponent is less than the WCET of component
type WBalloonSens, the WCET EFPs are consistent.</p>
      <p>Engineers can easily add EFP tags and EFP consistency
rules as OCL constraints, which our tool automatically verifies.
1component WBalloonSens {
2 ports in Byte[] controlSig,
3 out Byte[] dataSave,
4 out Byte[] dataAntenna;
5 component Controller controller;
6 component GPS gps1, gps2;
7 component Temperature temp;
8 ...
9 connect controller.antenna -&gt; dataAntenna;
10 connect gps1.loc -&gt; controller.loc1; }
e
v
a
S
a
tad Fig. 2: Definitions of WBalloonSens from Fig. 1
top component definition
is instantiated once with
instance name wBalloonSens</p>
    </sec>
    <sec id="sec-3">
      <title>III. PRELIMINARIES We provide background on C&amp;C models, extra-functional properties, and their consistency rules.</title>
      <sec id="sec-3-1">
        <title>A. Component and Connector Models</title>
        <p>
          Component and connector models describe components,
their points of interaction, and their hierarchical composition.
We repeat a definition of C&amp;C models as, e.g., given in [
          <xref ref-type="bibr" rid="ref11">11</xref>
          ],
in Def. 1, which represents the essence of component
models [
          <xref ref-type="bibr" rid="ref13">13</xref>
          ] as formalized by ADLs ACME [
          <xref ref-type="bibr" rid="ref4">4</xref>
          ], AADL [
          <xref ref-type="bibr" rid="ref3">3</xref>
          ], and
MontiArc [
          <xref ref-type="bibr" rid="ref7">7</xref>
          ], or in tools AutoFOCUS [
          <xref ref-type="bibr" rid="ref8">8</xref>
          ] and Simulink [
          <xref ref-type="bibr" rid="ref24">24</xref>
          ].
        </p>
      </sec>
      <sec id="sec-3-2">
        <title>Definition 1 (Component and Connector model [11]): A</title>
        <p>C&amp;C model is a structure cncm = hCmps; Ports; Cons;
Types; subs; ports; typei where</p>
        <p>Cmps is a set of named components, cmp 2 Cmps has a
set of ports ports(cmp) Ports and a (possibly empty)
set of immediate subcomponents subs(cmp) Cmps,
Ports = InPorts ] OutPorts is a disjoint union of input
and output ports where each port p 2 Ports has a name,
a type type(p) 2 Types, and belongs to exactly one
component p 2 ports(cmp),
Cons is a set of directed connectors con 2 Cons, each
of which connects two ports con:src; con:tgt 2 Ports of
the same type, which belong to two sibling components
or to a parent component and one of its immediate
subcomponents, and</p>
        <p>Types is a finite set of type names.</p>
        <p>
          C&amp;C models from Def. 1 are well-formed iff no component
is its own (transitive) subcomponent and has at most one direct
parent and subcomponents are connected legally (see [
          <xref ref-type="bibr" rid="ref11">11</xref>
          ] and
[
          <xref ref-type="bibr" rid="ref17">17</xref>
          ] for complete definitions).
        </p>
        <p>
          While some formalisms directly express C&amp;C models, e.g.,
[
          <xref ref-type="bibr" rid="ref8">8</xref>
          ], [
          <xref ref-type="bibr" rid="ref24">24</xref>
          ], others provide C&amp;C type definitions and their
instantiation to define C&amp;C models, e.g., [
          <xref ref-type="bibr" rid="ref3">3</xref>
          ], [
          <xref ref-type="bibr" rid="ref7">7</xref>
          ].
        </p>
      </sec>
      <sec id="sec-3-3">
        <title>Definition 2 (Component Type Definition [12]): A com</title>
        <p>ponent type definition is a structure ct = hcType; CPorts;
CSubs; CConsi 2 CTDefs where
cType uniquely identifies the component type,
CPorts is a set of input and output port definitions where
each port p 2 CPorts has a name and a type,
CSubs N ame CTDefs is a set of named
subcomponent declarations, and
CCons is a set of directed connector definitions con 2
CCons, each of which connects two port definitions
con:src; con:tgt of the same type, which belong to two
sibling subcomponent declarations or to a component
type definition and one of its subcomponent declarations.</p>
        <p>
          A component type t 2 CTDefs is instantiated to a C&amp;C
model by creating a component for c with subcomponents,
that are instances of t:CSubs with connectors according
to t:CCons. For a more detailed definition including
wellformedness rules and instantiation see [
          <xref ref-type="bibr" rid="ref17">17</xref>
          ]. For an instantiated
cmp 2 Cmps the function CType(cmp) returns the
corresponding component type.
        </p>
      </sec>
      <sec id="sec-3-4">
        <title>B. Consistency of EFPs in C&amp;C Models</title>
        <p>It is important to note that the consistency of an EFP value
may depend on multiple other C&amp;C model elements, their
relations, and their EFP values. Some advanced examples of
consistency relate to component instantiation and composition
in C&amp;C models. In addition, consistency may be very specific
to the EFP type, e.g., checking consistency of WCET values
is different from checking memory consumption.</p>
        <p>
          To address the challenge of ensuring consistency of EFP
values, in a previous paper [
          <xref ref-type="bibr" rid="ref12">12</xref>
          ] we defined a general structure
of EFP consistency rules shown in Def. 3. First, each rule
defines what EFP value of which kind of C&amp;C model element
it checks. Second, the rule specifies how to select relevant
C&amp;C model elements for the check. Third, the rule defines
how to aggregate tagged values over the selected elements.
Finally, the aggregated value is compared to the value of the
checked element, to determine its consistency.
        </p>
      </sec>
      <sec id="sec-3-5">
        <title>Definition 3 (EFP Value Consistency Rule [12]): A consis</title>
        <p>tency rule is a structure consisting of:
checks name of tag and element checked by rule;
selection selects relevant C&amp;C elements to check consistency;
aggregation aggregates values of selected elements; and
comparison compares values to decide consistency.</p>
        <p>
          The next two subsections illustrate some examples on
consistency definition rules according to Def. 3; more examples
are available in [
          <xref ref-type="bibr" rid="ref12">12</xref>
          ]. Sect. III-B1 presents rules for the
consistency of EFP values in the context of component type
instantiation. Sect. III-B2 presents rules in the context of
composition.
        </p>
        <p>1) Instantiation Consistency: Instantiation consistency
checks whether the EFPs of component instances are
consistent to the EFPs of their component type definitions.</p>
        <p>
          Rule 1 (InstPower [
          <xref ref-type="bibr" rid="ref12">12</xref>
          ]): The power consumption of an
instance is at most the power consumption of its type:
checks: tag power of cmp 2 Cmps
selection: t := CType(cmp) 2 CTDefs
aggregation: v := cmp:power
comparison: v t:power
        </p>
        <p>Rule 2 (InstCertificates): The certificates of component
instances must be at most the certificates common to all ports
of the component:
checks: tag cert of cmp 2 Cmps
selection: P := cmp:ports
aggregation: v := Tp2P p:cert
comparison: v cmp:cert
2) Composition Consistency: Composition consistency
checks whether the EFPs of C&amp;C model elements are
consistent across their composition. The following example rules
address consistency at the type level. Similar rules can be
defined at the instance level.</p>
        <p>
          Rule 3 (CompPower [
          <xref ref-type="bibr" rid="ref12">12</xref>
          ]): The combined power
consumption of all subcomponents is at most the power consumption
of the composed component:
checks: tag power of ct 2 CTDefs
selection: S := ct:CSubs
aggregation: v := P sct:power
        </p>
        <p>(name;sct)2S
comparison: v ct:power</p>
        <p>Rule 4 (ASIL): The ASIL (Automotive Safety Integrity
Level) of all subcomponents must be higher or equal than
the ASIL of the composed component:
checks: tag asil of cmp 2 Cmps
selection: S := cmp:subs
aggregation: v := min number(sc:asil)1</p>
        <p>sc2S
comparison: v number(cmp:asil)</p>
        <p>Rule 5 (WCET Single Core): The WCET of a component
instance is at most the WCET of its subcomponent instances.
checks: tag wcet of cmp 2 Cmps
selection: S := cmp:subs
aggregation: v := P sc:wcet</p>
        <p>csmc2pS:wcet
comparison: v</p>
        <p>Rule 6 (WCET Multi Core): The WCET of a component
instance is at most the maximum of the WCET of parallel
executable direct subcomponent paths.</p>
        <p>checks: tag wcet of cmp 2 Cmps
selection: S := directSubCmpP aths(cmp) 2
aggregation: v := max P elem:wcet</p>
        <p>path2S elem2path
comparison: v cmp:wcet</p>
        <p>
          Note that our framework does not limit the selection,
aggregation, and comparison operators in any way. Our previous
paper [
          <xref ref-type="bibr" rid="ref12">12</xref>
          ] contains more examples with different and more
complicated operators.
        </p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>IV. OCL FRAMEWORK FOR C&amp;C MODELS</title>
      <p>This section presents our first contribution: a C&amp;C-specific
extension of OCL.</p>
      <p>
        We start with an example. The top part in Fig. 3 presents
an OCL invariant expressing that the source and target
ports of a connector have the same data type (l. 3).
Typically, OCL constraints are written against a concrete
metamodel; this, however, makes the OCL constraints
dependent on a specific language implementation. As an
example, our C&amp;C language implementation MontiArc
provides references to all connectors in a C&amp;C model by:
List&lt;ConnectorSymbol&gt; connectors =
globalScope.resolve(ConnectorSymbol.KIND) [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ]. A
1QM = 0, ASIL A = 1, ASIL B = 2, ASIL C = 3, ASIL D = 4
2directSubCmpPaths(cmp) computes the set of all paths from a
subcomponent of cmp to an output port of cmp.
1 import CnCExt;
2 ocl ruleConnectorSamePortType {
3 context Con con inv: con.src.type == con.tgt.type }
CnCExt.conf
5import de.monticore.lang.montiarc._symboltable.*;
6import static de. … .montiarc.helper.GraphFunctions.*;
7rewrite "Con" -&gt; "ConnectorSymbol";
8rewrite "src" -&gt; "getSourcePort()";
9rewrite "tgt" -&gt; "getTargetPort()";
10rewrite "type" -&gt; "getType()";
11…
language-implementation-specific OCL constraint would
reference the type ConnectorSymbol in Fig. 3, l. 3 rather
than the general C&amp;C type Con from Def. 1.
      </p>
      <p>To address this problem, we decided to extend our OCL
implementation to support importing of configuration files. A
configuration file serves as a bridge from the mathematical
definitions to the implementation-specific classes.
Configuration files contain rewrite rules that rewrite names of C&amp;C
elements from Def. 1 and Def. 2 to implementation-specific
OCL expressions. This concept is generic and extensible
to multiple target implementations. The C&amp;C model OCL
constraints can be reused with different C&amp;C meta-models
as long all rewrite rules can be expressed using corresponding
meta-model-specific OCL expressions.</p>
      <p>The bottom part in Fig. 3 shows an excerpt of our
MontiArc specific configuration file, which provides C&amp;C
specific functions in OCL constraints. It imports all required,
implementation-specific Java classes (Fig. 3, bottom, l. 5)
and contains rewrite rules (ll.7-10), similar to C
preprocessor’s #define macros, to map C&amp;C domain names to
implementation-specific names. In addition to rewrite rules, the
configuration file imports and provides graph functions (Fig. 3,
bottom, l. 6) with C&amp;C specific method implementations. For
example, the function paths computes all C&amp;C elements
(components, ports, and connectors) on a path connecting
an input to an output port. As another example, these graph
functions can easily express the OCL invariant that each output
port depends on at least one input port.</p>
      <p>The complete configuration file for rewriting C&amp;C concepts
into MontiArc concepts consists of 11 rewrite rules and
imports 12 helper functions for use in C&amp;C model specific
constraints. There are two kinds of helper functions. The first
kind consists of graph-based functions that return a graph or
chains of C&amp;C elements connected (directly or indirectly) by
two given C&amp;C elements; they come in different versions to
return only specific C&amp;C elements (e.g., only components, or
only components and ports), to avoid creating large graphs
with unnecessary elements and accelerate the verification
process. The second kind of helper functions are mathematical
helper functions for EFPs such as min, max, sum, prod,
union, or intersection.
1import CnCExt;
2import EFPExt;
3ocl ruleInstPower {
4 context Cmp cmp inv: // checks: ∈
5 let
6 selectedValue = cmp.CType; // selection: ≔ ( ) ∈
7 aggregatedValue = max(cmp.power, 0W);// aggregation: ≔ .
8 in consider maximum value of the power tags, and “0W” if power tag is missing
109 agmgirne(gsaetleedcVtaelduVeal&lt;u=e.power,+ooW); } // comparison: ≤ .
Fig. 4: OCL constraint for instantiation consistency of EFP power (Rule 1)
1// positive witness for checking: shows if positive or negative witness
2// ocl "ruleInstPower.ocl" on model "WBalloonSens.ma"
34/c/omapgognreengtatWeBdalvlaolouneSeinns m{odel: 2 W aggregateducsoveamfluuplelefsox,r
5 component GPS { /* tags power = 2500 mW] */ } calculations
6 component GPS gps1 /* tags power = 2 W */ ; }
eavnadluCa&amp;teCdmOoCdLelconstraint pwriitnnteesdswisitha avlalltidagCs&amp;uCsemdoindethl,e aggregation</p>
    </sec>
    <sec id="sec-5">
      <title>V. DEFINING EFP CONSTRAINTS IN OCL</title>
      <p>
        This section presents our second contribution: extending
OCL with support for measurement units in order to allow
modeling of EFP consistency constraints in OCL and to
automatically generate witnesses for OCL constraint consistency
or inconsistency. The OCL constraints follow the selection,
aggregation, and comparison structure of EFP value consistency
rules (Def. 3) we introduced in [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ].
      </p>
      <p>We structure this section by examples presenting different
features of our OCL framework. The examples we show are an
OCL constraint for InstPower (Rule 1) with a generated
positive witness, an OCL constraint for CompPower (Rule 3) with
a generated negative witness, and finally an OCL constraint
for WCET Multi Core (Rule 6), which is the most complex
example based on connection properties of C&amp;C models.</p>
      <sec id="sec-5-1">
        <title>A. Example: Power Consumption for Component Instantiation</title>
        <p>Fig. 4 shows the complete OCL code for instantiation
consistency of EFP power (Rule 1). Lines 1 and 2 import the
configuration files for C&amp;C specific extensions (see Sect. IV
above) as well as for EFP extensions containing special helper
functions (such as min, max, or sum) with units as
parameters. Including the configuration file EFPExt.conf ensures
that all OCL constraints follow the structure of Def. 3 with
a check (Fig. 4, l. 4), selection (selectedValue in Fig. 4,
l. 6), aggregation (aggregatedValue in Fig. 4, l. 7), and
a comparison (Fig. 4, ll. 9-10) element. Component instances
without power tags are assigned the value 0W (Fig. 4, l. 7) and
component type definitions without power tags are assigned
the value +ooW (Fig. 4, l. 10). These interpretations are up to
the engineers defining the consistency rule.</p>
        <p>All components in our example C&amp;C model in Fig. 1
satisfy the OCL constraint from Fig. 4. In case of satisfaction
our tool can generate a positive witness. Fig. 5 shows a
(textual) positive witness that component gps1 satisfies the
OCL constraint from Fig. 4: its power consumption is below
the power consumption of its type GPS. Note that our OCL
engine automatically uses the correct interpretation of the
different units mW in tag of GPS and W in tag of gps1.</p>
        <p>The witness is meant to help the engineer in understanding
the reasons for consistency. It contains the checked C&amp;C
element, i.e., component instance gps1 (Fig. 5, l. 6), the
selected elements to check against, i.e., component type GPS
(l. 5), and all EFP tags used for the computation of the
aggregated value (l. 3) and in the comparison step.</p>
        <p>Witness generation is completely automated for the
satisfaction or violation of consistency rules. Our tool relies on the
structure of the OCL constraints following Def. 3 to construct
meaningful witnesses. Concretely, the witnesses contain the
checked element (context of OCL invariant), the elements
selected for comparison (OCL variable selectedValue(s),
or selectedPaths), all EFP tags appearing in the
aggregation (computation of OCL variable aggregatedValue(s)),
and all EFP tags appearing in the final comparison. To further
demonstrate satisfaction or violation, the aggregated value is
shown within the witness.</p>
      </sec>
      <sec id="sec-5-2">
        <title>B. Example: Power Consumption for Component Definitions</title>
        <p>Fig. 6 shows the complete OCL code for composition
consistency of EFP value power (Rule 3).</p>
        <p>Our running example does not satisfy the consistency rule
in Fig. 6, and a negative witness is generated for component
type definition WBalloonSens. The graphical representation
of the generated negative witness in Fig. 7 shows the reason for
inconsistency: the aggregated value of 5.41 W (400mW +
2500mW + 2500mW + 10mW ) is greater than the power
tag value of component type definition WBalloonSens.</p>
      </sec>
      <sec id="sec-5-3">
        <title>C. Example: Worst-Case Execution Time</title>
        <p>Fig. 8 shows the complete OCL code for composition
consistency of EFP value wcet (Rule 6, multi core).</p>
        <p>The OCL variable selectedPaths in l. 6 stores a list
of paths, which are lists of subcomponents. For each path in
the list, ll. 7-9 calculate the WCET value by summation of the
values on the path, and ll. 11-12 compare each value in the list
against the WCET value of the parent component. Storing the
list instead of the maximal value in the aggregatedValues
variable makes generated witnesses easier to understand:
witnesses will contain all paths instead of only one value.</p>
        <p>The positive witness that component wBalloonSens
satisfies the OCL constraint of Fig. 8 contains the following
selectedPaths with their aggregatedValues:
wBalloonSens ! controller ! wBalloonSens with
50ms 2s
temp!controller!wBalloonSens with 550ms 2s
gps1!controller!wBalloonSens with 1000ms 2s
gps2!controller!wBalloonSens with 800ms 2s</p>
      </sec>
    </sec>
    <sec id="sec-6">
      <title>VI. IMPLEMENTATION</title>
      <p>
        Our consistency verification tool takes a textual MontiArc
C&amp;C model, EFP tag files tagging the C&amp;C model, and an
OCL constraint as input. The verification process is fully
automated and consists of the following steps: (1) process the
textual model (parsing text to an AST and creating symbol
table) using the MontiCore framework [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ]; (2) process the
textual OCL constraint; (3) execute all rewrite rules of all
imported configuration files; (4) generate Java code from the
OCL constraint based on the AST and symbol table; and (5)
execute the generated Java code to check the C&amp;C model for
consistency and to generate witnesses.
      </p>
      <p>One challenge for implementing the generation of Java code
from OCL was that while OCL is a type-less language, Java
requires types for every declaration. Our generator infers the
variable types from OCL by looking up the return types of
invoked functions and propagating these types through nested
List constructs (e.g., ll. 7-9 in Fig. 8).</p>
      <p>
        Another challenge was adding a unit concept to OCL.
Many EFPs contain values with measurement units. Thus
we developed an additional language SIUnit, which our
OCL implementation extends. SIUnit is capable of parsing
imperial, SI, and unofficial SI units [
        <xref ref-type="bibr" rid="ref26">26</xref>
        ] with metric prefixes
and derived constructs, e.g., 28:2km=h and 9:81m s 2. It
supports additional symbols for plus and minus infinity. For
unit conversions we use the JScience framework.
      </p>
    </sec>
    <sec id="sec-7">
      <title>VII. CASE STUDY ON ADAS In our case study we want to evaluate the following two research questions:</title>
      <p>RQ1 Does our framework scale to large industry provided</p>
      <p>C&amp;C models?
RQ2 Which steps of automated EFP value consistency
checking are most time consuming?</p>
      <sec id="sec-7-1">
        <title>A. Case Study Data:</title>
        <p>
          For our case study we used a C&amp;C model of an
Autonomous Driver Assistance System (ADAS) provided by
Daimler AG. The available model did not contain EFP values.
Therefore, we derived values for EFP wcet and power tags
from reference materials and by evaluation as follows. To
approximate realistic EFP values for wcet, we have translated
the Simulink models to C-Code, compile this C-Code to
assembler code for a 16-bit Infineon C166 processor, and
calculated WCETs based on the assembler instructions and
the chip’s official documentation [
          <xref ref-type="bibr" rid="ref23">23</xref>
          ]. To approximate realistic
EFP values for power, we followed [
          <xref ref-type="bibr" rid="ref15">15</xref>
          ] to estimate power
consumption based on the assembly operations. The complete
ADAS model contains 1,396 components, 4,438 ports, and
2,738 EFP values.
        </p>
      </sec>
      <sec id="sec-7-2">
        <title>B. Execution:</title>
        <p>We executed all tests on an ordinary computer with
Windows 7 64-bit OS, an Intel Core i5-4590 CPU with four cores,
no hyperthreading and 3.3 GHz base frequency, and 8 GB
RAM. First, we checked the consistency constraints defined
in Sect. V against a small, stripped down version of the
ADAS model, which consists of 119 components and 366 port
instances, enriched with 238 EFP values. Second, we checked
the consistency constraints against the complete ADAS
model, which consists of 1,396 components and 4,438 port
instances, enriched with 2,738 EFP values. These model sizes
and numbers of EFP values show the necessity for automatic
consistency checks.</p>
      </sec>
      <sec id="sec-7-3">
        <title>C. Results:</title>
        <p>Table I shows running times in seconds for each EFP type
checked (Rule 1 to Rule 6) and selected C&amp;C model (small
and complete). A close inspection of running times reveals
that each C&amp;C model is loaded in 1.6-3.2s, depending on
its size; running time for parsing the short OCL constraints
is longer due to parser backtracking for nested mathematical
expressions and varies between 3-34s, transforming them into
executable code (this includes rewriting and type inference)
needs less than 1s. Then, the actual execution of the
verification code, i.e., checking the 119 or 1,396 components,
and witness generation, ranges from 0.1s for single-value
aggregations to 183s for nested lists aggregations.</p>
        <p>This leads us to the following answers to our research
questions. (RQ1) We can automatically verify the consistency of
EFP values of an industrial sized model in reasonable running
times. (RQ2) It is interesting to see that OCL processing times
and running times for verification and witness generation are
consuming most of the time. However, the OCL processing
step for code generation has to be executed only once (and
every time a consistency rule changes). Finally, one may
separate verification from witness generation in order to speed
up consistency checking when witnesses are not required.</p>
        <p>For inspection and further research we make all mentioned
C&amp;C models and OCL constraints used in our case study
available at:
http://www.se-rwth.de/materials/OCLVerifyTool4CnCEFP.zip</p>
      </sec>
    </sec>
    <sec id="sec-8">
      <title>VIII. RELATED WORK</title>
      <p>
        Acme [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] allows one to specify first-order predicates on the
structure of architectures, dealing, e.g., with connectedness of
components. Our extension of OCL for C&amp;C models provides
similar features. However, to the best of our knowledge the
constraint language of Acme does not support EFPs.
      </p>
      <p>
        Grunske [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] presents an evaluation framework for EFPs,
consisting of four elements. We focus on defining and
checking consistency rules rather than on evaluation of EFPs.
Nevertheless, Grunske [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ] also observed the need for a general
language to formulate evaluation of different EFP types.
      </p>
      <p>
        Sentilles et al. [
        <xref ref-type="bibr" rid="ref21">21</xref>
        ] present a meta-model for integrating
non-functional properties into C&amp;C models. They focus on
handling multiple EFPs for the same entity and did not
implement rules for EFP consistency.
      </p>
      <p>
        Cicchetti et al. [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] introduce a framework for evolution
of EFP values and present, as an example, how the change
of the WCET of a component requires updating the WCET
of its parent component. To define validity conditions, they
use the Epsilon Validation Language [
        <xref ref-type="bibr" rid="ref27">27</xref>
        ], which is similar to
OCL. It is possible to extend our framework to support similar
evolution scenarios.
      </p>
      <p>
        Leveque and Sentilles [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ] present refinement of EFPs
through instantiation and subtyping of components. Engineers
can use OCL constraints to filter EFP attributes of components.
The OCL constraints are written against the meta-model of the
C&amp;C implementation. We use C&amp;C-specific OCL constraints
to define consistency rules beyond component EFP refinement.
      </p>
      <p>
        Finally, Sapienza et al. [
        <xref ref-type="bibr" rid="ref20">20</xref>
        ] present EFP consistency rules
for component composition. The tools used in [
        <xref ref-type="bibr" rid="ref20">20</xref>
        ] and a
related case study [
        <xref ref-type="bibr" rid="ref22">22</xref>
        ] go beyond information stored with
model elements, e.g., they measure EFP values by simulation.
It is unclear whether their approach can be easily extended to
additional or alternative EFP constraints.
      </p>
    </sec>
    <sec id="sec-9">
      <title>IX. CONCLUSION</title>
      <p>We presented an OCL framework and tool for the
description and verification of consistency rules of EFPs in C&amp;C
models. The work includes a C&amp;C-specific extension of OCL
with native support for measurement units, and an automatic
mechanism for verifying consistency and producing witnesses
for EFP consistency checking results. We implemented the
approach within the MontiCore framework for the C&amp;C
modeling language MontiArc. Our initial evaluation on an industrial
sized model shows that it is expressive and scales to large C&amp;C
models. Our framework works for comparable extra-functional
properties, these include quantitative properties (e.g.,
worstcase execution time, power, or memory consumption) and
qualitative properties (e.g., traceability, portability flags, ASIL
security, or encryption levels).</p>
      <p>Acknowledgements This research was supported by a Grant
from the GIF, the German-Israeli Foundation for Scientific
Research and Development.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>J. P.</given-names>
            <surname>Cavano</surname>
          </string-name>
          and
          <string-name>
            <given-names>J. A.</given-names>
            <surname>McCall</surname>
          </string-name>
          .
          <article-title>A framework for the measurement of software quality</article-title>
          .
          <source>SIGSOFT Softw. Eng. Notes</source>
          ,
          <volume>3</volume>
          (
          <issue>5</issue>
          ),
          <year>1978</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>A.</given-names>
            <surname>Cicchetti</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Ciccozzi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>T.</given-names>
            <surname>Leveque</surname>
          </string-name>
          , and
          <string-name>
            <given-names>S.</given-names>
            <surname>Sentilles</surname>
          </string-name>
          .
          <article-title>Evolution management of extra-functional properties in component-based embedded systems</article-title>
          .
          <source>In CBSE</source>
          ,
          <year>2011</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>P. H.</given-names>
            <surname>Feiler</surname>
          </string-name>
          and
          <string-name>
            <given-names>D. P.</given-names>
            <surname>Gluch</surname>
          </string-name>
          .
          <article-title>Model-Based Engineering with AADL: An Introduction to the SAE Architecture Analysis</article-title>
          &amp;
          <string-name>
            <given-names>Design</given-names>
            <surname>Language. Addison-Wesley</surname>
          </string-name>
          ,
          <year>2012</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>D.</given-names>
            <surname>Garlan</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R. T.</given-names>
            <surname>Monroe</surname>
          </string-name>
          , and
          <string-name>
            <given-names>D.</given-names>
            <surname>Wile</surname>
          </string-name>
          . Acme:
          <article-title>An architecture description interchange language</article-title>
          .
          <source>In CASCON</source>
          ,
          <year>1997</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>D.</given-names>
            <surname>Garlan</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R. T.</given-names>
            <surname>Monroe</surname>
          </string-name>
          , and
          <string-name>
            <given-names>D.</given-names>
            <surname>Wile</surname>
          </string-name>
          . Acme:
          <article-title>Architectural description of component-based systems</article-title>
          .
          <source>In Foundations of Component-Based Systems</source>
          . Cambridge University Press,
          <year>2000</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>L.</given-names>
            <surname>Grunske</surname>
          </string-name>
          .
          <article-title>Early quality prediction of component-based systems - A generic framework</article-title>
          .
          <source>Journal of Systems and Software</source>
          ,
          <volume>80</volume>
          (
          <issue>5</issue>
          ),
          <year>2007</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>A.</given-names>
            <surname>Haber</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J. O.</given-names>
            <surname>Ringert</surname>
          </string-name>
          , and
          <string-name>
            <given-names>B.</given-names>
            <surname>Rumpe. MontiArc - Architectural Modeling</surname>
          </string-name>
          of Interactive Distributed and
          <string-name>
            <surname>Cyber-Physical Systems</surname>
          </string-name>
          .
          <source>Technical Report AIB-2012-03</source>
          , RWTH Aachen, february
          <year>2012</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>F.</given-names>
            <surname>Huber</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Schätz</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Schmidt</surname>
          </string-name>
          , and
          <string-name>
            <given-names>K.</given-names>
            <surname>Spies</surname>
          </string-name>
          .
          <article-title>Autofocus: A tool for distributed systems specification</article-title>
          .
          <source>In FTRTFT</source>
          ,
          <year>1996</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>H.</given-names>
            <surname>Krahn</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Rumpe</surname>
          </string-name>
          , and
          <string-name>
            <given-names>S.</given-names>
            <surname>Völkel</surname>
          </string-name>
          .
          <article-title>Monticore: a framework for compositional development of domain specific languages</article-title>
          .
          <source>In STTT</source>
          , volume
          <volume>12</volume>
          ,
          <year>2010</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>T.</given-names>
            <surname>Leveque</surname>
          </string-name>
          and
          <string-name>
            <given-names>S.</given-names>
            <surname>Sentilles</surname>
          </string-name>
          .
          <article-title>Refining extra-functional property values in hierarchical component models</article-title>
          .
          <source>In CBSE</source>
          ,
          <year>2011</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <given-names>S.</given-names>
            <surname>Maoz</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J. O.</given-names>
            <surname>Ringert</surname>
          </string-name>
          , and
          <string-name>
            <given-names>B.</given-names>
            <surname>Rumpe</surname>
          </string-name>
          .
          <article-title>Synthesis of component and connector models from crosscutting structural views</article-title>
          .
          <source>In FSE</source>
          ,
          <year>2013</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <given-names>S.</given-names>
            <surname>Maoz</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J. O.</given-names>
            <surname>Ringert</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Rumpe</surname>
          </string-name>
          , and M. von Wenckstern.
          <article-title>Consistent extra-functional properties tagging for component and connector models</article-title>
          .
          <source>In ModComp</source>
          ,
          <year>2016</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [13]
          <string-name>
            <given-names>N.</given-names>
            <surname>Medvidovic</surname>
          </string-name>
          and
          <string-name>
            <given-names>R.</given-names>
            <surname>Taylor</surname>
          </string-name>
          . A Classification and
          <article-title>Comparison Framework for Software Architecture Description Languages</article-title>
          .
          <source>IEEE Transactions on Software Engineering</source>
          ,
          <year>2000</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          [14]
          <string-name>
            <given-names>P.</given-names>
            <surname>Mir Seyed</surname>
          </string-name>
          <article-title>Nazari</article-title>
          .
          <source>MontiCore: Efficient Development of Composed Modeling Language Essentials. Shaker</source>
          ,
          <year>2017</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          [15]
          <string-name>
            <given-names>S.</given-names>
            <surname>Nikolaidis</surname>
          </string-name>
          ,
          <string-name>
            <given-names>N.</given-names>
            <surname>Kavvadias</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Neofotistos</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Kosmatopoulos</surname>
          </string-name>
          ,
          <string-name>
            <given-names>T.</given-names>
            <surname>Laopoulos</surname>
          </string-name>
          , and
          <string-name>
            <given-names>L.</given-names>
            <surname>Bisdounis</surname>
          </string-name>
          .
          <article-title>Instrumentation set-up for instruction level power modeling</article-title>
          .
          <source>In PATMOS</source>
          ,
          <year>2002</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          [16]
          <string-name>
            <given-names>A.</given-names>
            <surname>Rawashdeh</surname>
          </string-name>
          and
          <string-name>
            <given-names>B.</given-names>
            <surname>Matalkah</surname>
          </string-name>
          .
          <article-title>A new software quality model for evaluating COTS components</article-title>
          .
          <source>Journal of Computer Science</source>
          ,
          <volume>2</volume>
          (
          <issue>4</issue>
          ),
          <year>2006</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          [17]
          <string-name>
            <given-names>J. O.</given-names>
            <surname>Ringert</surname>
          </string-name>
          .
          <source>Analysis and Synthesis of Interactive Component and Connector Systems. Aachener Informatik-Berichte, Software Engineering, Band</source>
          <volume>19</volume>
          . Shaker Verlag,
          <year>2014</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          [18]
          <string-name>
            <given-names>G. C.</given-names>
            <surname>Roman</surname>
          </string-name>
          .
          <article-title>A taxonomy of current issues in requirements engineering</article-title>
          .
          <source>Computer</source>
          ,
          <volume>18</volume>
          (
          <issue>4</issue>
          ),
          <year>April 1985</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref19">
        <mixed-citation>
          [19]
          <string-name>
            <given-names>M.</given-names>
            <surname>Saadatmand</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Cicchetti</surname>
          </string-name>
          , and
          <string-name>
            <given-names>M.</given-names>
            <surname>Sjödin</surname>
          </string-name>
          .
          <article-title>UML-based modeling of non-functional requirements in telecommunication systems</article-title>
          .
          <source>In ICSEA</source>
          ,
          <year>2011</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref20">
        <mixed-citation>
          [20]
          <string-name>
            <given-names>G.</given-names>
            <surname>Sapienza</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Sentilles</surname>
          </string-name>
          ,
          <string-name>
            <surname>I. Crnkovic</surname>
          </string-name>
          , and
          <string-name>
            <given-names>T.</given-names>
            <surname>Seceleanu</surname>
          </string-name>
          .
          <article-title>Extra-functional properties composability for embedded systems partitioning</article-title>
          .
          <source>In CBSE</source>
          ,
          <year>2016</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref21">
        <mixed-citation>
          [21]
          <string-name>
            <given-names>S.</given-names>
            <surname>Sentilles</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Stepan</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Carlson</surname>
          </string-name>
          ,
          <string-name>
            <surname>and I. Crnkovic.</surname>
          </string-name>
          <article-title>Integration of extrafunctional properties in component models</article-title>
          .
          <source>In CBSE</source>
          ,
          <year>2009</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref22">
        <mixed-citation>
          [22]
          <string-name>
            <given-names>J.</given-names>
            <surname>Suryadevara</surname>
          </string-name>
          , G. Sapienza,
          <string-name>
            <given-names>C. C.</given-names>
            <surname>Seceleanu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>T.</given-names>
            <surname>Seceleanu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S. E.</given-names>
            <surname>Ellevseth</surname>
          </string-name>
          , and
          <string-name>
            <given-names>P.</given-names>
            <surname>Pettersson</surname>
          </string-name>
          .
          <article-title>Wind turbine system: An industrial case study in formal modeling and verification</article-title>
          .
          <source>In FTSCS</source>
          ,
          <year>2013</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref23">
        <mixed-citation>
          [23]
          <article-title>Infineon website</article-title>
          . https://www.infineon.
          <source>com. Retrieved</source>
          <volume>10</volume>
          /07/17.
        </mixed-citation>
      </ref>
      <ref id="ref24">
        <mixed-citation>
          [24]
          <string-name>
            <given-names>MathWorks</given-names>
            <surname>Simulink</surname>
          </string-name>
          . http://www.mathworks.com/products/simulink/.
        </mixed-citation>
      </ref>
      <ref id="ref25">
        <mixed-citation>
          [25]
          <string-name>
            <given-names>OMG</given-names>
            <surname>Object</surname>
          </string-name>
          <article-title>Constraint Language 2.4</article-title>
          . http://www.omg.org/spec/OCL/ 2.4/. Retrieved 10/07/17.
        </mixed-citation>
      </ref>
      <ref id="ref26">
        <mixed-citation>
          [26]
          <string-name>
            <given-names>SI</given-names>
            <surname>Units - Wikipedia</surname>
          </string-name>
          . https://en.wikipedia.org/wiki/International_ System_of_Units.
          <source>Retrieved</source>
          <volume>10</volume>
          /07/17.
        </mixed-citation>
      </ref>
      <ref id="ref27">
        <mixed-citation>
          [27]
          <article-title>The Epsilon Book</article-title>
          . http://www.eclipse.org/epsilon/doc/book/.
          <source>Retrieved</source>
          <volume>10</volume>
          /07/17.
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>