You are on page 1of 5

An Aspect-Oriented Approach for Dealing with Non-Functional Requirements

in a Model-Driven Development of Distributed Embedded Real-Time Systems

Marco A. Wehrmeister1, Edison P. Freitas1, Carlos E. Pereira1,2, Flvio R. Wagner1


1
Instituto de Informtica, 2Dep. Engenharia Eltrica UFRGS Brazil
{mawehrmeister, epfreitas, flavio}@inf.ufrgs.br, cpereira@ece.ufrgs.br

Abstract programming [3]; and in the early phases of the design,


This work presents a proposal to use aspect orientation in such as in the Early-Aspects [4] approach.
the analysis and design of Distributed Embedded Real-time Real-time systems have a very important NFR which
Systems (DERTS). These systems have several requirements is the concern about timing aspects, such as deadlines,
directly related to their main characteristics, the so-called maximum jitter, worst case execution time, maximum
Non-Functional Requirements (NFR), which refer to tolerated delays, and others. The complexity related to
orthogonal properties, conditions, and restrictions that are
the analysis of NFR increases when these systems
spread out over the entire system. Pure object-oriented
methods do not address successfully those so called cross-
become distributed and embedded. Some proposals
cutting concerns, so new technologies, like aspect orientation, suggest the use of aspects, as in [5] and [6]. Aspects can
are applied in order to fulfill this gap. The paper presents help to deal with crosscutting NFR into DERTS design
DERAF - Distributed Embedded Real-time Aspects by modularizing their handling. Additionally, more
Framework, an extensible and high-level framework (i.e. abstract aspects are easily reused because they define the
implementation-independent) to handle NFR of DERTS at handling of a concern at high-level and also how it can
earlier design stages. DERAF combines the use of aspects with be applied (or how it affects) the system without
RT-UML, aiming to separate the handling of non-functional implementation or platform constraints.
from functional requirements in the Model Driven Design of
This work presents the Distributed Embedded Real-
DERTS. The paper presents the use of DERAF on a case study
of an unmanned air vehicle (UAV).
time Aspects Framework (DERAF), which provides an
extensible set of aspects to deal with NFR of DERTS at a
1. Introduction high-level of abstraction, that is, a set of implementation-
independent aspects1 to handle NFR during the creation
Embedded real-time systems have become very
of RT-UML2 models at design phase. In its initial
complex, requiring the distribution of functionalities into
version, DERAF handles the following NFR (see Section
different processing units approximating services to the
2): timing, precision, performance, distribution, and
location where they are demanded (e.g. deploying
embedded behavior. However, DERAF is an extensible
sensing and control tasks of each helicopter rotating wing
framework, such that it can be extended to provide
into small processors instead of grouping them into a
support to other important aspects (e.g. fault-tolerance).
more powerful processor), without violating system
It is important to highlight that, in spite of the high-level
constraints. This feature characterizes the Distributed
of abstraction, aspects within DERAF must be
Embedded Real-Time Systems (DERTS).
implementable. On other words, the realization of each
The increasing complexity of DERTS requires new
aspect must be possible, avoiding unfeasible aspects.
development techniques in order to better support system
The remaining of this paper is organized as follows.
evolution and maintainability, and the reuse of
Section 2 discusses the handling of NFR within DERTS
previously developed artifacts. DERTS have concerns
design, presenting an aspects framework to handle the
that affect distinct parts of the system, the so-called
identified NFR. Section 3 depicts how to design DERTS
crosscutting concerns. Non-Functional Requirements
using the presented framework illustrated by a case
(NFR) must be carefully handled, in order to avoid
study. Section 4 discusses related work, and final
tangled code and loss of cohesion. The separation of
remarks and future work are presented in Section 5.
concerns, where crosscutting concerns are identified as
NFR, is addressed by some works such as [1], [4] and
[6]. Thus some guidelines are proposed in order to
separate the handling of NFR from the functional ones: 1
This idea of implementation-independent aspects to design DERTS
at implementation level, using concepts such as subject- was inspired by the context-free aspects as proposed in [9].
2
oriented programming [2] and aspect-oriented The term RT-UML is used to identify UML [10] models annotated
with the real-time profile [11].
2. Handling Non-Functional Requirements elements will be affected by selected aspects. The set of
aspects available in DERAF is depicted in Fig. 2.
Fig. 1 presents NFR related to DERTS development
handled in this work. This classification is based on the <<Non-Functional>>
Timing
<<Non-Functional>>
Precision
study presented in [14], on the IEEE glossary [15] , and <<Aspect>>
<<Aspect>>
<<Aspect>> <<Aspect>>
TimingAttributes <<use>> PeriodicTiming Jitter DataFreshness
on the SEI glossary [16].
<<Aspect>> <<Aspect>>
Deadline <<Aspect>>
<<use>> <<use>>
ToleratedDelay ClockDrift
Period TimeBoundedActivity <<Aspect>>
SchedulingSupport
Timing Cost
Release Time
Activation Latency
Start and End <<Non-Functional>> <<Non-Functional>>
Time Synchronization Communication
Jitter <<use>> <<use>> <<Aspect>>
Tolerated Delay <<Aspect>> MessageAck <<Aspect>>
Laxity ConcurrentAccessControl MessageCompression
Precision Freshness <<use>>
<<use>>
Non-Functional Resolution <<Aspect>> <<Aspect>>
MessageSynchronization
Drift MessageIntegrity
Requirements
Performance Response Time
Throughtput <<Non-Functional>>
Task Alocation Embedded <<Non-Functional>>
TaskAllocation
Hosts <<Aspect>> <<Aspect>>
Distribution Communication HwAreaMonitoring <<use>> HwAreaControl <<use>>
<<Aspect>>
Synchronization <<use>>
TaskMigration
<<Aspect>> <<use>> <<Aspect>>
Area EnergyMonitoring EnergyControl
Power Consumption <<use>>
Embedded Total Energy <<Aspect>> <<Aspect>>
<<Aspect>>
<<use>> NodeStatusRetrieval
Memory Allocation MemoryUsageMonitoring MemoryUsageControl

