4
International Journal of Scientific Research Engineering & Technology (IJSRET) Volume 2 Issue 10 pp 683-686 January 2014 www.ijsret.org ISSN 2278 – 0882 IJSRET @ 2014 Crosscutting Concern Identification Using Graph Theory Richa Singh Banaras Hindu University Tapan Kant* Banaras Hindu University Manjari Gupta Banaras Hindu University Abstract The process of determining crosscutting candidates through aspect mining and refactoring those candidates in existing software system is, for a good AOP [1].In this paper we proposed a graph based technique for identifying the crosscutting candidates. We are providing in initial assessment from the existing [2] how a vector space model and identification of crosscutting concerns steps proposed our algorithm based on crosscutting concerns graph algorithm. This algorithm is used to identify the concerns in the system on the basis of distance between methods in the graph. Index TermsAspect Mining, Aspect Oriented Programming, Crosscutting Concern, Vector-Space- Model, Object-Oriented-Programming. [1] INTRODUCTION Aspect oriented programming is a new prototype that is initiated to design and execute crosscutting concerns [1]. AOP mainly tackle the modularity limitations of Object oriented programming (OOP). It attempts to effectively sum up the crosscutting concerns to form a new type of module known as an aspect [19]. An Aspect is a modular unit of crosscutting implementation. It is defined very much like a class, and can have methods, fields, constructors, initializers, named pointcuts, and advices [1]. At compile time, the aspect is weaved to generate the final system, using a special tool called weaver. Crosscutting concerns are characteristics of software system whose implementations are spread over the source code. Crosscutting concerns in non AO have two symptoms. Code Scattering: the code for one concern is spread across the system. Code tangling: in order to implement one concern the programmer needs to address or crosscut another concerns as well. Aspect mining is a process that tries to identify crosscutting concerns in existing software systems. The goal is to refactor the existing systems to use aspect oriented programming to make them easier to maintain and to evolve [3]. [1.1] Aspect Mining Aspect mining is a relatively new research direction that tries to identify crosscutting concerns in already developed software systems without using AOP [3]. The goal is to identify them and then to refactor them to aspects, to achieve a system that can be easily understood, maintained and modified. Aspect Mining is a reverse software engineering exploration technique that is concerned with the development of concepts, principles, methods and tools supporting the identification and extraction of re-factorable aspect candidates in legacy software systems [4]. To achieve this level of modularization in legacy and traditional object-oriented applications, candidates for refactoring first need to be identified. This step is known as aspect mining [5]. In other words, aspect mining refers to the discovery of potential crosscutting concerns that can be modularized into aspects. Through Aspect mining technique we can identify crosscutting concerns during software development lifecycle or in already developed software system. The goal of these techniques is to provide an overview of the source-code entities that play a role in a particular crosscutting concern. This not only improves the understandability of the concern in particular and of the software in general, but also provides a first step in the migration towards applying aspect-oriented software development techniques [5].

Crosscutting Concern Identification Using Graph Theory

  • Upload
    ijsret

  • View
    7

  • Download
    0

Embed Size (px)

DESCRIPTION

The process of determining crosscutting candidates through aspect mining and refactoring those candidates in existing software system is, for a good AOP [1].In this paper we proposed a graph based technique for identifying the crosscutting candidates. We are providing in initial assessment from the existing [2] how a vector space model and identification of crosscutting concerns steps proposed our algorithm based on crosscutting concerns graph algorithm. This algorithm is used to identify the concerns in the system on the basis of distance between methods in the graph.

Citation preview

Page 1: Crosscutting Concern Identification Using Graph Theory

International Journal of Scientific Research Engineering & Technology (IJSRET)Volume 2 Issue 10 pp 683-686 January 2014 www.ijsret.org ISSN 2278 – 0882

IJSRET @ 2014

Crosscutting Concern Identification Using Graph Theory

Richa SinghBanaras Hindu University

Tapan Kant*Banaras Hindu University

Manjari GuptaBanaras Hindu University

AbstractThe process of determining crosscutting candidatesthrough aspect mining and refactoring those candidatesin existing software system is, for a good AOP [1].In thispaper we proposed a graph based technique foridentifying the crosscutting candidates. We are providingin initial assessment from the existing [2] how a vectorspace model and identification of crosscutting concernssteps proposed our algorithm based on crosscuttingconcerns graph algorithm. This algorithm is used toidentify the concerns in the system on the basis ofdistance between methods in the graph.

Index Terms—Aspect Mining, Aspect OrientedProgramming, Crosscutting Concern, Vector-Space-Model, Object-Oriented-Programming.

[1] INTRODUCTION

