%%$Id: conclusions.tex,v 1.28 2004/12/31 17:00:18 schmidt Exp $

\section{Concluding Remarks}
\label{conclusions}

Model-driven development (MDD) of software engineering processes is
emerging as an effective paradigm for addressing the challenges of
distributed real-time and embedded (DRE) systems.  MDD is a software
development paradigm that systematically applies domain-specific
modeling languages to engineer computing systems.  It is therefore a
key step towards converting the {\em art of programming} into an {\em
engineering process} that will industrialize the software industry.

This chapter showed how we have integrated (1) CoSMIC, which is an MDD
toolsuite consisting of modeling, analysis, and synthesis tools that
address key lifecycle challenges of component-based DRE systems with
(2) Cadena, which is an MDD toolsuite for modeling and model checking
compo\-nent-based DRE systems.  We demonstrated how CoSMIC can
leveraged Cadena/\-Bogor's model checking and verification
capabilities to raise the reliability of component-based DRE systems
significantly, while also reducing development time and effort.  We
also showed how the capabilities provided by CoSMIC and Cadena are
complementary and can help developers of component-based DRE system
middleware and applications view and analyze models from different
perspectives.

The novelty of our approach focuses on exchanging a minimal set of
data between interacting tools, namely the common subset of properties
captured by the tools.  Modifications on a project made by CoSMIC
tools can thus be transferred to Cadena tools and merged into the
model document of the destination tools and vice versa.  Modifications
performed on properties captured uniquely by CoSMIC tools need not be
transferred to Cadena tools and vice versa.  Depending on the tools
being integrated, the merging of modifications into a tool's model
document can be performed automatically by semantic translators (which
keep state in this case) or tool adapters (which can access the
internal state of the tool).  In either case, our general approach can
greatly simplify the integration of various external MDD tools, {\em
e.g.}, to provide model checking, schedulability, and stability
analysis.

Section~\ref{approach} describes a graph diff-merge algorithm that
transfers modifications into a destination tool's model document and
semantic translators that convert between the formats understood by
various CoSMIC and Cadena MDD tools.  Graph transformation is used to
define algorithms for semantic translation and merging directly at the
metamodel level, {\em i.e.}, at a higher level of abstraction than
provided by third-generation programming languages.  This approach (1)
reduces the time needed to develop semantic translators, compared with
manually writing a backtracking engine to match entire graphs, (2)
reduces sporadic and hard-to-track errors that stem from manually
manipulating pointers, allocate resources, and handling exceptions,
and (3) increases the readability and maintainability of the
algorithms, compared with conventional hand-written code in
third-generation languages.

The lessons learned by applying our integrated CoSMIC and Cadena
toolsuite to the robot assembly case study described in
Section~\ref{casestudy} illustrated that:
\begin{itemize}%\crunchlist
\item Not every MDD tool offers the same capabilities, but a
collection of these is needed to develop DRE systems, which is why
interoperability between the tools is necessary.  For example, CoSMIC
and Cadena have different modeling capabilities and validation
functionalities that we combined to provide a broader range of
capabilities for DRE system developers.

\item Although partial, user-assisted interoperability is easier to
realize, it does not prevent human mistakes when exporting model
documents from one tool and importing them into another.  It is
therefore essential to automate the communication process as much as
possible to ensure consistency.  For example, our use of the Open Tool
Integration Framework (OTIF)~\cite{OTIF} helped minimize the number of
steps needed for users to transfer the robot assembly project between
the CoSMIC and Cadena tools.  We also carefully crafted the graph
diff-merge algorithm to avoid manual replication of information.

\item Bidirectional communication among MDD tools is the most
effective way to enable users to edit models locally on whichever tool
is in use, while maintaining the ability to transfer changes to other
tools automatically, thus enhancing consistency.  For example, when
developing the communication between CoSMIC and Cadena, we allowed
developers to use the tools in any semantically valid order, and did
not constrain the actions that could be performed while working with
any compatible tools.

\item When achieving tool integration, key issues to consider are the
communication model, data interchange format, and algorithms for
lossless data transforms.  Our CoSMIC$\leftrightarrow$Cadena
integration focused on these three points and applied tools that could
help reduce our development time.  For example, we used OTIF to
provide communication features, document storage on the backplane, and
automatic notification of availability of new documents to connected
tools.  We used XML/UDM to interchange the syntactic and semantic
formats of CoSMIC and Cadena model documents.  We used GReAT for our
graph diff-merge algorithms to reduce development time and
detect/merge variations of graph-based data formats.  These tools
allowed us to complete our robot assembly development and validation
tasks correctly in a relatively short time.

\item Complex transformation algorithms become more manageable when
working at the meta-level.  In particular, several hundred
well-structured graphical transformation rules are faster to write and
easier to read and maintain than thousands of lines of equivalent C++
code.  For example, we leveraged the GReAT tool to graphically define
graph transformations.

\item To define transformations at the meta level requires access to
the metamodels (represented as graph structures) of both the source
and destination semantic formats.  If any of such metamodels are not
available, an alternative is to use an XML format defined with a UML
diagram ({\em i.e.}, the {\em metamodel}) acting as a proxy for the
source or destination format.  For example, the metamodel of Cadena
internal document format was not available, so we used GME to define
an XML representation of it in UML.  We could then use GReAT to define
transformations between the CoSMIC metamodel and the newly defined XML
format, the latter acting as a proxy for Cadena format.

\item The message flow in our robot assembly case study is largely
asynchronous and most communication is performed via events, though
some callbacks are performed via invocations on facet operations.  It
is hard to recognize this message flow from the production sequence
diagram in Figure~\ref{fig:robot_prod_seq}, but MDD tools, such as
PICML in CoSMIC and the Cadena's Scenario graphical view, can show
which communications are performed through event emissions and which
are invocation on operations.  MDD tools also enable more efficient
browsing through components and interfaces to indicate visually which
data types are exchanged.

\item Behavioral specifications of components can be used to perform
dependency checks and stability analysis in a component-based
distributed application.  Underspecifying the behavior of such
components might prevent a complete validation, as happened with the
connection of circle analysis port in our robot assembly application.

\item When solving new problems, the time needed to learn new MDD
tools appropriate for the solution must be considered.  For example,
we used GME interpreters, GReAT, UDM, and OTIF for our robot assembly
application.  Acquiring expertise with these tools occupied roughly
one third of the total development time.  It is therefore essential to
factor the time and effort needed to learn multiple MDDs tools to
avoid underestimating overall development costs.
\end{itemize}

