Software Component Selection Algorithm Using ...

12 downloads 52212 Views 218KB Size Report
a good starting point, keyword based searching is not efficient because it often results ... software component selection but also, in a short time, for any kind of service ..... Search of identify components using any kind of search engines. 3.
Software Component Selection Algorithm Using Intelligent Agents Blanca Z Abraham and Jose C Aguilar Fundación para el Desarrollo de la Ciencia y la Tecnología FUNDACITE Mérida - Venezuela [email protected] Universidad de Los Andes Merida – Venezuela [email protected]

Abstract. We have developed one stochastic model for intelligent selection of software components, in Internet. Components can be physically located in different repositories, and the selection is done using a XML file which is associated to each component. This file contains the most relevant characteristics of the component, with one extra field stored to be used by this algorithm; this field is called “pheromone”, which is a concept taken from collective intelligence theory that has been the main inspiration of this work. Swarm intelligence is based on each agent capacity to work individually in order to achieve a collective goal; intelligent agents interact not only with each other but also with their environment. This model can be used not only for component selection but also for services, resources, etc. This is because it is general enough for been replicated with different types of requirements. Keywords: Artificial Intelligence, Component Components.

1 Introduction The main advantage of component reuse is that generally components have been already tested and their use can make decrease considerably the development time. The goal of component use is the division of systems in pieces of code that can be used in more than one software development. In this work we assume that one software component is a piece of code which maintains its independency, autonomy and functionality through the use of their interfaces and controllers. The development and adoption of components is increasing with several on-line companies which sell software components and related services. These companies not only allow developers to buy their own components, but also act as intermediaries, providing access to third-party artifacts and related products [13]. Usually, the components are cataloged with brief descriptions that can be searched through keywords. While this is a good starting point, keyword based searching is not efficient because it often results in too many or too few hits. It may also retrieve components that are completely unrelated [13]. The search of one component is not an easy task, many type of search N.T. Nguyen et al. (Eds.): KES-AMSTA 2007, LNAI 4496, pp. 82–91, 2007. © Springer-Verlag Berlin Heidelberg 2007

Software Component Selection Algorithm Using Intelligent Agents

83

algorithms have been proposed in literature, some of them are based on hit numbers and popularity [10,12]. This work does not take into account naming and trading services to do component selection, nevertheless this work tries to use the most relevant characteristics of components like functional requirements described by software developers, in order to make decisions in an accurate way, not only for software component selection but also, in a short time, for any kind of service selection, this is possible because the algorithm is very general and could be used in parallel or distributed computing, when services or processors have to be selected.

2 Theoretical Aspects 2.1 Software Components A software component is a self contained entity that interacts with its environment through well-defined interfaces (provide services and require functionalities to be provided by other components). One of the main motivations behind component technology is reusability. If there is a collection of reusable software components, applications can be built by simply plugging existing components together. Other motivations behind component technology are: Independent evolution of application parts, enhanced flexibility, adaptability, and maintainability of software systems. In order to successfully plug components together, it is necessary that the interfaces of each component matches the requirements of the other components. In this way, the “contracts” between de components are well defined. Therefore, component-based application development depends on adherence to restricted plug-compatible interfaces and standard interaction protocols [3]. Because of marketplace of software components is highly competitive, in the last years many research have been oriented to software components, how to look for them, how to select them and how to make them work together as an integrated piece of software [11]. Many works have been developed for management of software components. Agora for example, is a prototype being developed by the Software Engineering Institute at Carnegie Mellon University [11]. The object of this work is to create an automatically generated, indexed, worldwide database of software products classified by component type; e.g., JavaBean or ActiveX control. An approach to intelligent query and component retrieval for web-based repositories is presented in [13]. In this case, the client side consists of a web browser and the server side is comprised of a query interface module, query refinement module, query execution module, domain model, ontology, repository of reusable domain objects (components), and the application database [13]. ComponentSource is another related work, it is a web repository that provides services to buy sell and develop components [5]. Many others researches can be found in literature. When a component provides services related to aspects of other components, and at the same time can require services from other components, the concept of dependency appears. That is components can have dependency with other components, and this is an important issue to take into account when a component will be selected.

84

B.Z. Abraham and J.C. Aguilar

