ISSN ONLINE(2319-8753)PRINT(2347-6710)
Keywords |
Software modularization, Oriented graph, Metrics, Coupling and cohesion |
INTRODUCTION |
Great software systems based on approaches, the object consist of classes grouped into packages, forming a modular structure. The dependency relationships between classes in the same package (internal dependencies), and between classes of different packages (external dependencies generate complexity making it difficult to understand and maintain the system. In addition, the modular structure tends to degrade over time, making necessary an expert intervention for modernization. Many researchers make proposals on this subject using technical visualization, algorithms of remodularization or Exploring the Redistribution Classes of a Package with an Approach Based on Formal Concept Analysis.[13] [14]. In this paper, we study a particular declination, cf. the problem presented by H. Abdeen et al. [2] [1], which is about the redistribution of classes from one system to existing packages. Namely, we consider in this paper more precisely the redistribution of classes in a package to other packages. This package may be a very small and in fact we want to balance the sizes of packages in the system, or it was artificially created to contain added classes to the system and the designer considers that there is no consistency semantics. In a context of restructuring architecture or development, it can also be linked to the disappearance of a node in a distributed architecture or recentralization and / or refactoring for maintenance reasons. We explore a solution using Oriented Graph based on the technique of shortest path and illustrate our proposal with a theoretical example. Section II presents our example, then we describe the approach in Section III. Section IV presents validation metrics of cohesion and coupling measure and we discuss our main results. Related work is presented in Section V, and then we conclude in Section V I. |
II. ILLUSTRATION |
This section presents the problem of software architectures remodularization on an example. We will use the architecture shown in Figure 1 consists of five packages A, B, C, D and E. Packages A, B, C, D, E are expected to contain more classes that are not shown for simplicity. Dependencies linking classes: they correspond for example to call a method or use of a type. External dependency relationships link classes of package E to classes of other packages. Internal dependency relationships connect classes E between. Internal dependencies of A, B, C and D are not presented[13] [14]. |
We are interested in the redistribution of classes E to other packages with an exploratory method, whose proposals for redistribution are then presented to an expert. These proposals are based on the idea that the expert, while checking the semantic classes, could search for the increase of the cohesion (within the meaning of the coupling of classes in a package) and reduce the coupling between classes in different packages. To do this, we believe it is appropriate to encourage the following two trends: |
1. Classes in a package attract them to classes of E, |
2. If classes of E are interconnected, it is better to redistribute in the same package. |
We believe that the Oriented Graph based on the technique of shortest path can bring interesting ways to solve this problem because this technical method allows the group to connect classes identically. We are looking here to propose a solution to an expert. |
III. PROPOSED APPROACH |
In our approach, we are inspired of the notion of graph to present the original architecture of Figure 1 as nodes relative to classes and arcs relative to the relationship between these classes. Figure 2 illustrates this vision. |
A. Formalization |
In a second step we focus on the classes of package E, to be deleted related with classes of other packages considered in this case as nodes shown in figure 3. |
- The relationship between classes and packages are represented by edges connecting each pair of nodes as an example the nodes A and E1 are connecting by the edge (A,E1) image of couple (Package, Class). |
It is found that all the conditions are met to define a graph oriented, object of Figure 3. |
Definition 1 (Oriented Graph) [15]: |
Ggraph G is a mathematical structure defined by a pair (N, E) where N is a set of objects called nodes or vertices and E part of N * N which represents a set of arcs (also called edges) each connecting a pair of nodes. This general definition is a directed graph distinguishes two vertices s1 and s2 the edge (s1, s2) of the edge (s2, s1). The number of connections available to each class of package E with classes of packages A, B, C and D and |
Example of procedure: |
For the choice of the allocation of classes E Package to one of the other packages A, B, C and D, we adopted an approach advocating the use of directed graph and the technique based on the definition of the shortest path. |
For examples: |
1. In Figure 2, the class E1 of package E has an external connection with class A14 of package A, therefore the corresponding arc in figure 3 between class E1 and package A is the number 1. where the idea of cost of a shortest path ¹. By applying this principle class E1 of package E is affected into package A. |
2. The class E12 of package E has three external relations, both with package A (one with class A13 of package A, the other with the class A11 in the same package) and the third class C16 of package C (Figure3). Under the definition of the shortest path the class E12 go to Package C. |
Special case: |
3. The class E8 of package E has three internal relations with the classes E9, E10 and E17 of package E and two external relations, one with class B12 of package B and the other with class C4 of package C, since the classes E9 and E10 will be affected by the principle of shortest path, to the package C therefore E8 will go also to the package C dominant. |
Thus all the classes in the package E are redistributed according to the methodology listed above, and thereby the package E has been deleted to arrive on remodularized architecture (figure 4) . |
IV. RESULTS AND DISCUSSION |
A. Validation metrics |
For validatiton of metrics cohesion and coupling, our calculations were based on figures 1 and 4 with an architecture comprising 5 packages A, B, C, D and E by redistribution classes of package E (figure 1) using oriented graph and the technique based on the definition of the shortest path, which resulted one possible remodularized architecture (figure4). The package E is removed during this operation. |
1. Cohesion metrics |
Table 1. Cohesion metrics: Index of Package Goal Focus and Index of Package Services Cohesion. |
The Cohesion metrics: Index of Package Goal Focus (PF) and Index of Package Services Cohesion (IPSC) take their values from 0 to 1, where 1 is the optimal value and 0 is the wrong value. Figure 5 gives the values of indices PF and IPSC for: |
- Package E of Original Architecture 1 whose indexes are bad values because they are lower than 1. |
- Packages A and C of remodularizated architecture whose the index IPSC is optimal value 1 therefore very good. |
2. Coupling metrics |
The coupling metrics: Index of Inter-Package Interaction (IIPU and IIPE) object of the figure 6, it is observed an improvement indexes IIPU and IIPE at remodularization 1 architecture compared to indexes of the original architecture 1 therefore a trend to optimality . |
Concerning the coupling metrics: Index of Package changing Impact (IPCI) and Index of Package Communications Diversion ( IIPUD and IIPED) presented in figure 7, the results obtained for remodularization 1 approximate from those of the original architecture 1 extend to a higher interesting value 0.626. |
The results obtained at the level of the cohesion for the remodularized architecture 1 provides an optimum value 1 compared to the original architecture 1. The results of the coupling have an improvement at the level of remodularized architecture 1 compared to the original architecture 1. |
V. RELATED WORK |
Different automated approaches have been proposed to restructure object systems. We cite three: the clustering algorithms, algorithms based on meta -heuristics and those based on the FCA[6]. The first aim to restructure system by the distribution of some elements (eg classes, methods , attributes) in groups such that the elements of a group are more similar to each other with elements of other groups [3] [7] [5]. Approaches to restructuring based on metaheuristic algorithms [9] [8] are generally iterative stochastic algorithms, progressing towards a global optimum of a function by evaluating a certain objective function (eg characteristics or quality metrics). Finally, the approaches based on FCA [10] [12] provide an algebraic derivation of hierarchies of abstractions from all entities of a system. Reference [4] presents a general approach for the application of the FCA in the field of object-oriented software reengineering. In previous work, we added the dimension of exploration using the FCA[13] [14]. In this paper we explore the issue of redistributing classes of a package to other packages. We use an approach based on Oriented Graph to determine the packages that receive the redistributed classes and we have evaluate the quality of a remodularized Software Architecture by metrics for measuring Coupling and Cohesion of a Package . A large part of previous works related to oriented software metrics has focused on the issue of characterizing the class design, either looking internal complexity or relationship between a given class and other classes[16] [17] [18] [19] [20] [21] [22] [23] [24] [25] [26]. |
In the literature, there is also a body of work that focus on object oriented metrics from the standpoint of their correlation with software changeability [16][27], or from the standpoint of their ability to predicate softwair maintenability [16][28]. Other reasearchers argue that the measures resulted by the cohesion and coupling metrics of the previous works are open to interpretation [16] [28]. In general, there are few metrics in the the literature devoted to packages. Our cohesion and coupling metrics we provide in this work are similar to the metrics provided by Ducasse [16]. |
VI. CONCLUSION AND DISCUSSION |
In this paper we explore the issue of redistributing classes of a package to other packages. We use an approach based on Oriented Graph with the technique based on the definition of the shortest path, to determine the packages that receive the redistributed classes, and we have evaluate the quality of a remodularized software architecture by metrics for measuring coupling and cohesion of a package . The results have an improvement at the level of remodularized architectures. |
References |
[1] H. Abdeen, “Visualizing, Assessing and Re-Modularizing Object-Oriented Architectural Elements”, PhD thesis, Lille University, 2009. [2] H. Abdeen, S. Ducass, H.A. Sahraoui, and I. Alloui, “Automatic package coupling and cycle minimization ”, In International Woking Confence on Reverse Engineeing (WCRE), . IEEE Compter Society Press, Washington, DC, USA, pp. 103-112, 2009. [3] F.B. Abreu, G. Pereira, and P. Sousa, “A coupling-guided cluster analysis approach to reengineer the modularity of object-oriented systems ”, In Proceeding of the confeence on Software Maintenance and Reengineering. CSMR „OO, IEEE Compter Society Press, , DC, USA, pp. 13, , 2000. [4] G. Arévalo, S. Ducass, and O. Nierstrasz, “ Lessons leaned in appling fomal concept analysis to reverse engineering”, In Proceeding of the Third international conference on Fomal Concept Analysis, ICFCA‟05, Spinge-Velag, , Berlin. Heidelberg, pp. 95-112, 2005. [5] M. Bauer and M. Trifu. Architecture-aware adaptive clustering of oo s ystems. In Poceedings of the Eighth Euromicro Working Conference on Software Maintenance and Reengineering (CSMR „O4), CSMR „O4, IEEE Compter Society, Washington, DC, USA, pp. 3, 2004. [6] B. Ganter and R. Wille, “Formal Concept Analysis. Mathematical Fondations ”, Spinge, 1999. [7] B.S. Mitchell and S. Mancoridis, “Compaing the decompositions produced by software clustering algoithms using similarity measurements ”, In ICSM, pp. 744-753, 2001. [8] M.O‟Keeffe and M. I. Cinneide,“Seach-based refactoring fo software maintenance”, J. Syst. Softw, pp. 81(4): 502-216, April 2008. [9] O. Seng, J. Stammel and D. Burkhart, “Search- based determination of refactorings for improving the class structure of object-oriented systems”, In Mike Cattolico, edito. GECCO, ACM, pp. 1909-1916, 2006. [10] G.Snelting, “Software reengineering based on concept lattices”, In CSMR, pp 3-10, 2000. [11] T. Tilley, R. Cole, P. Becker and P.W. Eklund, “A survey of formal concept analysis support for software engineering activities”, In Int. Conf. Fomal Concept Analysis (ICFCA), pp. 50-271, 2005. [12] P. Tonella, “Concept analysis for module restructuring”, IEEE Trans, Software Eng, pp. 27 (4): 351-363, 2001. [13] L. M. Hakik, M. Huchard, R. El Harti and A.D. Seriai, “Exploration de la redistribution des classes d'un package par des techniques d'Analyse Formelle de Concepts”, The first conference in software engineering (CIEL 2012), France, 2012. [14] L. M. Hakik, , R. El Harti , “Exploring the Redistribution Classes of a Package with an Approach Based on Formal Concept Analysis”, International Journal of Engineering Research & Technology (IJERT), ISSN: 2278-0181, www.ijert.org, December 2013. [15] A. Anwar Harti , “Formalisation par une approche IDM de la composition de modeles dans le profil VUML”, Thesis. Toulouse University. 2009. [16] S. Dcasse, N. Anquetil, M.U. Bhatti and A.C. Hora. , “Software metrics for package remodularisation”, Research report, November 2011. [17] S. R. Chidamber and C. F .Kemer, “A metrics suit for object oriented design”, IEEETSE, pp. 20: 476-493, 1994. [18] F.B. Abreu and R. Carapuca, “Candidate metrics for objected-oriented software within a taxonomy framework. ”, Journal of Sys, Sof, pp. 26: 87-96, 1994. [19] W. Li and S. Henry, “Objected-oriented metrics that predict maintainability”, Journal of Sys, Sof, pp. 23:111-112, 1993. [20] W. Li, “ Another metric suit for object oriented programming”, Journal of Sys, Sof, pp. 44:155-162, 1998. [21] B.H. Selers, “ Object-Oriented Metrics: Measures of Complexity”, Prentice-Hall, 1996. [22] ] J.M. Bieman and B.K. Kang, “Cohesion and reuse in an object-oriented system”, In ACM Symposium on Software Reusability.,April 1995. [23] J.M. Bieman and B.K. Kang, “ Measuring design-level cohesion”, IEEETSE, pp. 24(2) :111-124, February 1998. [24] L.C. Briand, S. Morasca and V. R. Basili, “Defining and validation measures for object-based high-level design”, IEEE TSE, pp. 722-743, 1999. [25] L.C. Briand, J.W Daly and J. Wust, “A Unified Framework for Cohesion Measurement in Objected-Oriented Systems”, Empirical Software Engineering, An International Journal, pp. 3(1):65-117, 1998. [26] L.C. Briand, J.W Daly and J. Wust, “A Unified Framework for Coupling Measurement in Objected-Oriented Systems”, IEEETSE, pp. 25(1):91-121, 1999. [27] H. Kabaili, R.K. Keller, F. Lustman, “Cohesion as changeability indicator in object- oriented systems”, In Fifth Europ. Conf, on Sof. Maintenance and Reengineering. CSMR 01, IEEE Computer Society, Washington, DC, USA, pp. 39-46, 2001. [28] R.K. Bandi, V.K. Vaishnavi and D.E. Tuk, “Predicting maintenance performance using object- oriented design complexity metrics”, IEEETSE, pp. 29: 77-87, 2003. |
Visit for more related articles at International Journal of Innovative Research in Science, Engineering and Technology
In a previous study we proceeded to the remodularization architecture based classes and packages using the Formal Concept Analysis (FCA) [13] [14], we then got two possible remodularized architectures. In this paper we explore the issue of redistributing classes of a package to other packages. We use an approach based on Oriented Graph to determine the packages that receive the redistributed classes and we have evaluate the quality of a remodularized Software Architecture by metrics for measuring Coupling and Cohesion of a Package
Keywords |
Software modularization, Oriented graph, Metrics, Coupling and cohesion |
INTRODUCTION |
Great software systems based on approaches, the object consist of classes grouped into packages, forming a modular structure. The dependency relationships between classes in the same package (internal dependencies), and between classes of different packages (external dependencies generate complexity making it difficult to understand and maintain the system. In addition, the modular structure tends to degrade over time, making necessary an expert intervention for modernization. Many researchers make proposals on this subject using technical visualization, algorithms of remodularization or Exploring the Redistribution Classes of a Package with an Approach Based on Formal Concept Analysis.[13] [14]. In this paper, we study a particular declination, cf. the problem presented by H. Abdeen et al. [2] [1], which is about the redistribution of classes from one system to existing packages. Namely, we consider in this paper more precisely the redistribution of classes in a package to other packages. This package may be a very small and in fact we want to balance the sizes of packages in the system, or it was artificially created to contain added classes to the system and the designer considers that there is no consistency semantics. In a context of restructuring architecture or development, it can also be linked to the disappearance of a node in a distributed architecture or recentralization and / or refactoring for maintenance reasons. We explore a solution using Oriented Graph based on the technique of shortest path and illustrate our proposal with a theoretical example. Section II presents our example, then we describe the approach in Section III. Section IV presents validation metrics of cohesion and coupling measure and we discuss our main results. Related work is presented in Section V, and then we conclude in Section V I. |
II. ILLUSTRATION |
This section presents the problem of software architectures remodularization on an example. We will use the architecture shown in Figure 1 consists of five packages A, B, C, D and E. Packages A, B, C, D, E are expected to contain more classes that are not shown for simplicity. Dependencies linking classes: they correspond for example to call a method or use of a type. External dependency relationships link classes of package E to classes of other packages. Internal dependency relationships connect classes E between. Internal dependencies of A, B, C and D are not presented[13] [14]. |
We are interested in the redistribution of classes E to other packages with an exploratory method, whose proposals for redistribution are then presented to an expert. These proposals are based on the idea that the expert, while checking the semantic classes, could search for the increase of the cohesion (within the meaning of the coupling of classes in a package) and reduce the coupling between classes in different packages. To do this, we believe it is appropriate to encourage the following two trends: |
1. Classes in a package attract them to classes of E, |
2. If classes of E are interconnected, it is better to redistribute in the same package. |
We believe that the Oriented Graph based on the technique of shortest path can bring interesting ways to solve this problem because this technical method allows the group to connect classes identically. We are looking here to propose a solution to an expert. |
III. PROPOSED APPROACH |
In our approach, we are inspired of the notion of graph to present the original architecture of Figure 1 as nodes relative to classes and arcs relative to the relationship between these classes. Figure 2 illustrates this vision. |
A. Formalization |
In a second step we focus on the classes of package E, to be deleted related with classes of other packages considered in this case as nodes shown in figure 3. |
- The relationship between classes and packages are represented by edges connecting each pair of nodes as an example the nodes A and E1 are connecting by the edge (A,E1) image of couple (Package, Class). |
It is found that all the conditions are met to define a graph oriented, object of Figure 3. |
Definition 1 (Oriented Graph) [15]: |
Ggraph G is a mathematical structure defined by a pair (N, E) where N is a set of objects called nodes or vertices and E part of N * N which represents a set of arcs (also called edges) each connecting a pair of nodes. This general definition is a directed graph distinguishes two vertices s1 and s2 the edge (s1, s2) of the edge (s2, s1). The number of connections available to each class of package E with classes of packages A, B, C and D and |
Example of procedure: |
For the choice of the allocation of classes E Package to one of the other packages A, B, C and D, we adopted an approach advocating the use of directed graph and the technique based on the definition of the shortest path. |
For examples: |
1. In Figure 2, the class E1 of package E has an external connection with class A14 of package A, therefore the corresponding arc in figure 3 between class E1 and package A is the number 1. where the idea of cost of a shortest path ¹. By applying this principle class E1 of package E is affected into package A. |
2. The class E12 of package E has three external relations, both with package A (one with class A13 of package A, the other with the class A11 in the same package) and the third class C16 of package C (Figure3). Under the definition of the shortest path the class E12 go to Package C. |
Special case: |
3. The class E8 of package E has three internal relations with the classes E9, E10 and E17 of package E and two external relations, one with class B12 of package B and the other with class C4 of package C, since the classes E9 and E10 will be affected by the principle of shortest path, to the package C therefore E8 will go also to the package C dominant. |
Thus all the classes in the package E are redistributed according to the methodology listed above, and thereby the package E has been deleted to arrive on remodularized architecture (figure 4) . |
IV. RESULTS AND DISCUSSION |
A. Validation metrics |
For validatiton of metrics cohesion and coupling, our calculations were based on figures 1 and 4 with an architecture comprising 5 packages A, B, C, D and E by redistribution classes of package E (figure 1) using oriented graph and the technique based on the definition of the shortest path, which resulted one possible remodularized architecture (figure4). The package E is removed during this operation. |
1. Cohesion metrics |
Table 1. Cohesion metrics: Index of Package Goal Focus and Index of Package Services Cohesion. |
The Cohesion metrics: Index of Package Goal Focus (PF) and Index of Package Services Cohesion (IPSC) take their values from 0 to 1, where 1 is the optimal value and 0 is the wrong value. Figure 5 gives the values of indices PF and IPSC for: |
- Package E of Original Architecture 1 whose indexes are bad values because they are lower than 1. |
- Packages A and C of remodularizated architecture whose the index IPSC is optimal value 1 therefore very good. |
2. Coupling metrics |
The coupling metrics: Index of Inter-Package Interaction (IIPU and IIPE) object of the figure 6, it is observed an improvement indexes IIPU and IIPE at remodularization 1 architecture compared to indexes of the original architecture 1 therefore a trend to optimality . |
Concerning the coupling metrics: Index of Package changing Impact (IPCI) and Index of Package Communications Diversion ( IIPUD and IIPED) presented in figure 7, the results obtained for remodularization 1 approximate from those of the original architecture 1 extend to a higher interesting value 0.626. |
The results obtained at the level of the cohesion for the remodularized architecture 1 provides an optimum value 1 compared to the original architecture 1. The results of the coupling have an improvement at the level of remodularized architecture 1 compared to the original architecture 1. |
V. RELATED WORK |
Different automated approaches have been proposed to restructure object systems. We cite three: the clustering algorithms, algorithms based on meta -heuristics and those based on the FCA[6]. The first aim to restructure system by the distribution of some elements (eg classes, methods , attributes) in groups such that the elements of a group are more similar to each other with elements of other groups [3] [7] [5]. Approaches to restructuring based on metaheuristic algorithms [9] [8] are generally iterative stochastic algorithms, progressing towards a global optimum of a function by evaluating a certain objective function (eg characteristics or quality metrics). Finally, the approaches based on FCA [10] [12] provide an algebraic derivation of hierarchies of abstractions from all entities of a system. Reference [4] presents a general approach for the application of the FCA in the field of object-oriented software reengineering. In previous work, we added the dimension of exploration using the FCA[13] [14]. In this paper we explore the issue of redistributing classes of a package to other packages. We use an approach based on Oriented Graph to determine the packages that receive the redistributed classes and we have evaluate the quality of a remodularized Software Architecture by metrics for measuring Coupling and Cohesion of a Package . A large part of previous works related to oriented software metrics has focused on the issue of characterizing the class design, either looking internal complexity or relationship between a given class and other classes[16] [17] [18] [19] [20] [21] [22] [23] [24] [25] [26]. |
In the literature, there is also a body of work that focus on object oriented metrics from the standpoint of their correlation with software changeability [16][27], or from the standpoint of their ability to predicate softwair maintenability [16][28]. Other reasearchers argue that the measures resulted by the cohesion and coupling metrics of the previous works are open to interpretation [16] [28]. In general, there are few metrics in the the literature devoted to packages. Our cohesion and coupling metrics we provide in this work are similar to the metrics provided by Ducasse [16]. |
VI. CONCLUSION AND DISCUSSION |
In this paper we explore the issue of redistributing classes of a package to other packages. We use an approach based on Oriented Graph with the technique based on the definition of the shortest path, to determine the packages that receive the redistributed classes, and we have evaluate the quality of a remodularized software architecture by metrics for measuring coupling and cohesion of a package . The results have an improvement at the level of remodularized architectures. |
References |
|