automated design of software architectures for embedded ... › c602 › fc6cf9336537... ·...

4
Proc. of the VII ALIO/EURO – Workshop on Applied Combinatorial Optimization, Porto, Portugal, May 4 - 6, 2011 Automated Design of Software Architectures for Embedded Systems using Evolutionary Multiobjective Optimization R. Li * R. Etemaadi * M.T.M. Emmerich * M.R.V. Chaudron * * Leiden Institute of Advanced Computer Science (LIACS), Leiden University Postbus 9512, 2300RA, Leiden, The Netherlands {ruili, etemaadi, emmerich, chaudron}@liacs.nl ABSTRACT The design of software architecture for embedded system is one of the big challenges in the research field of modern software engi- neering. It requires software architects to address a large number of non-functional requirements that can be used to quantify the operation of system. Furthermore, these quality attributes often conflict with each other, for instance, improving system perfor- mance often needs more powerful hardware, which could increase the production cost and power consumption in the meantime. In most cases, software designers try to find a set of good architec- tures by hand. However because of large and combinatorial design space, this process is very time-consuming and error-prone. As a consequence, architects could easily end up with some subopti- mal designs. In this paper, we introduce our AQOSA (Automated Quality-driven Optimization of Software Architecture) toolkit which can improve these aforementioned non-functional proper- ties in an automated manner. More precisely, beginning with some initial architectures, AQOSA toolkit can use its optimizer to not only produce several alternatives, but also apply trade-off analy- sis to these newly created architectures according to multiple at- tributes of interests. 1. INTRODUCTION Modern embedded systems are large and complicated and there- fore difficult to develop and maintain. For example, real-time sys- tems, which nowadays are intensively applied to application do- mains such as automobile and multimedia, are often built to guar- antee the safety and robustness requirements. To meet these re- quirements makes the design of real-time systems very challeng- ing. Under such circumstances, software architecture which is an important field of study in software engineering receives more and more attentions in the last few years. More technically speak- ing, software architectures describe various aspects of the system, mostly their deployment, behavioral, and structural features. With them, designers have the opportunity to analyze the quality prop- erties of software at a high level and thus can make optimal archi- tectural decisions to satisfy the quality attributes at the very early architectural stage of the project. In many cases, quality properties conflict with each other, that is, improving one quality property can have a negative impact on others, and thus to construct a system that satisfies all its require- ments could be difficult. One possible solution is to use optimiza- tion techniques to generate several feasible architectures according to initial models and then select optimal solutions from all alter- natives through the trade-off analysis with respect to all quality requirements. In current practice, this process is normally performed man- ually to the system design. The drawback of this is that it can be time-consuming and error-prone work, especially for large and complex architectures. For complex applications, having some of this work automated could be a considerable cost saver. To this end we propose our AQOSA toolkit which was developed to auto- matically improve the non-functional properties of an architectural design and thus enable architects to focus on the higher-level de- sign decisions. The paper is organized as follows. Section 2 summaries some existing methods which are different from ours. Section 3 explains our proposed AQOSA toolkit, especially the execution procedure, in detail. The case study as well as some experimental results is presented in Section 4. Finally, conclusions and future works are given in Section 5. 2. RELATED WORK As we emphasized at the very beginning of this paper, it is almost impossible for software architects to manually find optimal archi- tecture designs from not only large but also discontinuous design search space. Researchers have proposed several approaches, es- pecially some metaheuristic-based methods which can automate this process. For instance, Martens et al. [1] introduced approach which could automatically improve software architectures mod- elled with the Palladio Component Model based on trade-off anal- ysis of performance, reliability, and cost. ArcheOpterix [2] is another generic framework which opti- mize architecture models with evolutionary algorithms. It supports only one degree of freedom for exploration, that is allocation of software components. Besides, two quality criteria (data trans- mission reliability and communication overhead) are defined and the evaluation is based on formal mathematical analysis. Similar to Marten’s approach, ArchiOpterix suffers from the limitation on search freedom and has chance to be trapped by some suboptimal solutions. To alleviate this issue, our proposed AQOSA toolkit, which deploys both advanced model technology and evolutionary multi- objective optimization algorithms with specially designed genetic encoding scheme, allows not only more quality attributes but also more complex degrees of freedom like exploration of architecture topology. ALIO/EURO-1

Upload: others

Post on 03-Jul-2020

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Automated Design of Software Architectures for Embedded ... › c602 › fc6cf9336537... · Quality-Driven Optimization of Software Architecture) toolkit. Next, we will explain some

Proc. of the VII ALIO/EURO – Workshop on Applied Combinatorial Optimization, Porto, Portugal, May 4 - 6, 2011

