not at this time able to publish a real world use case.
Harnessing. Including the signature in a subsystem
provides us with a “plug-in” interface to that subsys-
tem, in that signatures make it easy to attach various
things to subsystems. We can take advantage of this
when developing various kinds of harnesses for sub-
systems, e.g., testing, model-in-the-loop, and instru-
mentation. Importantly, the handling of the implicit
interface when developing a harness is significantly
improved.
There is a considerable lack of proper consider-
ation of implicit data flow in modern testing tools.
More precisely, when generating testing harnesses
for a subsystem, some testing tools neglect to mimic
data passed in/out of the subsystem by data store
reads/writes. We looked into two major commercial
automatic test generation tools
3
to explore cases when
a data store defined outside a subsystem is being read
from or written to in the subsystem. Both tools sup-
port subsystem extraction: a subsystem together with
its necessary execution context is extracted into a new
model, and tests can then be generated for the new
model. The two tools deal with data store reads and
data store writes in different ways. The first tool ex-
tracts the subsystem, and for both data store reads and
data store writes adds only definitions of data stores
(data store memory blocks) to the model, therefore
not taking into account the data flow through inherited
data stores. The other tool also adds the necessary
definitions to the extracted model, but does mimic the
data flow through a data store read: for a given data
store that is being read in the subsystem, an inport
is added that writes into the data store. Further, any
constraints being defined for the data store (minimum
and maximum values) are assigned to the new inport.
When it comes to a data store write, on the other hand,
this tool treats it similarly to a data store read: it adds
an inport that writes into the data store, and then ef-
fectively grounds this input in the generated test har-
ness.
The signature can address the lack of implicit
data flow consideration in test generation, since it ex-
plicitly presents the subsystem’s interface, therefore
clearly identifying implicit data flow in and out of the
subsystem so that it is not overlooked in test harness
generation. Therefore, the signature can be used for
an automatic test harness generation that would ac-
count for all the data passed through the subsystem.
One important note about harnessing using signatures
is that the harness is separated from the rest of the
subsystem, in that it appears entirely on the left-hand
3
Educational licensing terms of these tools do not allow
us to publish the names of the tools.
side. The main benefit of this is that the inclusion
of the harness does not obscure the actual subsystem,
and that in the case where we only have a harnessed
subsystem at our disposal it would be easy to remove
said harness to recover the original subsystem.
Also, adding the strong typing information to the
signature (as presented next in this section) further en-
hances testability: the typing information can be used
to focus test generation only to data of interest.
Typing. Inclusion of the signature in a subsystem
has another major benefit: we can use the patterns
presented in (Rau, 2002) to incorporate strong typing
into subsystems’ interfaces. By using masked sub-
systems or bus objects that ensure that signals are of
a particular type, Rau presents a set of design pat-
terns for Simulink that enforce types on a subsys-
tem’s ports. But there are obvious drawbacks to his
approach. First, the application of his design pat-
terns presents overhead for developers since they es-
sentially need to be programmed by hand. Second,
his typing only applies to the explicit interface of a
subsystem, i.e., its ports. By applying the essential
elements of his approach, attached to the signature as
opposed to included as a pattern, we can apply strong
typing to the implicit interface as well. Typing in this
manner is quite clean as well, as it is completely con-
tained within the signature and thus does not visually
affect the rest of the subsystem.
Behaviour Preservation. An obvious question
which arises when including signatures in a subsys-
tem is whether we have changed the behaviour of that
subsystem. To show that the behaviour has been pre-
served, we provide three arguments: first, by intuitive
analysis of data flow and control flow in the signature;
second, by using coverage testing to profile subsys-
tems before and after signature inclusion; and third,
by comparing the generated code before and after.
Our intuitive analysis follows (Sch
¨
afer et al.,
2009): if name-binding, control flow and data flow
are preserved, then we have a strong argument that be-
haviour has been preserved. By simply analyzing the
patterns in the signature, we can make a simple argu-
ment that we have not changed the behaviour of a sub-
system by including its signature. Ports are fed with
local froms and gotos; as long as we do not choose
conflicting names, these are just shorthand for directly
connected signals so they cannot change behaviour.
Data stores and scoped tags, whether they are inputs
or outputs, are just included in their “read” form (data
store read and scoped from respectively) and fed into
terminators. Here, we can make an easy argument
that data flow has not changed, but it is trickier to ar-
SignatureRequired-MakingSimulinkDataFlowandInterfacesExplicit
129