Aspect oriented programming is a new prototype that isinitiated to design and execute crosscutting concerns [1].AOP mainly tackle the modularity limitations of Objectoriented programming (OOP). It attempts to effectivelysum up the crosscutting concerns to form a new type ofmodule known as an aspect [19]. An Aspect is a modularunit of crosscutting implementation. It is defined verymuch like a class, and can have methods, fields,constructors, initializers, named pointcuts, and advices[1]. At compile time, the aspect is weaved to generatethe final system, using a special tool called weaver.Crosscutting concerns are characteristics of softwaresystem whose implementations are spread over thesource code. Crosscutting concerns in non AO have twosymptoms. Code Scattering: the code for one concern isspread across the system. Code tangling: in order to

implement one concern the programmer needs to addressor crosscut another concerns as well.Aspect mining is a process that tries to identifycrosscutting concerns in existing software systems. Thegoal is to refactor the existing systems to use aspectoriented programming to make them easier to maintainand to evolve [3].

[1.1] Aspect MiningAspect mining is a relatively new research direction thattries to identify crosscutting concerns in alreadydeveloped software systems without using AOP [3]. Thegoal is to identify them and then to refactor them toaspects, to achieve a system that can be easilyunderstood, maintained and modified. Aspect Mining isa reverse software engineering exploration technique thatis concerned with the development of concepts,principles, methods and tools supporting theidentification and extraction of re-factorable aspectcandidates in legacy software systems [4].To achieve this level of modularization in legacy andtraditional object-oriented applications, candidates forrefactoring first need to be identified. This step is knownas aspect mining [5]. In other words, aspect miningrefers to the discovery of potential crosscutting concernsthat can be modularized into aspects.Through Aspect mining technique we can identifycrosscutting concerns during software developmentlifecycle or in already developed software system. Thegoal of these techniques is to provide an overview of thesource-code entities that play a role in a particularcrosscutting concern. This not only improves theunderstandability of the concern in particular and of thesoftware in general, but also provides a first step in themigration towards applying aspect-oriented softwaredevelopment techniques [5].

Page 2: Crosscutting Concern Identification Using Graph Theory

International Journal of Scientific Research Engineering & Technology (IJSRET)Volume 2 Issue 10 pp 683-686 January 2014 www.ijsret.org ISSN 2278 – 0882

IJSRET @ 2014

Our approach uses clustering based aspect miningtechniques. There are just a few aspect miningtechniques which uses clustering to identify crosscuttingconcerns [2, 3, 4, 11, 13, 15].In our approach, a connected weighted graph isconstructed for a given source code, where vertices arecorresponding to methods and we assume among allmethods weights of edges are corresponding to theEuclidian distance between two methods. By applyinggiven approach described in this paper differentsubcomponents of this connected graph are identifies.These different subcomponents are corresponding todifferent crosscutting concerns in the source code. Forthis we will consider a vector space model, identificationof crosscutting concerns steps and threshold valuedescribed in [2].The paper is structured as follows, section 2 describesrelated work .Section 3 and section 4 describes a vectorspace model and identification of crosscutting concernssteps [2] which are used in our approach. Section 5,describes our approach for identification of crosscuttingconcerns and section 6 describes the system graphalgorithm. In the last section 7 we conclude and presentfuture work.

[2] RELATED WORK

Several approaches have been proposed for aspectmining till now. The first approaches in aspect miningwere the query based search techniques. The developerhad to search so called and associated tool showed allthe places where the seed was found [6].There are manytools have been developed for this as Aspect mining tool[7], Aspect browser [8], AMTEX [9],FeatureExploration and analysis tool(FEAT)[10].Later on researchers have focused on developing suchaspect mining techniques that do not require initial seedfrom the user [6]. Some of them uses fan in analysistechniques [3], [11], some of them uses Formal conceptanalysis [5], some of them use clustering ([3], [12], [13])some of them uses clone detection techniques [14].Those techniques try to identify the crosscuttingconcerns with some kind of system representation andare called automated aspect mining techniques [6]. Theseare all static approaches that analyze the source code forcrosscutting concerns. In [5] a dynamic approach waspurposed to analyze the execution of source code toidentify crosscutting concerns.In [18], proposed a clustering approach in aspect miningbased on k-means and hierarchical agglomerative

clustering techniques and in [17] some quality measuresfor evaluating the results of clustering based aspectmining techniques.

[3] VECTOR SPACE MODEL