Automated Design of Software Architectures for Embedded Systems usingEvolutionary Multiobjective Optimization

R. Li ∗ R. Etemaadi ∗ M.T.M. Emmerich ∗ M.R.V. Chaudron ∗

∗ Leiden Institute of Advanced Computer Science (LIACS), Leiden UniversityPostbus 9512, 2300RA, Leiden, The Netherlands

{ruili, etemaadi, emmerich, chaudron}@liacs.nl

ABSTRACT

The design of software architecture for embedded system is one ofthe big challenges in the research field of modern software engi-neering. It requires software architects to address a large numberof non-functional requirements that can be used to quantify theoperation of system. Furthermore, these quality attributes oftenconflict with each other, for instance, improving system perfor-mance often needs more powerful hardware, which could increasethe production cost and power consumption in the meantime. Inmost cases, software designers try to find a set of good architec-tures by hand. However because of large and combinatorial designspace, this process is very time-consuming and error-prone. Asa consequence, architects could easily end up with some subopti-mal designs. In this paper, we introduce our AQOSA (AutomatedQuality-driven Optimization of Software Architecture) toolkitwhich can improve these aforementioned non-functional proper-ties in an automated manner. More precisely, beginning with someinitial architectures, AQOSA toolkit can use its optimizer to notonly produce several alternatives, but also apply trade-off analy-sis to these newly created architectures according to multiple at-tributes of interests.

1. INTRODUCTION

Modern embedded systems are large and complicated and there-fore difficult to develop and maintain. For example, real-time sys-tems, which nowadays are intensively applied to application do-mains such as automobile and multimedia, are often built to guar-antee the safety and robustness requirements. To meet these re-quirements makes the design of real-time systems very challeng-ing.

Under such circumstances, software architecture which is animportant field of study in software engineering receives more andmore attentions in the last few years. More technically speak-ing, software architectures describe various aspects of the system,mostly their deployment, behavioral, and structural features. Withthem, designers have the opportunity to analyze the quality prop-erties of software at a high level and thus can make optimal archi-tectural decisions to satisfy the quality attributes at the very earlyarchitectural stage of the project.

In many cases, quality properties conflict with each other, thatis, improving one quality property can have a negative impact onothers, and thus to construct a system that satisfies all its require-ments could be difficult. One possible solution is to use optimiza-tion techniques to generate several feasible architectures according

to initial models and then select optimal solutions from all alter-natives through the trade-off analysis with respect to all qualityrequirements.

In current practice, this process is normally performed man-ually to the system design. The drawback of this is that it canbe time-consuming and error-prone work, especially for large andcomplex architectures. For complex applications, having some ofthis work automated could be a considerable cost saver. To thisend we propose our AQOSA toolkit which was developed to auto-matically improve the non-functional properties of an architecturaldesign and thus enable architects to focus on the higher-level de-sign decisions.

The paper is organized as follows. Section 2 summaries someexisting methods which are different from ours. Section 3 explainsour proposed AQOSA toolkit, especially the execution procedure,in detail. The case study as well as some experimental results ispresented in Section 4. Finally, conclusions and future works aregiven in Section 5.

2. RELATED WORK

As we emphasized at the very beginning of this paper, it is almostimpossible for software architects to manually find optimal archi-tecture designs from not only large but also discontinuous designsearch space. Researchers have proposed several approaches, es-pecially some metaheuristic-based methods which can automatethis process. For instance, Martens et al. [1] introduced approachwhich could automatically improve software architectures mod-elled with the Palladio Component Model based on trade-off anal-ysis of performance, reliability, and cost.

ArcheOpterix [2] is another generic framework which opti-mize architecture models with evolutionary algorithms. It supportsonly one degree of freedom for exploration, that is allocation ofsoftware components. Besides, two quality criteria (data trans-mission reliability and communication overhead) are defined andthe evaluation is based on formal mathematical analysis. Similarto Marten’s approach, ArchiOpterix suffers from the limitation onsearch freedom and has chance to be trapped by some suboptimalsolutions.

To alleviate this issue, our proposed AQOSA toolkit, whichdeploys both advanced model technology and evolutionary multi-objective optimization algorithms with specially designed geneticencoding scheme, allows not only more quality attributes but alsomore complex degrees of freedom like exploration of architecturetopology.

ALIO/EURO-1

Page 2: Automated Design of Software Architectures for Embedded ... › c602 › fc6cf9336537... · Quality-Driven Optimization of Software Architecture) toolkit. Next, we will explain some

