A genetic algorithm-based approach for automated refactoring of component

所需积分/C币:3 2017-07-14 1.6MB pdf
评分

Context: During its lifecycle, a software system undergoes repeated modifications to quickly fulfill new requirements, but its underlying design is not properly adjusted after each update. This leads to the emergence of bad smells. Refactoring provides a de facto behavior-preserving approach to elim
S. Kebir et al. /Information and Software Technology 88(2017)17-36 XML configuration to reify components and interfaces. Such possibly better) solutions that provide the best approximation of resources contain machine-readable metadata, typically including the optimum for the problem under investigation To this end, GAs interface signatures and descriptions of bindings between compo- rely on three key aspects nents(through the use of their provided and required interfaces) [19, 20]. Consequently, the source code model must also reflect such metadata to be in complete conformance with the internal An individual representation, used to encode a solution to the design of the software problem through an appropriate da both efficiently measuring its quality and moving to its neighbors in 2. 2. A set of component-relevant bad smells the solution space. Furthermore, individuals are composed of two elements: the genotype is a basic data structure (e.g, a list The main reason to refactor is to eliminate bad smells. Cur of integers) on which the genetic operators (e. g,, crossover and rently, object-oriented refactorings are associated with a set of mutation) act, and the phenotype is a solution to the problem, object-oriented bad smells, such as god class, long method or feature that is it is a structure that is used to calculate the fitness. envy 3. Therefore, considering such bad smells in component A fitness function, which is a means to assess the goodness" based software is not adequate since they are insufficient to ex of a given individual The fitness of an individual reflects how press bad situations at the component level due to the additional well it solves the problem under investigation. GAs require this level of abstraction introduced by components and interfaces quality function to confront individuals and thereby guide the search toward the desired solutions Recently, Garcia et al. [21 attempted to propose a catalog of component-relevant bad smells that they encountered in the A set of operators to produce new neighborhood solutions context of reverse engineering and refactoring of large indus tarting from existing ones. GAs require three evolutionary rial systems. Subsequently, from the same perspective, Macia operators to be defined: selection, crossover and mutation et al. [22 extended this catalog. More recently, Von Detten et al Selection is used for choosing the survivors for the next gener- [23 identified four representative component-relevant bad smells ation according to their fitness values, while providing a slight that they encountered after reverse engineering a component- opportunity to survive for some unfit individuals. Several selec based software architecture from object-oriented source code. tion schemes have been proposed in the ga literature. roulette However. in the above -cited works. the authors describe bad wheel selection 31 and tournament selection are among the smells informally using examples, textual definitions or UML did nost common methods [32]. In roulette wheel selection, a grams, maintaining that only human intuition may guide the deci probability of selection is assigned to each individual. This sion on whether some refactorings are necessary Moreover, among probability is proportional to the individual fitness In tourn all the identified component-relevant bad smells in the above ment selection, two individuals are randomly chosen from the cited studies, only a subset of them are completely described, population. Then, a randomly generated number is compared namely ambiguous interface, connector envy, scattered parasitic to a predetermined parameter k(for example, 0.80). If the functionality, component concern overload, and overused interface. random number is greater than k, then the individual with better fitness is selected for the next generation; otherwise, 2.3. A catalog of component-relevant refactorings the individual with worse fitness is selected Crossover is an operator that combines two or more individ- Even if component-based software is developed on top of uals (i.e, parents)to produce one or more new individuals component models, the majority of which rely on object tech (i.e., offspring). Different crossover techniques exist in the nology (according to two recent surveys [19, 20]), object-oriented literature. One-point crossover and two-point crossover are the refactorings appear to be inadequate in the context of component- simplest techniques. One-point crossover takes two parents based software. Indeed, object-oriented refactoring operations and randomly chooses a crossover position and swaps the such as collapse hierarchy, extract class, move method or pull up field chromosome parts after the chosen position to produce two focus on hierarchies, classes, methods and attributes, respectively offspring, whereas two-point crossover randomly chooses whereas components consist of one or more classes and interfaces two crossover positions and swaps the chromosome parts consist of classes interacting with the outside of the compo between them. Multi-point crossover, an extension of two-point nent. These different levels of granularity make object-oriented crossover,can be regarded as a generalization of the latter. refactoring unusable at the component level Uniform crossover 33 takes two parents and, in contrast to This is why refactoring has to be elevated to the level of compo one-point crossover and two-point crossover, swaps single nents and interfaces to our knowledge. the few studies that have genes rather than parts of the chromosomes. The number of addressed this topic merely proposed ad hoc component-relevant swapped genes is determined in advance. refactorings that are valid only in the context of their approach Mutation is an operator that is used to randomly modify small [23, 30]. Recently, in our previous works [ 25.26, we attempted parts of an individual to prevent the ga from converging to a to propose a general-purpose catalog of component-relevant local optimum Mutation typically consists of flipping randomly refactorings containing the following refactoring operations: pull chosen genes with some probability. Several mutation methods interface, push component, extract component, and extract interface exist in the ga literature. Each of these methods depends on In this paper, we improve this catalog by emphasizing important he solution representation. For example, flip bit mutation, properties of the proposed refactoring operations. which inverts all the genes of an individual if the latter is en coded using a binary representation, and swap mutation, which 2.4. Genetic algorithms exchanges two randomly chosen genes in the chromosome, can be applied on a non-binary representation Genetic algorithms (GAs) [31 are evolutionary algorithms inspired by the darwinian theory of natural evolution. these algo A Ga essentially proceeds as follows: first, it randomly gen rithms simulate the evolution of species, emphasizing the law of erates an initial population (line 2); then, it performs crossovers survival of the nearly best, to solve optimization problems. These and mutations on the fittest elements of this population until the algorithms start from a set of initial individuals (i.e, solutions)and chosen number of generations is reached (lines 3-9). Finally, it use naturally inspired evolution mechanisms to derive new(and returns the resulting population (line 10) S Kebir et aL Information and Software Technology 88(2017)17-36 Number of Population Mutation/Crossover Generations Size Probability Facts Geneti Extraction Algorithm Source Code Source code Proposed Refactorings Bad smells Catalog of Detection rules Refactorings Fig. 1. Third and fourth steps of our approach Input: Number of generations nb Output: Population p ComponentA ←0; ClassB 2 p<initialPopulationo 3 while i< nb do +processED I PubliclnterfaceA 4|p′< SELECt(P); 5 CROSSOVER(P): MUTATE(P); ClassA ocess 7p←p 1; 9 end +processEd 10 return Fig. 2. Example of an ambiguous interface(adapted from (21) 3. Solution approach smells, maintaining that architects can use these definitions and We decompose our approach into a workflow that contains diagrams as patterns to inspect their own designs for bad smells four steps. In the first step, we study definitions of component- In this paper, we focus only on bad smells that have been relevant bad smells from the literature, and based on this study, described in the above-cited works, namely, ambiguous interface, we formulate detection rules. In the second step, we propose connector envy, scattered parasitic functionality, component con refactoring patterns for each studied bad smell. Note that the first cern overload, and overused interface. After examining these bad two steps are not part of the optimization process and do not smells, we observed that the definitions given by the authors are depend on the source code of a specific software. In short, they somewhat ambiguous and prone to subjective interpretation. For are performed only once and produce the following two artifacts example, there are some words that are often used by the authors o define bad smells, such as " extensive,"some,"multiple, and a set of detection rules that are used later during the definition overly" which are obviously vague of the fitness function In this section we formulate detection rules for each A catalog of refactorings that acts as a repository used by the component-relevant bad smell studied in this work. To this optimization technique during the exploration of the search end, we first revisit each definition proposed by the authors, but with highlighting of important passages. Then, we attempt to The two remaining steps of our approach are illustrated in decrease the ambiguity of each definition by reformulating it as ig. 1. In the third step of our approach, the source code model a set of criteria that characterize the bad smell. Subsequently is constructed from the given source code of a component-based by refining these criteria, we extract measurable properties that software. We call this step facts extraction. Once the source code pertain to internal attributes of the constituents of our source code model. finally we formulate a normalized detection rule model has been constructed, exploration of the solution space is performed using a genetic algorithm. The latter uses bad smell whose range belongs to [0.0, 1.0 as a linear combination of these detection rules as a fitness function and the catalog of refactoring measurable properties. We believe that this normalization is meaningful because it reflects how much a component or an produced in the second step as a means to explore the search space. In the following subsections, we provide more details about interface is suffering from a given bad smell. each of these steps 3. 1.1. Ambiguous interface Definition. A component suffering from an ambiguous interface 3. 1. Formulation of detection rules for component-relevant bad smells /21 offers only a single, general entry point. Such an interface is referred to as ambiguous. Mol it dispatches requests to Garcia et al. [211 and Macia et al. [22 identified five internal services not belonging to any interface. component-relevant bad smells and studied their negative impacts on quality properties. They defined bad smells using textual Characterization. As highlighted in the previous definition, d definitions and, in some cases, using generic schematic views of component suffering from an ambiguous interface is characterized one or more UML diagrams. However, the authors did not provide by three criteria. These criteria are depicted in Fig. 2. First, the the symptoms that may guide the automatic detection of such bad component Componenta offers only a single provided interface S Kebir et aL. Information and Software Technology 88(2017)17-36 Delegates the majority of ComponentB requests to componentA Component Component class B Second, the latter offers only a single service called process (). extent to which a component suffers from connector envy Third, requests to this interface are internally dispatched to other classes(classa and classb)that do not belong to any interface. CE(C) C(SOC(i, j)USOC(, DD +icc(o Detection rule. According to the previously defined criteria, to 2 Eik ( SoC(i, k)U SOC(k,il state whether a component suffers from an ambiguous interface e need to know the number of its provided interfac d t total number of their services(2). The lower these two numbers are where the more likely the component is to have ambiguous interfaces LCC(c denotes the cohesion of the classes belonging to the Therefore. this information alone is not sufficient to assess the component c according to the commonly used loose class extent to which the interface is ambiguous. Indeed following the second part of the definition, we also need to know how much the cohesion metric proposed by Bieman and Kang in [34] interface dispatches requests to other internal services not belonging to any interface 3). Thus, we define the following rule to assess the 3. 1.3. Component concern overload extent to which a component suffers from this bad smell Definition. Components with concern overload are responsible for calizing two or more unrelated architectural concerns/22. jeQ\ SoC(i, j)I Characterization. Following the previous definition, only one cri Cpl∑|SOS(i) i∈Cp isC.p,ec/ Soc(i, k) (1) terion characterizes the presence of component concern overload in a component: the latter is responsible for realizing many functionalities at the same time where Detection rule. This bad smell can easily be detected by measuring the cohesion of the component. The lower this measure is, the C p denotes the set of provided interfaces of the component C SOS(i) denotes the set of services belonging to the interface i more the component is suffering from concern overload. Thus SoC(i, j) denotes the set of calls from services belonging to d we propose the following rule to assess the extent to which a class i to public methods belonging to the class j component is overloaded with many concerns CCO(O=I-LCC(C (3) 3. 1.2. Connector envy Definition. A component with connector envy encompasses exten- 3. 1.4. Scattered parasitic functionality sive interaction-related functionality between two or more other Definition. This bad smell occurs in a system where multiple com components(21/ ponents are responsible for realizing the same high-level concern, additionally, some of these components are individually responsible Characterization as stated in the definition two criteria charac for an additional unrelated concern/21), terize a component suffering from connector envy. Fig 3 illustrates an example that emphasizes these criteria. First, the component Characterization. The previous definition states that scattered ComponentB acts as an intermediary between two components parasitic functionality can affect a set of two or more components ComponentC and ComponentA) such that it receives requests characterized by two criteria. These criteria are highlighted i from Component and dispatches the majority of the requests to Fig. 4. First, the set of components collaborate together to realize a ComponentA. Second, it has only one proper functionality, which shared functionality. Second, there may be some components, for is delegating requests between ComponentA and Component. example, ComponentB and Component C, that are also realizing an additional functionality Detection rule. According to the previous definition, a component suffering from this bad smell delegates the majority of its requests Detection rule. Given a set of components, to detect this bad to other components. Therefore, the number of its incoming and smell, we need to measure the overall cohesion of the components outgoing calls1) should be high. To measure this number, we and the individual cohesion of each component The higher the calculate the ratio of external calls to and from the component overall cohesion! 1)is, the more a functionality is scattered among over the total calls generated by the component. Furthermore, its this set of components. Furthermore, the lower the cohesion of cohesion(2)should be high since it has only one proper respon- each component(2) is, the more it is responsible for realizing sibility. Consequently, we define the following rule to assess the two or more unrelated concerns. Thus, to detect this bad smell, S. Kebir et aL Information and Software Technology 88(2017)17-36 ComponentA ComponentB ClassB1 ClassB2 SharedConcern +Shared Concern +shared concern +ConcernBO Component Classc1 Classc2 +Shared concern +Concerned Fig. 4. Example of a scattered parasitic functionality(adapted from [21 D) rvice10 servce ComponentB ComponentA ublicInterfaceA +service1 Component +servicer +services 十se Uses only Component services Uses onl 40 service 60 Fig. 5. Example of an overused interface we propose the following rule to assess if a set of components but respectively use only a subset of the services offered by the S=C1. C2,.. Cn suffers from scattered parasitic functionality latter Detection rule. This bad smell can be detected by measuring the SPF(S)=5C(S+∑ 1-LCC(Ci) number of services invoked together from the same client for each G∈S client of a given interface. The higher this number is, the less the interface is overused. Thus, similar to [35], we propose detecting this bad smell by measuring the average of the ratio of services 3. 1.5. Overused interface evoked from all the clients of a given interface using the following Definition. Also called fat interfaces35, these are interfaces whose rule clients invoke different subsets of their services/22/ Characterization. According to the previous definition, only one 00=ENTS∑SOCO CKECLIENTS(O) SOS(il (5) criterion characterizes a provided interface that is likely to be suffering from overused interface. Fig. 5 depicts an example wher hat emphasizes this criterion. In this example, components on the right-hand side namely, ComponentB, Component and CLIENTS(i) denotes the set of clients that are using the interface Component, require the interface called PublicinterfaceA S Kebir et aL. Information and Software Technology 88(2017)17-36 Table 1 Refactoring template Summary The summary of the refactoring must reflect in a concise manner what action is performed by the refactoring and where it has to be performed Contex The context summarizes the situation when the refactoring should be applied. The context is given for information purposes only, meaning that in a given situation, the corresponding refactoring is not necessarily the most suitable one since the application of a refactoring may negatively impact the presence of other bad smells [7. hence the necessity of opting for a search-based technic Motivatio The motivation explains why the refactoring should be performed by assessing the benefits brought to quality attributes. This is expressed by sting the affected attributes preceded by A or, meaning increase or decrease, respectively Parameters The parameters represent which constructs are affected by the refactoring, in addition to further required information Mechanics The mechanics describe how to perform the refactoring by explaining the necessary transformation steps to be conducted Table 2 Table 3 Pull up interface Extract component. Sumllllary Create d new provided interface Extract d component from another ontext Ambiguous Interface Context Component concern overload Motivation Analyzability Motivation X Cohesion Parameters In: sourcc: Componcnt, c: Class dc tangling Mechanics source. getInterfaces().add(c) Parameters In: source: Component, classes: Set of Classes source. getInnerClasses(. remove(c); Out: target: Componen Mechanic source. getClassesO. removeAll(classes); target. getclasses(. addAll (classes) 3. 2. Proposition of a catalog of component-relevant refactorings As mentioned in Section 2.3, object-oriented refactoring fails Table 4 Em bed component. for component-based software systems, which motivates the need for a component-relevant refactoring catalog. Such a cat Summary Embed a component into another alog should be sufficiently abstract to be applicable to different Context Scattered parasitic functionality Connector envy component models Motivation In this section, we propose such a catalog to remove the pre N Coupling viously described bad smells. Similar to Fowler's approach 3]. Parameters In: source: Component, target: CoIn ponent each refactoring, we describe its significant properties(summary for each Class c in source. getInner Classes context, motivations, parameters and mechanics )in the following target. getInnerClasses().add(c) source. getInnerClasses(.remove(c) using the template described in Table 1 for each Class i in source. getInterfacesot 3.2. 1. Pull up interface target. getInterfaceso.add(i); This refactoring consists of creating a newly provided interface source. getInterfaceso)remove(i) for a given component. It can be used when there are classes that offer public methods but are not defined as provided interface such as in a component suffering from an ambiguous interface a concern is no longer scattered among a set of elements. Thus, applying this refactoring, the analyzability and understandability the separation of concerns of the component are increased since a user is no longer required to look into the implementation of the component to know about be performed by moving all the classes belonging to a component the services that it offers. Performing this refactoring involves into another one and deleting the old component (Table 4) transforming a given class into a provided interface by using the 3.2.4. Extract interface underlying component model mechanisms ( Table 2) This refactoring consists of extracting a new interface from 3. 2.2. Extract component an existing one. It may be used in an interface suffering from This refactoring consists of extracting a new component from an overused interface. After extracting a sub-interface from an an existing one. It may be used in a component suffering from overused interface, clients of the latter no longer depend on ser component concern overload, where the separation of concerns vices that they never invoke. This fulfills the interface segregation principle [36 performing this refactoring involves moving a subset principle is violated since an element is responsible for two or of services belonging to a given interface to a newly created one. more concerns. By applying this refactoring, cohesion is increased, as well as reusability in that the component can be reused else- (Table 5) where. This refactoring can be performed by moving a subset of classes belonging to a given component to a newly created one 33. Facts extraction (Table 3 During this step, the source code and additional metadata 3. 3. Embed component (e.g., XML configuration files )are transformed into a source code an extraction engine. Such an engine depends on This refactoring consists of embedding a component into the component model, the underlying programming language another. it can be used in two situations the first situation is when two or more components are individually responsible for and additional component-model specific resources such as XML implementing the same wide scope concern, such as in the pres and manifest configuration files. At present, we have successfully ence of a scattered parasitic functionality. The second situation designed and implemented an extraction engine for the OSGi is when a component suffers from component envy and it only component model using the aPi provided by Eclipse DT. 3 delegates requests from one component to another; thus, it has to be integrated to one or the other. By applying this refactoring, 3EclipseJdt.http://eclipse.org/jdt/ S. Kebir et aL. Information and Software Technology 88(2017)17-36 5 Extract component Summary Extract a new interface from an existing one Context Overused interface Motivation Interface segregation principle A Reusability Parameters In: source: Interface. services: Set of services Out: target: Interface Mechanics source. get(.removeAll(services) target new Interface(); target addAll(services) sourcegetParent(. getInterfaces( add(target) CBSE Elements Oo Elements Component class 1 Interface Service Method 1 callee allet Required Provided call Interface Interface g de meta model This engine is able to construct the source code model of an An instance of this meta-model allows the following questions OSGi application in conformance with a pre-established meta- to be answered. How many provided interfaces does a component model. To define such a meta-model, we rely on the following two have? What are the provided services of a given interface? How assumptions many ingoing and outgoing calls does a component have? does a given class belong to a provided interface? First, according to three recent surveys, the first one conducted The answers to these questions constitute valuable information by vale et al. [20] the second one by Crnkovic et al. [19 and that can be used during the formulation of detection rules for bad the third one by Lau et al. 37], it is stated that almost al smells major component models use object-oriented constructs and additional metadata to reify components and interfaces 3. 4. Genetic algorithm Second, according to Birkmeier and overage 38 and Wang et al. [39], many objects-to-components reverse engineering To implement a GA for automated refactoring of component- approaches are based on clustering algorithms that act on an based software, we describe how we have implemented each object-oriented system to produce partitions of classes with the elements defined in Section 2. 4 and how they are articulated high intra-cohesion and loose inter-coupling within the ga in the following 3. 41. Individuals In other words, components are considered as sets of classes and interfaces are those classes that have a link with some classes To represent individuals, we use a structure composed of two elements. from the outside of the component(e.g, a method call or attribute use). Based on these assumptions, we defined in our previous The genotype which is an ordered variable-length sequence works [26, 40] d mapping model between object-oriented concepts of refactorings including necessary parameters. When the (i.e., classes, interfaces, packages, methods, and method calls sequence of refactorings is executed, it performs these changes d component-based software engineering ones (i.e, compo and produces a modified version of the source code model nents, interfaces, services, and bindings). In Fig. 6, we propose an The phenotype which is the current source code model in adaptation of this model that acts as a source code meta-model accordance with the meta-model described in section 3.3 S. Kebir et al. /Information and Software Technology 88(2017)17-36 each individual in the current population with a given probability. Phenotype Genotype In the following, we present how we have implemented each of these three operators pullInterface(C5, C1) extractComponent(C6, c1, c2, c3 Selection: In our prototype, we adopt roulette wheel selection cf. Section 2.4). All of the selected individuals will form a embed Component(C3, C2) mating pool for crossover and mutation utation:Our mutation operator either replaces a randomly Source Code extractInterface(C3i1, ( s1, S2)) chosen refactoring operation with a new one or randomly Model embed Component(C1, C4) inserts/deletes a new refactoring operation at a given position of the genotype. The probability of performing a mutation is ig. 7. Individual representation chosen by the user as a parameter of the GA. An example of mutation is shown in Fig 8. Crossover: We adopt the one-point crossover operator, which The phenotype is obtained by performing the sequence of conceptually operates on two genotypes (sequence of refactor- refactorings on the initial source code model in the order that ings in our case) at a time and generates offspring by cutting is given in the genotype. each of the two parent individuals into two subsets of genes Fig. 7 depicts an example of an individual representation this Then, two new individuals are created by interleaving the two representation carries the following key benefits. First, our use of subsets. An example of crossover is shown in Fig 9. We opted a source code model as a phenotype to represent the component for the one-point crossover rather than the two-point or multi based software design enables the efficient computation of bad point crossover because our preliminary experiments indicated smell detection rules. Second, we provide the genotype with the that the use of two-point or multi-point crossover generates possibility to contain invalid refactorings. By invalid refactoring, we offspring that contain a higher number of invalid refactorings mean that it is not able to be performed on the initial source code Note that the crossover operator that we use here can produce model. for instance. a refactoring can lead to incoherent situations ffspring that contain a genotype with a size that differs from that by breaking the necessary preconditions for the following ones of parents. In the same way, our mutation operator can reduce (e.g, push component can prevent other refactorings involving the or increase the number of refactorings contained in the genotype. same component since the component no longer exists) In such That is, in our implementation, the genotype has an unlimited cases, we simply consider the following ones as invalid. However, length. Additionally, all individuals across the population do not we do not exclude them from the genotype since they may be have the same genotype length. a particular problem that arises in valid for the next generation. This allows exploring the solution the crossover operator when using variable length genotypes is the space more efficiently random choice of the position of cutting points. Indeed, if the cut ting points are close to the beginning or end of the genome, one 3.4.2. Fitness function of the resulting children may contain a significantly small number In our approach, the fitness function is the sum of the five of refactorings We mitigate this problem by providing the cutting above-defined rules used to detect bad smells in all components points more chance to be close to the middle of the genome and interfaces of the application. Thus, the fitness function of our ga is defined as follows 4. Evaluation fitness (S)=∑(A)-CE()+Co)+∑o In this section, we present our evaluation of the Ga on real- I∈C.p world applications. Currently, only the oSgi* component model is SPF(S) considered. In OSGi, a component is known as a bundle[ 19]. each 6)bundle is defined by a JAR file containing named packages and a S∈ partitions(S) manifest file containing the description of the bundle interaction where with the other ones, mainly the exported packages that are meant partitions() denotes the set of partitions of s where an indirect to reify provided interfaces and in a dual manner the imported path exists that connects all the components of the partition. packages that are meant to reify required interfaces. In this sec tion, we present the systems that we used for our experiments The fitness function is evaluated on an individual by (i) running and we examine and discuss the obtained results the sequence of refactoring operations contained in its genotype and(ii)evaluating the detection rules on the resulting source code 4.1. Systems under investigation model contained in its phenotype. The higher the value of the fitness function is, the more bad smells that the system contains We conducted experiments on an unbiased set of four OSGi The motivation for using bad smell detection rules as part of our real-world applications. Table 6 provides a descriptive overview of fitness function is that they are conjectured in the literature to these systems impact the overall quality of systems. Moreover, since refactorings Eclipse mat is a standalone application that supports pro are associated with a set of bad smells [3], this provides us with grammers in detecting memory leaks. Eclipselink is a library that the opportunity to observe how effective ours are in removing includes a comprehensive runtime persistence solution addressing component-relevant bad smells by analyzing the resulting source relational databases, XML data and web services. Equinox'is the code model at a given step of our genetic algorithm reference implementation of the OSGi core framework specifica- tion. It provides a wide array of bundles that implement various 3.4.3. Evolutionary operators In each iteration, the ga starts by selecting individuals. This OsgiAlliancehttps://www.osgi.org/ selection is based on the fitness value of individuals Then the 5 Eclipse Memory Analyzer Open Source Projcct. eclipse. org/mat offspring is generated by applying crossover on each pair to gener- 6 EclipseLink. eclipse. org/eclipselink/ ate two new individuals. Subsequently the mutation is applied on Equinox -Eclipse eclipse. org/equinox S Kebir et aL Information and Software Technology 88(2017)17-36 Genotype Genotype pullInterface(C5, c1) pullInterface(C5, c1) extractComponent(C6, c1, C2, C3n) extractcompanent(C6,c1, C2, C35 embed Component(C3, C2) extractComponent(C2, c4, c5]) Mutation extractInterface(C3 i1, (s1, s2)) extractInterface(C3i1,s1, s2]) embed Component(C1, C4) embed Component(C1, C4) Fig 8. Example of mutation that replaces a refactoring by a randd omly chosen one Genotype Genotype extractInterface(C2i3, s1, s2)) ullInterface (C4, c 2) embedcomponent(C1, C6) extractInterface(C6 i1,s1, s2)) extractComponent(C4,(c1,c2,c3))cutting extract Component(C6, c1, c2, c3]) pullInterface(C3, C2) oint Cutting embedcomponent(C1, C6) embed Component(C5, C4) point embedComponent(C2, C1) embedComponent(C3, C6) pullIntertace( C6,c9) embed Component(C3, C2) extractComponent(C3, c1, c3)) Before crossover After crossover Crossover G enotype Genotype extractInterface(C2 i3, ( s1, s2)) ullInterlace (C4, C2) embedcomponent(c1, C6 extractnterface(c6 i1,s1, s2) extractComponent(C4, c1, C2, C3) extractComponent(C6, c1, C2, C3)) pulllnterface(C3, c2) embedComponent(C1, C6) pullnterface(C6, c9) embed Component(C2, C1) embed Component(C3, C2) embed Component(C5,C4) extractComponent(C3, c1, C3)) embed Component(C3, C6) ple of cI I, Table 6 Overview of studied systems System of components of classes Eclipse MAT v1.4.0 Standalone application 12 613 Fclipsel. ink v2.6.2 Library 3842 Runtime framework 91 BIRT V4.5.0 Eclipse plugin 100 7770 optional OSGi services. Finally, birT is an eclipse top-level plugin software source code management systems. The selected software that allows reporting and business intelligence activities based on systems cover a wide range of software products of different types data from different data sources (e. g, GUL, library, framework, and eclipse plugin), and their usage We selected these four applications for our evaluation according is intended for different types of users(e.g, debugger, developer to the following criteria. The source code and the documentation programmer, and report designer ). Even if they are closely related of these systems are freely available through official websites and to sub-projects of Eclipse, these systems are developed by differ ent teams and target different areas of application. Finally, their sizes range from medium to large. In addition, their components 8 BIRT Home -Eclipse eclipse. org/birt/ vary in granularity (i.e., number of classes per component). For