Several approaches have been used vector space model[2] for their own purpose. We are also used the vectorspace model described in the below: In our approach thevertices to be considered are the methods from thesoftware system M = {m1,m2, ...mn}. The methodsbelong to the application classes or are called from theapplication classes. Based on the vector space model,[2]considered each method as an l-dimensional vector as M= {m1,m2, ...mn} two vector-space models haveconsidered that illustrate code scattering symptoms insoftware system [2]:1-The vector associated with the method m is {FIV,CC}, where FIV is the fan-in value [11] of m (thenumber of methods that call m) and CC is the number ofcalling classes.This model has been denoted by M1.2- The vector associated with the method m is {FIV, B1,B2, ... Bl-1}, where FIV is the fan-in value of m and Bi(1≤ i ≤ l−1) is 1, if the method m is called from a methodbelonging to the application class Ci, and 0, otherwise.We denote this model by M2.In our approach we will consider Euclidian distance as aweight of the edges between two vertices (methods) inthe connected graph. In this context the Euclidiandistance between two methods mi and mj defined as:-

dE(mi,mj) =√∑ − 2

In our approach we have chosen the value 1 for thethreshold. The reason for this choice is the following [2]:if the distance between two methods mi and mj is less orequal to 1, considered that they are similar enough to beplaced in the same (crosscutting) concern. It mentionedthat, from the aspect mining point of view, usingEuclidian distance as metric and the vector space modelproposed above, the value 1 for threshold makes thedifference between a crosscutting concern and a non-crosscutting one.

[4] IDENTIFICATION OF CROSSCUTTINGCONCERNS STEPS

The following steps [2, 3, 15 & 16] are defined foridentification of crosscutting concerns.

Page 3: Crosscutting Concern Identification Using Graph Theory

International Journal of Scientific Research Engineering & Technology (IJSRET)Volume 2 Issue 10 pp 683-686 January 2014 www.ijsret.org ISSN 2278 – 0882

IJSRET @ 2014

Step 1: Computation of set of methods in the chosensource code as well as computation of the features setvalues, for each method in the set.Step 2: Filtering techniques owned by certain datastructures categories like Array List, vectors areremoved. Also, the techniques owned by some built-incategories like String, String Builder and String Bufferare removed.Step 3: By using System graph algorithms described insection5, the remaining set of methods is arranged intoclusters. The clusters are separated by the averagedistance from the point 0m in descending order, where0m is referred to m dimensional vector with individualpart 0.Step 4: The clusters acquired are evaluated to detectwhich methods belong to crosscutting concerns. Thecluster that contain procedures owned by crosscuttingconcerns [11].

The Algorithm that would be used in step 3 we arepurposed in the next section.

[5] OUR APPROACH

Let X ={m1,m2,….mn} be a software system, where1≤i≤n is a method of the system. We consider acrosscutting concerns as a set C={c1,c2,….ccn} withC⊂m, of methods that implement this concerns. Thenumber of methods in crosscutting concerns c isCn=│C│. Let CCC = {C1, C2 …, Cq} be the set of allcrosscutting concerns that exist within X. The number ofcrosscutting concerns in the system X is thereforerepresented by q=|CCC|.In this section we describe the concept of systemCrosscutting Concern using Graph and the followingdefinitions are needed to describe our approach.

Definition1:-Let X= {m1,m2,…mn}, be softwaremethods and dE the Euclidian distance metric betweenedges (methods). We can define System graph SG as:SG=(V,E) ; Where the set of vertices V={m1,m2,….mn}of the software system X. And the set of edgesE={(mi,mj)│ mi,mjЄ V, mi≠mj} & all the edges arelabeled with the Euclidian distance as:

W (mi,mj)=dE(mi,mj)=√∑ − 2

Definition2:-Let X={m1,m2,…mn} be a software systemand dE (Euclidian distance) the metric between methodsin a multidimensional and SG the corresponding system

graph (Definition 1) We define the problem of findingthose components whose edges Euclidian distance is lessthan one i.e. dE(mi,mj)<1, in the software system X.Algorithm for finding those components of crosscuttingconcerns from system graph SG is described in the nextsection.

[6] SYSTEM GRAPH ALGORITHM

In this part we describe SG algorithm for determining thedE(mi,mj)<1,of software system X. This algorithm willbe used in grouping step in the section 4 [2] foridentification of crosscutting concerns. These are thefollowing steps in SG algorithm:-

1-Create the concerns graph as shown in definition1.2-Determine the edges whose distance between vertices(methods) is less than 1. These edges are concerns in thesoftware system X.

[7] CONCLUSIONS AND FUTURE WORKS

We have presented in this paper a new graph basedapproach in aspect mining. For this we have used systemconcerns algorithm, in the grouping step of identificationof crosscutting concerns. We will find the connectedgraph whose Euclidian distance between vertices(methods) is less than one and obtained vertices areanalyzed in order to identify crosscutting concerns fromthe system.

Future work can be done in the following points: We can apply this approach in case studies, like

JHOT Draw, Pet store and JEdit etc. We can compare the results with other algorithm

of aspect mining techniques. We can improve vector space model to obtained

better result using this algorithm. We can take another threshold value to improve