Proc. of the VII ALIO/EURO – Workshop on Applied Combinatorial Optimization, Porto, Portugal, May 4 - 6, 2011

3. AQOSA TOOLKIT

The detailed working process of AQOSA toolkit is illustrated inFigure 1. As can be seen, the automated optimization process startswith some initial software architectures, which could be designedby domain experts by using some advanced model design tools.Next, these architectures are evaluated and corresponding multiplequality criteria of interests are obtained. More specific, proces-sor utilization, data flow latency, and cost metrics are addressed inthis study. At the current stage, the simulation-based approach1

is used for AQOSA evaluator. Note that the precision of evalua-tion is highly dependent on the modeling details and the featuressupported by simulator.

As mentioned earlier, some conflicting quality attributes, suchas utilization and cost, are often involved in performance analysis.Thus the domination principle could be adopted by evolutionaryoptimizer for doing trade-off analysis on quality attributes whichare extracted through an extractor based on our performance met-rics. Some good architectures are then selected from current avail-able solutions. Furthermore, the evolutionary optimizer could au-tomatically produce new candidate architectures by using repro-duction operators like ”crossover” and ”mutation”.

Figure 1: The detailed working scheme of AQOSA (AutomatedQuality-Driven Optimization of Software Architecture) toolkit.

Next, we will explain some key components and related tech-niques in detail.

3.1. Modeling and Evaluation Engine

For software architecture modeling, as a natural extension of pre-vious work [3] AQOSA integrates ROBOCOP [4] (Robust OpenComponent Based Software Architecture for Configurable DevicesProject) modeling language. Furthermore, AQOSA also supportsAADL [5] (Architecture Analysis & Design Language) which isnow widely recognized industrial standard in modeling embed-ded and real-time architectures. The architect can easily designthe initial architecture in OSATE (Open Source AADL Tool En-vironment) and then import it into AQOSA framework. To useADeS [6] as the core part of our AQOSA simulation engine, we

1As compared to analysis-based approach.

made some modifications of ADeS in scheduling and added newfeatures for data flow latencies evaluating. More specifically speak-ing, our evaluation engine first loads an AADL model and createsnecessary objects for simulation. After that, it generates systemevents based on the behaviour annex of the model and follow theevents through the model connections till end of flows. For com-plex and concurrent events, the scheduling module decides whichprocess can take the processor.

At present, we implement three quality properties: processorutilization, data flow latency and architecture cost. By design,AQOSA toolkit can be easily extended to support other quanti-tative quality criteria of software architectures by introduce newevaluation plug-ins, i.e. for communication lines loads evaluation,we just needed to add a new listener which implements the mea-surement of the bus load to our simulation engine. Another ad-vantage of AQOSA is that it provides some very flexible API forthe interaction between evaluator and various optimization frame-works such as Opt4J and JMetal2.

3.2. Evolutionary Optimizer

3.2.1. Evolutionary multiobjective optimization

Evolutionary multiobjective optimization (EMO) [7] derives fromsingle objective evolutionary optimization (EO) algorithms and isrecognized as a fast growing fields of research. It is relatively sim-ple to implement and wide-spread applicable. In this work, tworepresentative multiobjective optimization algorithms (NSGAII [8]and SPEA2 [9]) from literatures are chosen and applied to one ar-chitecture design task for the car radio navigation (CRN) system.

3.2.2. Search problem formulation

From EMO algorithm perspective, architecture design problem canbe generalized as following optimization task (see Equation 3.2.2):

min fm(x), m = 1,2, . . . ,M (1)s.t. g j(x)& 0 j = 1,2, . . . ,N

Here, x is a solution and can be of any domain, e.g., real or bi-nary. In the given context, x could be a valid architecture fromembedded system design domain. For each solution x, there ex-ists m = 3 objectives, i.e. f1 : Processor utilization, f2 : Cost, andf3 : Data flow latency. g j(x) represents a number of constraintswhich any feasible solution must satisfy. The aim is not only pro-vide one optimal solution but rather to provide a broad variety ofnondominated solutions representing trade-offs in the three objec-tives.

3.2.3. Generic degree of freedom to exploration

With specially designed genotype representation, the following de-grees of freedom to exploration are implemented: (1) System hard-ware topology (hypergraph), i.e. processor/bus can be added orremoved from the system, (2) Allocation of service instances, (3)Replacement between different hardwares, i.e. one component canbe replaced by its counterparts from available hardware repository.Figure 2 shows three system topologies which are supported andvalid for car radio navigation (CRN) architecture design (i.e. casestudy in Section 4).

2http://opt4j.sourceforge.net and http://jmetal.sourceforge.net