...展开详情
立即下载 最低0.43元/次 学生认证VIP会员7折
举报 举报 收藏 收藏
分享
8KB
neural-network-genetic-algorithm, 用遗传算法进化神经网络.zip

neural-network-genetic-algorithm, 用遗传算法进化神经网络 用遗传算法进化神经网络的方法这就是我们如何使用遗传算法来寻找分类任务的最佳网络参数的一个例子。它目前仅限于 IE ( 。 完全连接的网络,并使用Keras库构建。培训和验证。在 easy MNIST数据集上,我们能够快速找到一个达到&

2019-10-09 立即下载
259KB
Priority-Based Genetic Algorithm for Shortest Path Routing Problem in OSPF

Priority-Based Genetic Algorithm for Shortest Path Routing Problem in OSPF 主要介绍了遗传算法求解最短路径问题中的基于优先级的编码。这种编码方式可以很有效地解决图的最短路径等问题。

2019-09-08 立即下载
324KB
智能二代(Genetic Algorithm)饲料配方软件

智能二代(Genetic Algorithm)饲料配方软件,氨基酸比例最佳模型计算猪鸡配方

2015-06-02 立即下载
228KB
论文研究-SGA(Simplex-Genetic Algorithm):一类求解Minimax问题的通用算法.pdf

论文研究-SGA(Simplex-Genetic Algorithm):一类求解Minimax问题的通用算法.pdf,  在指出一般的迭代法不能保证收敛性之后,将注意力投向基于Stackelberg-NashEquilibrium的遗传算法(GA)的解决方法,并根据Minimax问题的特点指出该方法的不足之处.在此基础上,提出了SGA(Simplex-GeneticAlgorithm).仿真

2019-09-20 立即下载
104KB
matlab开发-使用geneticalgorithm解决旅行销售问题

matlab开发-使用geneticalgorithm解决旅行销售问题。图形用户界面,无图形用户界面版本,描述见docx文件

2019-08-23 立即下载
11KB
GENETIC algorithm.R

本代码实现了遗传算法在R语言中的实现,同时可以实现并行化运算,加快了搜索和优化效率

2019-08-21 立即下载
1KB
matlab开发-geneticalgorithm

matlab开发-geneticalgorithm。所需函数的遗传算法实例

2019-08-27 立即下载
977KB
遗传算法Genetic Algorithm and Direct Search Toolbox[1][1].part2

遗传算法Genetic Algorithm and Direct Search Toolbox[1][1].part2

2010-08-28 立即下载
16KB
遗传算法(GeneticAlgorithm)的Java实现源码工程

遗传算法(GeneticAlgorithm)的Java实现源码工程,可导入eclipse后可直接运行工程,main方法在类GeneticAlgorithmTest文件中。带有图形界面动态展示遗传算法的收敛过程。你可以在此基础上改动后运用于你的项目中。

2016-11-26 立即下载
3KB
matlab开发-GeneticAlgorithm

matlab开发-GeneticAlgorithm。多模态函数优化

2019-08-23 立即下载
113KB
A Genetic Algorithm With New Individual Selection Scheme and Computational Experiments on Vehicle Routing

A Genetic Algorithm With New Individual Selection Scheme and Computational Experiments on Vehicle Routing,吴永忠,,In genetic algorithm, the individual selection scheme defines how individual solutions are selected for survival into every new generation, and plays an important role in achieving

2020-01-15 立即下载
20.47MB
Genetic Algorithms and Genetic Programming

Genetic Algorithms and Genetic Programming - Modern Concepts and Practical Applications

2012-01-11 立即下载
5KB
matlab开发-openmultipletravelingsales菜单问题geneticalgorithm

matlab开发-openmultipletravelingsales菜单问题geneticalgorithm。使用遗传算法找到m-tsp“开放”变量的近似最优解

2019-08-24 立即下载
2KB
matlab开发-使用tkalkwarfthodosmodel的geneticalgorithm确定模型

matlab开发-使用tkalkwarfthodosmodel的geneticalgorithm确定模型。计算forst-kalkwarf-thodos模型的四个参数

2019-08-26 立即下载
1.18MB
个人总结的遗传算法及Matlab实现-Genetic algorithm 学习总结.rar

个人总结的遗传算法及Matlab实现-Genetic algorithm 学习总结.rar 最近学习遗传算法及Matlab实现,看书的过程中做了总结性的笔记,供初学者参考,适于快速入门,并运用Matlab遗传算法工具箱实现遗传算法。 欢迎批评指正! Genntic Algorithm 学习总结遗传算法是一种基于自然群体遗传演化机制的探索算法,它摒弃了传统的搜索方式,模拟自然界生物进化过程,采用人工进化的方式对目标空间进行随机化搜索。 一、基本原理:

2019-08-13 立即下载
9KB
遗传算法相关程序分享-GeneticAlgorithm.rar

遗传算法相关程序分享-GeneticAlgorithm.rar 上传附件中包括经典遗传算法、自适应遗传算法、双切点遗传算法,大变异遗传算等等!程序已经过调试,在2014a中运行无误,如有需要请自行下载,如有疑问请站内来函咨询!

2019-08-12 立即下载
5KB
matlab开发-由geneticalgorithm解决的MDMTSPvgamultipleepotm多行程销售问题

matlab开发-由geneticalgorithm解决的MDMTSPvgamultipleepotm多行程销售问题。销售人员数量可变的多个仓库的遗传算法求解

2019-08-23 立即下载
885KB
A Survey on Software Testing Techniques using Genetic Algorithm

遗传算法(Genetic Algorithm)是模拟达尔文生物进化论的自然选择和遗传学机理的生物进化过程的计算模型,是一种通过模拟自然进化过程搜索最优解的方法。

2019-01-01 立即下载
366KB
论文研究-TTS-Coded Genetic Algorithm for QoS-driven Web Service Selection.pdf

用基于TTS编码的遗传算法解决QoS驱动的Web服务选择问题,张蕾,双锴,为了在Web服务组合过程中达到最大的用户满意度,本文采用了一种基于树遍历顺序编码方式(TTS)的新颖的遗传算法。通过利用遗传种群

2019-08-14 立即下载
17.33MB
Fuzzy Control Systems

Foreword Author's Biographical Information Part A—General Theory Chapter 1—Learning Algorithms for Neuro-Fuzzy Networks 1 Introduction 2 Neuro-Fuzzy Networks 2.1 The Conventional Fuzzy Model 2.2 From Fuzzy to Neuro-Fuzzy

2008-10-06 立即下载
img
小和和

关注 私信 TA的资源

上传资源赚积分,得勋章
相关内容推荐