the result.

REFERENCES[1] Kiczels, G.,Lamping, J.,Menhdhekar,A.,

Maeda,C., Lopes, C., Loingtier, J.M. Irwin, J;Aspect oriented programming In: proceedingEuropean conference on object orientedprogramming 220-242. Volume 1241.Springerverlag (1997).

Page 4: Crosscutting Concern Identification Using Graph Theory

International Journal of Scientific Research Engineering & Technology (IJSRET)Volume 2 Issue 10 pp 683-686 January 2014 www.ijsret.org ISSN 2278 – 0882

IJSRET @ 2014

[2] Gabrila Serban and Grigoreta Sofia Moldovan“A New-Graph based approach in aspectmining” knowledge engineering principles andtechniques proceeding of the internationalconference and knowledge engineering,principle and techniques, KEPT 2007 cluj-Nopoca (Romania), June 6-8 2007.

[3] Moldovan, G.S., Serban, G.,”Aspect Miningusing a Vector-Space Model Based ClusteringApproach", In: Proceedings of Linking AspectTechnology and Evolution (LATE) Work-shop,2006, to be published.

[4] Sayyed G.Maisikeli& FrankJ.Mitropoulos“Aspect Mining Using Self-Organizing Maps With Method Level DynamicSoftware metrics as input vector”2010 2ndInternational Conference on SoftwareTechnology and Engineering(ICSTE) By March2009.

[5] Tonella, P, Ceccato, M.: Aspect Mining throughthe Formal Concept Analysis of ExecutionTraces. In: Proceedings of the IEEE EleventhWorking Conference on Reverse Engineering(WCRE 2004). (2004) 112–121.

[6] Grigoreta S. Cojocar : “Aspect mining pastpresent and future” Studia Univ.Babes BolyaiInformatica, Volume LVII, Number 4, 2012.

[7] Jan Hannemann and Gregor Kiczales.Overcoming the Prevalent Decomposition ofLegacy Code. In Advanced Separation ofConcerns Workshop,at the InternationalConference on Software Engineering (ICSE),May 2001.

[8] William G. Griswold, Yoshikiyo Kato, andJimmy J. Yuan. AspectBrowser: Tool Supportfor Managing Dispersed Aspects. TechnicalReport CS1999-0640, UCSD, March 2000.

[9] Charles Zhang, Depeng Gao and Hans- ArnoJacobsen Multi visualizerhttp://www.eecg.utoronto.ca/czhang/amtex/.

[10] Martin P. Robillard and Gail C.Murphy.” Concern Graphs: Finding andDescribing Concerns Using Structural ProgramDependencies. In ICSE '02: Proceedings of the24th International Conference on SoftwareEngineering, pages 406–416, 2002”.

[11] M. Marin, A. van, Deursen, and L.Moonen “Identifying Aspects Using Fan-inAnalysis” In Proceedings of the 11th WorkingConference on Reverse Engineering

(WCRE2004), pages 132–141. IEEE ComputerSociety, 2004.

[12] L. He and H. Bai.” Aspect Mining usingClustering and Association Rule Method”International Journal of Computer Science andNetwork Security, 6(2A):247–251, February2006.

[13] D. Shepherd and L. Pollock. “Interfaces,Aspects, and Views” In Proceedings of LinkingAspect Technology and Evolution (LATE)Workshop, Chicago, USA, March 2005.

[14] O. A. M. Morales. “Aspect MiningUsing Clone Detection” Master’s thesis, DelftUniversity of Technology, the Netherlands,August 2004.

[15] Serban, G., Moldovan, G.S., “A new k-means based clustering algorithm in aspectmining", In: 8th International Symposium onSymbolic and Numeric Algorithms for ScientificComputing (SYNASC'06), 2006, pp. 60-64.

[16] Hacoupian, Yourik “ Mining aspectsthrough Support vector clustering and Geneticalgorithms” Ph.D. dissertation, Novasoutheastern University, DAI /B 74-10 (E), P.,Aug 2013,Page no. 3567556.

[17] G. S. Moldovan and G. Serban AspectMining using a Vector-Space Model BasedClustering Approach. In Proceedings of LinkingAspect Technology and Evolution (LATE)Workshop, Bonn, Germany, March 2006, to bepublished.

[18] G. S. Moldovan and G. Serban. QualityMeasures for Evaluating the Results ofClustering Based Aspect Mining Techniques. InProceedings of Towards Evaluation of AspectMining (TEAM) Workshop, ECOOP, pages 13-16, 2006.

[19] Tarr ,P.,Ossher,H.Harrision and SuttonS.M.,N.Degrees of Sepration Multidimensionaldegrees of sepration of concerns In proceedingof international conference on object orientedprogramming (ICSE) 1999.

.