QoS-aware Component Composition Luis S. Barbosa DI-CCTC, Universidade do Minho 4710-057 Braga, Portugal Email: lsb@di.uminho.pt Sun Meng Centrum Wiskunde & Informatica (CWI) P.O. Box 94079, Amsterdam, The Netherlands Email: M.Sun@cwi.nl Abstract—Component’s QoS constraints cannot be ignored when composing them to build reliable loosely-coupled, dis- tributed systems. Therefore they should be explicitly taken into account in any formal model for component-based development. Such is the purpose of this paper: to extend a calculus of component composition to deal, in an effective way, with QoS constraints. Particular emphasis is put on how the laws that govern composition can be derived, in a calculational, pointfree style, in this new model. I. I NTRODUCTION The design of loosely-coupled, highly distributed software systems places new requirements on components’ composi- tion. Non-functional properties of software components, such as response time, availability, bandwidth requirement, memory usage, etc., cannot be ignored and become decisive in the selection procedure. Moreover, often adaptation mechanisms have to take them into account, going far behind the sim- ple wrapping of functionality to bridge between published interfaces. The expression Quality of Service (QoS) is widely accepted to group together all these concerns [14], [19], [20]. It suggests twin notions of a level to be attained and cost to be paid, as well as point out to the design of suitable metrics to quantify such properties. Over the past few decades, several formalisms (e.g., stochas- tic Petri Nets [13] and interactive Markov Chains [8]) have been proposed to capture different QoS metrics. In pro- gramming languages like Java or C#, QoS properties are often specified using meta-attributes. From a static validation perspective, these attributes can be treated like structured comments, which may be used to generate runtime monitors but their semantics is too weak to allow reasoning effectively about QoS properties. Dealing with QoS aspects in a coherent and systematic way became a main issue in component composition, which cannot be swept under the carpet in any formal account of the problem. This paper extends a formal calculus for component com- position [3], [4], in order to take into account, in an explicit way, QoS information. The calculus is based on a coalgebraic model used to capture components’ observable behavior and persistence over transitions. Furthermore, it is parametric on a notion of behavior, encoded in a strong monad, which allows to reason in a uniform way about total or partial, non deterministic or stochastic components. It has already been argued by others (e.g., [11], [10], [17]) that coalgebra theory nicely captures the ”black-box” characterization of software components, which favors an observational semantics: the essence of a component specification lies in the collection of possible observations and any two internal configurations should be identified wherever indistinguishable by observation. To express QoS properties we adopt (a slight generalization) of the notion of Q-algebra proposed in [7]. In brief, a Q- algebra amounts to two semirings over a common carrier, representing some form of cost domain, which allows different ways of combining and choosing between quality values. The resulting calculus provides a compositional approach which offers potential for complex components to be con- structed systematically while satisfying QoS constraints. Al- though most previous laws have to be revisited in this extended model, and most of them turn from equalities (i.e., bisimi- larities) to inequalities (i.e., refinements), proofs can still be carried on in the calculation style which is the watermark of [3], [4]. This style avoids the explicit construction of, e.g., bisimulations, when proving observational equality, favouring an equational, essentially pointfree reasoning style as popu- larized, at the micro, programming level, under the name of algebra of programming [6]. The remaining of this paper is devoted to substantiate this claim. Therefore, the original component calculus is summarised in the following section. Section III introduces its extension and redefines the basic operators to make them QoS aware. An illustrative example is discussed in section IV. Section V discusses how the properties of component compo- sition can be established in this new setting. The emphasis is not on providing a complete account of the new calculus, but rather on illustrating how it can be developed. II. A COMPONENTSCALCULUS This section recalls the basic mechanisms for component aggregation along the lines of [3], [4], where further details and proofs can be found. Software components can be characterized as dynamic systems with a public interface and a private, encapsulated state. The relevance of state information precludes a ‘process- like’ (purely behavioral) view of components. Components are rather concrete coalgebras [17], [1], [11]). For a given value of the state space — referred to as a seed in the sequel — a corresponding ‘process’, or behavior, arises by computing its coinductive extension.