ALIO/EURO-2

Page 3: Automated Design of Software Architectures for Embedded ... › c602 › fc6cf9336537... · Quality-Driven Optimization of Software Architecture) toolkit. Next, we will explain some

Proc. of the VII ALIO/EURO – Workshop on Applied Combinatorial Optimization, Porto, Portugal, May 4 - 6, 2011

Figure 2: Possible topologies supported by genotype representa-tion: Single processor node (left), Two processor nodes with singlebus (middle), and Three processor nodes with single bus (right).

4. CASE STUDY AND EXPERIMENTAL RESULTS

4.1. Car Radio Navigation System

To validate our proposed AQOSA toolkit, we applied it to onebenchmark application - the car radio navigation (CRN) system[10]. The CRN system is constructed according to the component-based paradigm. An overview of the software architecture is de-picted in Figure 3.

Figure 3: Overview of the car radio navigation system functional-ity.

As can be seen, the CRN system contains three major func-tional blocks:

• The Man-Machine Interface (MMI), that takes care of allinteractions with the end-user, such as handling key inputsand graphical display output.

• The Navigation functionality (NAV) is responsible for des-tination entry, route planning and turn-by-turn route guid-ance giving the driver visual advices. The navigation func-tionality relies on the availability of map database and po-sitioning information.

• The Radio functionality (RAD) is responsible for tunnerand volume control as well as handling of traffic messagechannel information services.

The major challenge is to determine a set of optimal architectureswith respect to quality attributes such as processor utilization, dataflow latency, and cost. Technically speaking, we investigate howto distribute these aforementioned functionalities over the avail-able resources (processor node in Figure 2) to meet some globalrequirements. Vector representation in Figure 4 illustrates how thegenotype is used to describe possible architecture topologies (Fig-ure 2) as well as mapping of services.

Figure 4: Genotype vector for possible software architectures rep-resentation (884,736 possibilities).

4.2. Experimental Setup and Results

The experimental setup is as follows: two standard evolutionarymultiobjective optimization algorithms from Opt4J, Non-dominatedSorting Genetic Algorithm (NSGA-II) and Strength Pareto Evo-lutionary Approach 2 (SPEA2), will be used. Furthermore, thefollowing parameter settings are adopted: initial population size:50, parent population size: 25, number of offspring: 25, archivesize: 100, number of generation: 50, crossover rate is set to 0.95,constant mutation probability is 0.01. For each algorithm we runAQOSA 20 runs (≈ 10 hours). The resulting archive of optimalsolutions can be visualized in the 3-D Pareto front with respect toprocessor utilization, cost, and data flow latency in Figure 5.

Figure 5: Resulting Pareto front approximations of archive popu-lation (non-dominant solutions) after 50 generations of one typicalrun of SPEA2. Colors are used to distinguish between differentfound architecture topologies.

An interesting finding is that resulting pareto front consists ofthree segmentation (with clearly gap in between). This could bethe result of discontinuities in the search space caused by struc-tural transitions. By identifying and mapping each individual fromarchive back to corresponding design architecture, solutions fromsame segmentation share the same architectural topology3 (i.e. Fig-ure 2). This discovery is consistent with our understanding of CRNsystem, for instance, solutions with topology 3 (solutions with bluecolor) normally have lower processor utilization and higher costfor the hardware. On the contrary, solutions with topology 1 (redcolor) have higher processor utilization and lower cost.

The 2-D plot of two quality attributes is presented in Figure 6.In this way, the software architect can make trade-off decisionmuch easier. For instance, the left plot shows the processor uti-lization over the cost per candidate architecture while the right one

3All three algorithms which we studied show the same behaviour.

ALIO/EURO-3

Page 4: Automated Design of Software Architectures for Embedded ... › c602 › fc6cf9336537... · Quality-Driven Optimization of Software Architecture) toolkit. Next, we will explain some

Proc. of the VII ALIO/EURO – Workshop on Applied Combinatorial Optimization, Porto, Portugal, May 4 - 6, 2011

Figure 6: Plot between two objectives of archive population (non-dominant solutions): Cost vs. Processor utilization (left) and Costvs. Data flow latency (right).

indicates the data flow latency over cost. There is no obvious con-flict between processor utilization and data flow latency and thecorresponding plot is excluded here. Further more, both the at-tainment surface of one typical run of SPEA2 and the box-plots ofthe hypervolume indicator [11] for ref. point (1,1,1)T of archivepopulation for NSGA-II, SPEA2, and random search over 20 runsare presented in Figure 7