Other important concept is information retrieval (IR), which is essentially the process of the content-based, goal-directed extraction of relevant text documents, or more general, assets from large collections. This concept is very important for component selection, because selection, searching and use of components are based on this information. The overall goal of IR is to deliver an exhaustive sub-collection of all single relevant assets (i.e., independently and individually contributing to the user's goal) [7]. The selection of the right component for a system must be done carefully, generally in the planning period of the software development cycle, if the selection is well done; the fail rate is expected to decrease [8]. 2.2 Collective Intelligence A long time ago, people discovered a variety of interesting insects and animal behavior. A flock of bird sweeps the sky, a group of ants’ forages for food, a school of fish swims, etc; this kind of behavior is named “swarm behavior”. Recently computer scientists in the field of “artificial life” and “collective intelligence” have studied how these types of animals interact, achieve goals and evolve. Collective Intelligence (CI) can be applied in many areas like telecommunication, robotic, patterns, transportation and military applications [14]. The main idea of CI suggests that N intelligent agents in a colony are cooperating to achieve some goal. The agents use rules to govern their actions, and via interactions of the entire group, the collective achieves its objectives. A type of self-organization emerges from the collection of actions of the group. CI solves problems in a flexible, adaptable, robust, and decentralized way [4]. The agents are able to process information, modulate their behavior according to the stimulus and take the best decision based in the environment information. But the biggest challenge is to make agents to work in a collective way integrating their individual activities to generate more complex and efficient behavior.

3 Proposal This work proposes a stochastic selection algorithm for software components, which is based on SI; this allows selecting the best component from a group that has been found in Internet according to a group of initial specifications. The selection algorithm uses pheromone tracks in order to identify the best components adding pheromone each time that the component performance is tested. Our Algorithm is called Algorithm A. In[6] the use of a component characterization sheet is proposed, in order to define the quality of each component. We are using a characterization file that we have called component profile, where information associated to each component is stored. This file will have a group of both dynamic and static data, the static data is not going to change, it is referred to the component name, identification, etc, and the dynamic data can change as many times as necessary. This data contains fields like technical platform, location, programmers, performance associated to a specific technical platform where the component is running, and other aspects that can be important for a specific development that can facilitated the selection, like execution time “et”.

Software Component Selection Algorithm Using Intelligent Agents

85

Each component can have more than one sub-profile for each dynamic environment; a sub-profile is the group of characteristics related to a domain where a component is loaded. Because each profile will be associated to one specific platform, the different sub-profiles are stored in the same XML file (See Figure. 1). In this way, each component can have an undefined number of sub-profiles, each of them represents one domain where that component can be used and it will have a field that represents the performance of the component when it runs on that domain. After a component is selected, rejected or used, our system is going to be able to update the component pheromone according to its performance; pheromone trail can be incremented or decremented according to the component performance. Characteristics for a component evaluation have been chosen using factors related to production time, cost rating, product quality and development risk [8,9]. PRU0707 Report Manager gpl 0.1 www.cemisid.ula.ve/components/rmc debian proactive.jar – fractal.jar 3 0.01 0.5 fedora proactive.jar – fractal.jar 1 0.05 Fig. 1. Component Profile – XML file

The initial wished requirements, like component characteristics related to functional and non functional aspects must be well defined in order to generate an XML file that identifies the ideal profile for the component that is going to be selected. In this way, when the group of analysts and programmers search a component, an ideal component profile is generated; this ideal profile will be compared with the different sub-profiles of the found components in order to select the best choice (See Figures 1). A selection algorithm is proposed, it uses an intelligent agent that will select one and only one component according to the initial requirements, and this means that the algorithm will create as many agents as components we want to select.

86

B.Z. Abraham and J.C. Aguilar

The general constraints for our algorithm are: • A component to select should always exist. • Each component has at least one profile into an XML file; the file should allow the incorporation of other profiles. • It is assumed that the initial requirements are exact information about components. Our algorithm assumes that exist as many agents as required components, the relationship is one to one. Assembling of components will be done for programmers after each agent completes its individual mission, which is the assigned component selection. Each component profile has a field where the pheromone mark is stored according to the performance of the component associated to the domain.

Repository 1 System General Architecture

Agent 1 Selects C* 2

C2 C3

Component 1 C*1

Agent 2 Selects C *1

Repository 2 Ca

Component 2 C*2

C1

Repository x Agent n Selects C*n

Component n C* n

Ca Ca

Fig. 2. Each agent selects a single component that will be integrated with the other selected components. The search for components is done using many software repositories.

The equation to establish the matching between the ideal component and the evaluated component is: Xljuk = 1 +

Hk -

Nljuk

(1)

Where Xljuk is the matching degree for component j which has been located in repository l, j has profile u, and it has been pre-selected by agent k. H identifies the sum of ideal characteristics (Ck*) that represents the wished profile, for example, operating system, programming language, maximum number of dependencies, among others; on the other hand, N represents the sum of real characteristics of the found “pre-selected” component (component sub-profile). If Xljuk is close to 1, means that

Software Component Selection Algorithm Using Intelligent Agents

87

the ideal characteristics are very similar to the component real characteristics, while less value of Xljuk better the matching between the ideal component and the selected one. Each agent will select a software component under the following parameters [2,4]: The ideal value of Xljuk is 1 and this is obtained when the matching is perfect. The amount of pheromone Ylju (t) related to each component i, that is located in a repository l for its profile u will be update after the component is used into the system. The amount of pheromone is going to be decreased or increased depending on the component performance and evaluation. The transition equation that gives the probability for an agent k selects a component j, with profile u, into the repository l, among a group of s components named cc, with profiles n, in repositories r, into an iteration t, is coming by [2,4]:

P (t ) = k lju

[Y

lju

∑ [Y

][

]

−1

(t ) X k lju

rsn

[

(t ) ] X

k

]

(2)

−1

rsn

rsn

Where

Ylju (t ) represents the quantity of pheromone for a component j with profile u

that has been found by an agent k into a repository l. Xkrsu close to 1 implies that there is a good initial matching between ideal components and real components if Xkrsu is equal to 1 means that both components are identical. This corresponds to a stochastic algorithm where agents are created and they will initiate the process of random selection, their individual objective will be to find the best component. After complete a selection and test the component, each agent will k

let a quantity of pheromone ΔY lju (t) whose value will depend of the system performance R where the component will be used. k ΔYljuk (t ) = (X lju ∗ R) −1

(3)

Where R = f (ET, M, ND)

(4)

The performance function is given by the component execution time (ET), the quantity of memory (M) that it uses and the number of dependencies that the component needs in order to be loaded (ND) in the specific platform. It is necessary the calculation of both, positive and negative feedback, the last one is called pheromone evaporation, and it is done when a component has not been selected this is incorporated through an evaporation coefficient α [2,4], α can be changed according to the amount of pheromone that user want to evaporate from the component profile when it is not selected, this is important because system will give more pheromone to those components that have better performance and decrease pheromone (evaporate) to those components that have not been selected.

88

B.Z. Abraham and J.C. Aguilar

Ylju (t)

(1 –

α)

* Ylju (t) +

ΔYljuk (t )

(5)

The initial amount of pheromone for each component is assumed as a constant positive value Y0, this represents a homogeneous distribution of pheromone in time 0. In order to determine the selection process of a given component the following rules are defined: S*k =

{ }

k ⎧arg max rsn∈CC Prsn ⎨ ⎩J (Valor Aleatorio)

(6)

Where the value of P is given by equation 2, S*k is the selected component from a group s, of the conjunct CC of possible components to select. J is a random selected component. Macro Algorithm: 1.

Definition of software architecture and components to use. 1.1. Definition and identification of k required components with their profiles.

2.

Search of identify components using any kind of search engines.

3.

Select best components. (Using Selection Algorithm A).

4.

System assemblage.

5.

Component performance evaluation.

Selection Algorithm: 1.

Create k intelligent selection agents, one for each component to select.

2. 3.

i. Initialize each agent ii. Repeat for each agent i=1 to k /where k is the total number of components to select. iii. Identify set of possible components to use (CC) using Eq 1. iv. Select component i using Eq. 6 Analyze component performance into the system (R) using Eq. 4 Update pheromone trail for all components using Eq. 5.

4 Experiments A first search was done using freshmeat.net [10], we assume that a specific component had to be selected, some functional and non functional characteristics are wished. The first search generated 61 components; we took the first 24 components, each one with its associated XML file. The initial amount of pheromone was incorporated randomly. Popular search algorithms consider the following non functional characteristics in order to sort the results: Popularity: The popularity score superseded the old counters for record hits, URL hits and subscriptions. Popularity is calculated as [10]:

Software Component Selection Algorithm Using Intelligent Agents

89

((record hits + URL hits) * (subscriptions + 1))^(1/2) Vitality: The vitality score is calculated like [10]: (Announcements * age) / (last_announcement), For example, the number of announcements is multiplied by the number of days an application exists which is then divided by the days passed since the last release. This way, apps with lots of announcements that have been around for a long time and have recently come out with a new release earn a high vitality score, old apps that have only been announced once get a low vitality score. The vitality score is available through the repository page and can be used as a sort key for the search results[10]. Rating: Every registered user of freshmeat may rate a project featured on this website. Based on these ratings, they build a top 20 list and users may sort their search results by ratings as well. The formula gives a true Bayesian estimate [10]: (WR) = (v ÷ (v+m)) × R + (m ÷ (v+m)) × C where: WR = weighted rank R = average for the project (mean) = (Rating) v = number of votes for the project = (votes) m = minimum votes required to be listed in the top 20 (currently 20) C = the mean vote across the whole report If we compare the selection done using the popularity, vitality, and rating characteristics associated to each components with the selection done using our algorithm, we found the following results: Table 1. Result comparison among our algorithm and different type of search algorithms commonly used

Number of Evaluated Components = 24 Based on Variable Best Component (First Component) Popularity Component N. 0 Vitality Component N. 0 Rating Component N.12 Our Algorithm Component N. 0

Proposed Selection Order (First 5 Components) Components 0,23,22,21,20 Components 0,14,22,21,15 Components 12,23,0,19,20 Components 0,22,23,21,17

It is not always true that the most popular component is going to have better performance or better matching with initial user requirements. Vitality not always corresponds with the component performance and finally, rating is a very subjective selection way because it depends on user votes. Our algorithm uses not only initial user requirements (functional and non functional) but also takes on account the pheromone which is a value that we are incorporating in the component XML file and

90

B.Z. Abraham and J.C. Aguilar

it is associated to the component performance related to a specific domain. Even when the results are similar among the different ways of sorting (popularity, vitality, rating, our algorithm), in the particular case of our algorithm, component 17 is in the list of proposed selection components, this is expected because this is the component with more characteristics related to the initial user requirements and more pheromone. Component 14 and 15 have a high vitality but don’t have good matching with the user requirements, based on rating, component 12 is the best choice but this component doesn’t have good matching with user requirements. Our algorithm gives a better result because generates a list of components that not only accomplishes the initial user requirements but also uses pheromone upgrades giving an approximation related to component performance, independently of component popularity, rating or vitality. We run our algorithm using 5 functional and non functional requirements. More than one hundred tests were run, in all of them, the results were very similar, and more information can be found in [1]. The results are very interesting because they show that selection of software component based on popularity, vitality or rating is not always the best one. When software is selected popularity can be a good starting but characteristics like functionality and performance must be considered.

5 Conclusions This work presents a selection algorithm using intelligent agents, our algorithm uses a pheromone value related to component performance. Selection and search algorithms based on popularity, vitality or rating are very subjective and not always give to the users the best choices. Our algorithm uses functional and non functional requirement to make the selection; any search engine in order to find a group of components can be used and our algorithm is applied in order to select the best choices. This selection algorithm is based on pheromone values that agents upgrade depending on component performance; this gives the opportunity to each found component to be evaluated and its pheromone upgraded. Because of the generality of our model, we propose to test this algorithm with other services related to parallel, distributed and grid computing for example. It would be very interesting to use our algorithm with naming and trading services among others. In future works we will be showing the impact of dynamic composition of components, this is going to be part of a system architecture that we are working on.

Acknowledgment This work was supported in part by the France-Venezuela cooperation program Grant ECOS-NORD V04M01

References 1. Abraham B. Aguilar J. Batista J. Software Component Selection Algorithm Based on Artificial Ant Systems. Technical Report 01-2005. Centro de Estudios en Microelectronica y Sistemas Distribuidos – CEMISID, 2005. 2. [Aguilar et al., 2004] Aguilar J, Velasquez L, Pool M. "The Combinatorial Ant System", Applied Artificial Intelligence, Taylor and Francis, Vol. 18, N. 5, pp. 427-446, 2004.

Software Component Selection Algorithm Using Intelligent Agents

91

3. Barros T, Ludovic H and Madelaine E. Behavioral Models for Hierarchical Components. Spin 2005. 4. Bonabeau E, Dorigo M, Theraulaz G. Swarm Intelligence. From Natural to Artificial Systems. Oxford University Press. 1999. 5. ComponentSource. www.componentsource.com Accesed in oct. 2005. 6. Dellarocas C. Software Component Interconection Should be Treated as a Distinct Distinct Problem. Proceedings of the 8th Annual Workshop on Software Reuse. 1997. 7. Fischer B, Deduction-Based Software Component Retrieval. Mathematic and Informatics Faculty. University of Passau Germany, Thesis Report. November 2001. 8. Gómez-Perez A, Lozano A. Impact of Software Components Characteristics above Decision-making Factors, 2000 International Workshop on Component-Based Software Engineering (CBSE 2000), Limerick, Ireland, 2000. 9. Hamlet D, Mason D, Woit D. Theory of System Reliability Based on Components. In Workshop Proceedings, ICSE 2000, 3rd Workshop on CBSE (W09), Limerick, Ireland, May 2000 10. Search Engine, http://freshmeat.net, Accessed in 12/Oct/2005 . 11. Seacord, R.; Hissan, S.; Wallnau, K, "Agora: A Search Engine for Software Components", IEEE Internet Computing, vol.2, no.6, November/December, 1998, pp. 62-70. 12. Silvestri F, Puppin D, Laforenza D. Toward a Search Architecture for Software Components. ISTI-CNR, Italy, January 2004. 13. Sugumaran V and Storey V. A Semantic Based Approach to Component Retrieval. The Data Base for Advances in Information Systems – Summer 2003 (Vol. 34, No.3) 14. Wooldridge, J.P. Muller, M. Tambe (eds.). Assistant Agents that Distribute How-To-Do Knowledge. Intelligent Agents II. Lecture Notes in AI, Volume 1037. pages 408-411. Springer-Verlag, 1996

Suggest Documents