Modeling and Software for Automation 22.3 Reuse-Driven Software Development 371
22.2.4 Example: Software
for Autonomous Helicopter Project
The autonomous helicopter project of ETHZ [22.11]
is a typical example of a system where special lan-
guages were developed by Wirth and Sanvido for
several tasks of the onboard processor. The operat-
ing system uses threads instead of tasks [22.12]for
speed-up, the logic language Lola [22.13]isusedfor
the design of field-programmable gate arrays (FPGAs),
and the mission control language is used for mis-
sions. An excerpt from a program in the mission
control language is easily readable, as shown in
Fig.22.6.
The controller for the helicopter has also been im-
plemented in Giotto [22.14].
22.3 Reuse-Driven Software Development
22.3.1 The Product Family Approach
Within the reuse-driven paradigm, software product
families have emerged as the most successful form of
software reuse. A software product family [22.15]is
a set of applications that can be constructed from a set of
shared software assets. The shared assets can be seen as
generic building blocks from which applications in the
family can be built. Usually, a product family is aimed
at facilitating the instantiation of applications within
a narrow domain. Figure 22.7 illustrates the concept
of product family. On the left-hand side, the building
blocks offered by the product family are shown. These
building blocks are used during the family instantiation
process to construct a particular application within the
family domain.
Product families are characterized by two distinct
development processes (Fig. 22.8). In the family cre-
ation process, the family’s reusable assets are designed
and developed. In the family instantiation process,the
reusable assets offered by the family are used to con-
struct a specific application within the family domain.
The family creation process is in turn divided into
three phases. In the domain analysis phase,thesetof
applications that must be covered by the family are
identified and characterized. The output of this phase
is a domain model. In the domain design phase,the
reusable assets that are to support the instantiation of
applications within the family are designed. The output
of this phase is one or more models of the family as-
sets. The models express various aspects of the domain
design (e.g., there may be functional models, timing
models, etc.) In the domain implementation phase,the
family assets are implemented as concrete building
blocks that can be used towards the construction of fam-
ily applications.
Often, the implementation of the family assets is
done automatically by processing the models defined in
the domain design phase.
Three matching phases can be identified in the fam-
ily instantiation process (bottom half of Fig.22.8). In
the requirement definition phase, the family domain
model is used to verify whether the target application
falls within the family domain. This decides whether the
family assets can be used to help build the application.
If this is the case, a sizable proportion of the application
requirements can be expressed in terms of the domain
model, for instance by identifying the features in the
family domain that are needed by the target applica-
tion. In the tailoring phase, the software assets required
for the target application are selected from among those
PLAN Example;
VAR phi, theta, psi: REAL; LandOK*: BOOLEAN;
PROCEDURE LiftOff; (* TakeOff Procedure *)
BEGIN
ACCELERATE(1.0, 0.0, 0.0, 0.0, -0.5);
TRAVEL(9.0, 0.0, 0.0, 0.0, -0.5);
ACCELERATE(1.0, 0.0, 0.0, 0.0, 0.5);
END LiftOff;
PROCEDURE Hovering(time: REAL); (* Hovering Procedure *)
BEGIN
TRAVEL(time, 0.0, 0.0, 0.0, 0.0);
END Hovering;
PROCEDURE Landing; (* Landing Procedure *)
BEGIN
ACCELERATE(1.0, 0.0, 0.0, 0.0, 0.25);
TRAVEL(19.0, 0.0, 0.0, 0.0, 0.25);
ACCELERATE(1.0, 0.0, 0.0, 0.0, -0.25)
END Landing;
BEGIN
GETATTITUDE(phi, theta, psi);
LiftOff;
Hovering(3.0);
BROADCAST("READYTOLAND");
LandOK := FALSE;
WHILE ~LandOK DO SLEEP() END;
Landing
END Example.
Fig. 22.6 Code for helicopter control
Part C 22.3