Generic Specific
Fig. 2 DERAF aspects set to handle NFR
Fig. 1 NFR classification for DERTS
Due to paper lengths limitations a detailed
Each NFR can be handled by one or more aspects,
explanation of each NFR is omitted. Time classification
such as the TimmingAttributes and PeriodicTiming
defines requirements related to temporal constraints of
aspects, which add timing attributes to active objects3
system activities. Performance requirements are tightly
(e.g. deadline, priority, start/end time, and so on), as well
related to those presented in the Time and Distributed
as adapt their behavior (e.g. adding code to control the
classification. They express a global need of
frequency of periodic execution of a task). There are
performance, such as end-to-end response time for a
aspects which adapts the way of an activity executes,
certain activity, as well as a required throughput rate.
such as DataFreshness and ConcurrentAccessControl.
Distribution classification defines requirements related to
The former associates timestamps to data, verifying their
the distribution of DERTS activities in different nodes.
validity before they are used[12], while the last one adds
Concerns related to embedded systems generally present
a control mechanism to the concurrent access of shared
requirements/constraints related to memory usage,
resources. However, DERAF aspects can also be used to
energy consumption, and required hardware area size.
setup configurable platforms, such as Message-related
To support the handling of NFR from earlier
aspects, which can be used to configure a communication
development stages on, DERAF, an extensible high-level
API with features like acknowledge message,
aspects framework based on the aspect orientation
compression and integrity checking. Aspects in the
conceptual model proposed in [20], is proposed. DERAF
embedded package deal are related to monitoring and
aims provide a modularized way to handle NFR,
controlling features such as energy consumption,
improving the reuse of aspects in different DERTS
memory and FPGA area usage. Nevertheless, these
projects. A detailed discussion on aspect-oriented
features must be supported by the target Hw and/or Sw
concepts is out of the scope of this paper and can be
platform.
found in [3], [7] and [20].
After the modeling phase, aspects must be
The main idea behind DERAF is to provide aspects
implemented through either application or platform4
which adapt modeled system elements by adding specific
code. Thus each DERAF aspect is linked to an
behavior and structure to handle NFR, without binding
implementation technology. The semantics of how and
the DERTS model to a specific solution (e.g. an
where each aspect affects system elements are defined
implementation for cyclical activation of periodic tasks).
at high-level and must be preserved, such that every
To ensure implementation independence, details related
to aspect adaptations are abstracted. This means that the 3
Active objects have their own thread of control and execute
designer selects aspects based on how the aspect concurrently with other active objects [10][11].
4
improves the system elements, and defines which According [13], platform is a set of previously developed and tested
hardware and software components that can be configured and reuse
implementation must follow these semantics in order to
allow the reuse of previously developed aspects
implementation Sometimes, it is also interesting to
evaluate the impact of the aspects implementation into
the design at the modeling phase. Therefore, it is
necessary to provide models to describe how each aspect
implementation affects the original specification. On
other words, it is necessary to provide an aspects model
weaving, like the ideas presented in [7]. In spite of its
importance, a detailed discussion about both
implementations (models and code), as well as model
weaving are, due to paper lengths limitation, beyond the
scope of this paper.
Finally, it is important to highlight that DERAF does
not provide aspects to handle all NFR present in a
Fig. 3 UAV movement control FRs and NFR
DERTS design. Fault-tolerance is an important NFR is
not addressed in the initial version of DERAF. However,
RT-UMLs diagrams are used for functional
DERAF was proposed as an extensible framework, and
requirements specification (see for instance [25]). NFR
support to fault-tolerance aspects will be incorporated in
are handled through DERAF aspects. In the proposed
future versions.
approach, the designer describes the selection of model
3. Application example elements, which will be affected by the selected aspects,
through Join Point Designation Diagrams (JPDD) [21].
This section presents the design of a distributed real-
JPDDs are used to describe the join point [20] selection
time embedded automation and control system for an
at modeling level, that means, in order to describe
unmanned air vehicle (UAV) [22][23][24] in order to
where the selected aspects will insert adaptations. The
illustrate how to use the DERAF framework. The
use of high-level join point descriptions improves their
proposed UAV system consists of a helicopter that can
reuse, allowing that the same join point be used with
be used in a variety of applications, such as environment
different adaptations. JPDD can be modeled using
monitoring, rescue of victims in natural disasters, or
interaction, activity and statechart diagram capturing,
urban security. UAV functionalities include navigation,
respectively, control flow, data flow, and state models.
movement control, collision detection, target pursuit,
For this initial proposal, only interaction JPDD to
system maintenance, mission management, camera
capture control flow join points are used.
control and data exchange with an on ground base. This
For illustration purposes, a very simple aspect was
case study will focus on the movement control sub-
chosen to show how to specify JPDDs and how it adapts
system, which is composed by sensors and actuators and
the functional specification. The chosen DERAF aspect
whose control algorithm takes into account environment
was DataFreshness, which handle the Precision NFR of
information (e.g. wind speed and direction, humidity and
values with a lifetime restriction. Fig. 4 shows the JPDD
temperature).
that selects behavioral elements. The stereotype
The design starts with the requirements analysis,
<<JPDD>> indicates the JPDD representing a join point
following the FRIDA (From RequIrements to Design
selection. The <<JoinPoint>> stereotype indicates the
using Aspects) methodology [17], which has been
element that will be selected when the JPDD will be
adapted to real-time and embedded systems domain. In
evaluated. For details on the elements naming pattern
this phase, both functional and non-functional
and wildcards, please refer to [21]. Fig. 4a shows the
requirements must be elicited using the aspects described
selection of the construction message for objects
in section 2. At the end of this phase, a use case diagram
representing information (i.e. all the classes whose name
is provided to describe graphically the specified system
finishes with Information) that is concurrently accessed
functionalities and their crosscuttings NFRs (depicted as
(i.e. annotated with the <<SAresource>> stereotype). On
stereotypes annotating the affected use cases). Fig. 3
the other hand, Fig. 4b shows the JPDD that selects all
shows the use cases diagram for the UAV system. .The
messages requesting data (i.e. message whose name
used notation follows ideas taken mainly from [19] and
starts with get), that are sent from active objects (i.e.
[7]. For details on adapted FRIDA methodology see
annotated with <<SAschedRes>>) to information
[18].
objects.
Fig. 4 Join point selection: (a)Object creation (b)Message