Figure 7: The dominated Hypervolume approximation of one typ-ical run of SPEA2 (left) and the box-plots of the hypervolume in-dicator for NSGA-II, SPEA2, and random search on CRN designproblem over 15 runs (right).

From figure 7 (left), it gets clear that final solutions from archiveare mutually non-dominated with respect to three quality attributesinvestigated. Another observation is that NSGA-II and SPEA2show the comparable performance with each other (student’s t-testwith 1% confidence level), and the results are very similar. Ran-dom search, by contrast, shows worst performance.

5. CONCLUSIONS AND OUTLOOK

We presented so-called AQOSA (Automated Quality-driven Op-timization of Software Architecture) toolkit. It not only can helpsoftware architects to reduce the workload for modeling and eval-uating real-world problems, but also can automatically improvequality attributes by using evolutionary multiobjective optimizers.We applied AQOSA on the car radio navigation (CRN) system.The preliminary results are very promising.

For future research several questions are of interest: First,more challenging application (i.e., from automobile industry) willbe modeled and tested by using AQOSA. Secondly, besides afore-mentioned attributes which we studied in this work other non-functional qualities such as power consumption and safety will beintegrated. Algorithms such as SMS-EMOA [12] are also worthinvestigating for the resulting many-objective problems.

6. ACKNOWLEDGEMENTS

This work has been supported by the Dutch national project OMECA(Optimization of Modular Embedded Computer-vision Architec-tures) and European project SCALOPES (an ARTEMIS projecton SCalable LOw Power Embedded platformS).

7. REFERENCES

[1] A. Martens, H. Koziolek, S. Becker, and R. Reussner, “Au-tomatically improve software architecture models for perfor-mance, reliability, and cost using evolutionary algorithms,”in Proceedings of the first joint WOSP/SIPEW internationalconference on Performance engineering, 2010, pp. 105–116.

[2] A. Aleti, S. Bjornander, L. Grunske, and I. Meedeniya,“Archeopterix: An extendable tool for architecture optimiza-tion of AADL models,” in ICSE 2009, MOMPES Workshop2009, May 16, 2009, Vancouver, Canada, 2009, pp. 61–71.

[3] R. Li, M. R. Chaudron, and R. C. Ladan, “Towards auto-mated software architectures design using model transfor-mations and evolutionary algorithms,” in GECCO (Compan-ion). ACM, 2010, pp. 2097–2098.

[4] E. Bondarev, M. R. Chaudron, and P. de With, “A processfor resolving performance trade-offs in component-based ar-chitectures,” in Component-Based Software Engineering, ser.LNCS, vol. 4063, 2006, pp. 254–269.

[5] P. H. Feiler, D. Gluch, and J. J. Hudak, “The architec-ture analysis & design language (AADL): An introduction,”Carnegie Mellon University, Technical Report CMU/SEI-2006-TN-011, 2006.

[6] R. S. Jean-Francois Tilman, Amelie Schyn, “Simulation ofsystem architectures with AADL,” in Proceedings of 4thInternational Congress on Embedded Real-Time Systems,ERTS 2008., 2008.

[7] K. Deb, “Multiobjective optimization,” J. e. a. Branke, Ed.Springer-Verlag, 2008, ch. Introduction to Evolutionary Mul-tiobjective Optimization, pp. 59–96.

[8] K. Deb, S. Agrawal, A. Pratap, and T. Meyarivan, “A fastelitist non-dominated sorting genetic algorithm for multi-objective optimization: NSGA-II,” in Parallel Problem Solv-ing from Nature PPSN VI, ser. LNCS, 2000, vol. 1917, pp.849–858.

[9] E. Zitzler, M. Laumanns, and L. Thiele, “SPEA2: Improvingthe Strength Pareto Evolutionary Algorithm for Multiobjec-tive Optimization,” Tech. Rep., 2002.

[10] E. Wandeler, L. Thiele, M. Verhoef, and P. Lieverse, “Systemarchitecture evaluation using modular performance analysis:a case study,” Int J Softw Tools Technol Transfer (STTT),vol. 8, no. 6, pp. 649–667, 2006.

[11] E. Zitzler, L. Thiele, M. Laumanns, C. Fonseca, andV. da Fonseca, “Performance assessment of multiobjectiveoptimizers: an analysis and review,” IEEE Trans. on Evolu-tionary Computation, vol. 7, no. 2, pp. 117–132, April 2003.

[12] N. Beume, B. Naujoks, and M. Emmerich, “SMS-EMOA:Multiobjective selection based on dominated hypervolume,”European Journal of Operational Research, vol. 181, no. 3,pp. 1653–1669, 2007.

ALIO/EURO-4