The next step is to link the joint point selection with


the aspect. Fig. 5 shows one part of the proposed Aspects
Crosscuting Overview Diagram (ACOD) describing the
Freshness aspect. The aspect is represented as a class Fig. 5 Linking JPDD with an aspect and adaptation
annotated with the <<Aspect>> stereotype, pointcuts
are represented as attributes annotated with the 4. Related Work
<<Pointcut>> stereotype, and the adaptations Although aspect-orientation (AO) is a relatively new
represented as operations annotated with the concept, there are some proposals to use it in DERTS
<<StructuralAdaptation>> or <<Behavioral design, especially to handle real-time requirements.
Adaptation>> stereotype. Behavioral adaptations can However, most approaches propose the use of aspects in
have a relative position where the adaptation is applied. the implementation phase. For instance, in [6] aspects are
For instance, in the Freshness aspect, the timestamp will extracted from real-time Java code of a sentient traffic
be added to an object and associated to a specific data simulator, to non-functional concerns such as threads,
(i.e. attribute value) after the execution of the object memory management, and asynchrony. The paper
construction (e.g. <<Pointcut>> pcActObjInit compares pros and cons of object-oriented vs aspect-
(constructor, SetupTimeStamp, AFTER)). oriented implementations. In the approach proposed in
Another important feature is the online monitoring of this paper, AO concepts are applied at higher abstraction
the data freshness. As can be seen in Fig. 5, the levels using a top-down approach instead of re-factoring
timestamp is inserted in those classes which record an existing source code in a bottom-up approach.
information. This timestamp will be checked every time In [5], a toolkit named VEST (Virginia Embedded
an object needs to read the time-controlled information. System Toolkit) aspects are used to abstract timing
This is provided by the behavioral adaptation properties of pre-designed components, in order to check
VerifyFreshness. According to the pointcut pcReadInfo, the possibility of composing components with
before any message is sent to a controlled object to information taken from system models. Aspects are also
retrieve time-controlled data, freshness verification must used to check and test dependencies among library
be performed. The attributes inserted into all structural components. Results presented in the paper indicate a
adaptations (e.g. TimeStamp), have their values reduction in design time when using VEST. Diferently,
initialized through parameters (see [7]) passed by the in the approach presented in this paper, aspects are used
SetupTimeStamp behavioral adaptation through the to directly deal with NFR from the analysis phase.
<<Crosscut>> stereotyped association. ACOD can also Additionally, in our work aspects play an important role
be used to show an overview of all used aspects and the during the design of crosscutting concerns.
affected classes of DERTS design that represent AODM (Aspect-Oriented Design Model) [7] is an
functional requirements. The idea is to automatically UML extension to deal with AO design concepts. It
generate the summarized ACOD through a tool that reproduces constructs of the AspectJ language [8] using
evaluates all JPDDs to find out classes affected by the UMLs stereotypes and tagged values. Additionally,
selected DERAF aspects. At the moment, the AODM also proposes a weaving mechanism to apply
summarized ACOD must be generated manually. aspects adaptations within the system model. AODM
was proposed to be used in the general computing system
domain, which does not have very stringent NFR as in
the embedded real-time domain. This work proposes to
deal with DERAFs supported NFR at a high-level of
abstraction, providing traceability to these NFR along the
development process. Additionally, the proposed
approach is not limited to a specific programming on Aspect-Oriented Software Development, ACM Press, 2002,
pp. 106-112
language due to the abstract nature of DERAF aspects.
[8] AspectJ, www.aspectj.org, v.1.5.2, Sep.2006
[9] R. France, I. Ray, G. Georg, and S. Ghosh, "An Aspect-Oriented
5. Final Remarks and Future Work Approach to Early Design Modeling", IEE Software,vol.151,
This paper proposes the use of AO to deal with non- 2004, pp. 173-186
[10] Object Management Group, Unified Modeling Language:
functional concerns that crosscut since earlier modeling
Superstructure, v.2.0, www.omg.org/cgibin/doc?formal/05 -07-
and design phases, such as requirements and analysis of 04, Sep.2006
DERTS project. To support our proposal, a high-level [11] Object Management Group, UML profile for Schedulability,
aspects framework named DERAF has been developed. Performance and Time, v.1.1, www. omg.org/cgi-
bin/doc?formal/2005-01-02, Sep.2006
The set of aspects provided by DERAF deals with time,
[12] A. Burns et al. The Meaning and Role of Value in Scheduling
distribution, and embedded NFR. DERAF is used to map Flexible Real-Time Systems in Journal of Systems Architecture:
NFR from requirements elicitation and analysis to design the EUROMICRO Journal. vol.46, n.4, 2000, pp.305-325
elements in the modeling phase, using a methodology [13] K.Keutzer, S.Malik, R.Newton, J.Rabaey, A.Sangiovanni-
adapted from FRIDA. To illustrate the use of DERAF in Vicentelli, System Level Design: Orthogonalization of Concerns
and Platform-Based Design, IEEE Transactions on Computer-
DERTS design, an UAV movement control system was Aided Design of Integrated Circuits and
presented as case study. It has been shown how to use Systems,vol.19,n.12,2000, pp.1523-1543
DERAF aspects to model the handling of non-functional [14] A. Burns, A. Wellings, Real-time systems and programming
concerns using RT-UML. Other applications were languages,Addison-Wesley,2ndedition, 1997.
[15] Institute of Electrical and Electronics Engineering, IEEE
modeled using the proposed approach. The generated Standard Glossary, http://standards.ieee.org/catalog/olis/
models were evaluated using software engineering arch_se.html, Sep. 2006
metrics and compared to object-oriented models. The [16] Carnegie Mellon Software Engineering Institute, Online
obtained results indicate that the use of AO can impact Technical Terms Glossary, http://www.sei.cmu.edu/str/
indexes/glossary/, Sep. 2006
positively in some metrics, such as cohesion, coupling [17] S.C. Bertagnolli, M.L.B. Lisba, The FRIDA Model, Proc. of
and size. Workshop on Analysis Aspect-Oriented Software, Germany,
As future works, we intend to implement DERAF (Held in conjunction with ECOOP 2003), 2003.
aspects in order to allow their use in implementation [18] E.P. Freitas, M.A. Wehrmeister, C.E. Pereira, F.R. Wagner, E.T.
Silva Jr., F.C. Carvalho, Using Aspect-Oriented Concepts In The
phase of DERTS design. In addition, we plan to use the Requirements Analysis Of Distributed Real-Time Embedded
DERAF implementation to generate DERTS source code Systems, to appear in Proc. of IFIP International Embedded
automatically (as complete as possible, that is, not only Systems Symposium, Irvine, USA, 2007.
code skeletons) from RT-UML using DERAF aspects. [19] J. Arajo et al., Aspect-Oriented Requirements with UML, in
Proc. of Workshop on Aspect-oriented Modeling with UML,
References UML 2002, Germany, 2002.
[20] A. Schauerhuber, et al. Towards a Common Reference
[1] L. Chung and B.A. Nixon, Dealing with Non-Functional Architecture for Aspect-Oriented Modeling, in Prof of Int.
Requirements: Three Experimental Studies of a Process-Oriented Workshop On Aspect-Oriented Modeling, AOSM 2006.
Approach, Proc. of 17th International Conference on Software [21] D. Stein, S. Hanenberg, R. Unland, Expressing Different
Engineering, ACM Press, 1995, pp. 25-37. Conceptual Models of Join Point Selections in Aspect-Oriented
[2] H. Ossler, and P. Tarr, P., Using subject-oriented programming Design, Proc. of 5th Int. Conf. on Aspect-Oriented Software
to overcome common problems in object-oriented software Development,ACM Press,2006,pp.15-26
development/evolution, Proc. of 21st Int. Conf. on Software [22] C. W. Seibel, J. Farines, J. E.R. Cury, Towards Using Hybrid
Engineering, IEEE Computer Society Press, 1999, pp. 687-688. Automata for the Mission Planning of Unmanned Aerial
[3] G. Kiczales et al., Aspect-Oriented Programming, Proc. of Vehicles, Lecture Notes In computer Science, Vol. 1567, Spring-
European Conference for Object-Oriented Programming, ECOOP, Verlag, London, UK, 1999, pp. 324-340.
LNCS 1241, Springer-Verlag, 1997, pp. 220-240 [23] A. Ryan, M. Zennaro, A. Howell, R. Sengrupta, J. K. Hedrick,
[4] A. Rashid, P. Sawyer, A. Moreira, J. Araujo, Early Aspects: A An Overview of Emerging Results in Cooperative UAV
Model for Aspect-Oriented Requirements Engineering, Proc. of Control, Proc. of the 43rd IEEE Conference on Decision and
IEEE Int. Conf. on Requirements Engineering, 2002, pp.199-202 Control, IEEE Computer Society, 2004, pp. 602-607.
[5] J.A. Stankovic et al., VEST: An Aspect-Based Composition [24] G. Cai, K. Peng, B. M. Chen, T. H. Lee, Design and Assembling
Tool for Real-Time System, Proc. of 9th IEEE Real-Time and of a UAV Helicopter System, Proc. of the International
Embedded Technology and Applications Symposium, RTAS, Conference on Control and Automation, (ICCA2005), IEEE
2003, pp. 58-59 Computer Society, 2005, pp.697-702.
[6] S.L. Tsang, S. Clarke, E. Baniassad, An Evaluation of Aspect- [25] M.A Wehrmeister, L.B. Becker, F.R. Wagner, C.E. Pereira, On
Oriented Programming for Java-based Real-Time Systems Object-Oriented Platform-based Design Process for Embedded
Development, Proc. of the 7th Int. Symp. on Object-Oriented Real-Time Systems, Proc. of the 8th IEEE Int. Symp. on Object-
Real-Time Distributed Computing, IEEE Computer Society, Oriented Real-Time Distributed Computing, IEEE Computer
2004. Society, 2005, pp. 125-128
[7] D. Stein, S. Hanenberg, R. Unland, A UML-based Aspect-
Oriented Design Notation for AspectJ, Proc. of Int. Conference

You might also like