a methodology to manage victim components using cbo measure

3 downloads 10 Views 220KB Size Report
section-3 presents basic concepts of software reuse & domain engineering, .... The Business-tier components are EmployeeBean, InterviewResultsBean, ...

International Journal of Software Engineering & Applications (IJSEA), Vol.3, No.2, March 2012

A METHODOLOGY TO MANAGE VICTIM COMPONENTS USING CBO MEASURE N Md Jubair Basha1 and Salman Abdul Moiz2 1

Assistant Professor,Information Technology, Muffakham Jah College of Engineering & Technology, Hyderabad, INDIA [email protected] 2

Professor , Information Technology, MVSR Engineering College, Hyderabad, INDIA [email protected]

ABSTRACT The current practices of software industry demands development of a software within time and budget which is highly productive. The traditional approach of developing a software from scratch requires considerable amount of effort. To overcome the drawback a reuse drive software development approach is adopted. However there is a dire need for realizing effective software reuse. This paper presents several measures of reusability and presents a methodology of reconfiguring the victim components. The CBO measure helps in identifying the component to be reconfigured. The proposed strategy is simulated using HR portal domain specific component system.

KEYWORDS Reusability, Component Measure, Victim Component, Reconfigurable component.

1. INTRODUCTION Effective software reuse helps in development of quality product within time and budget. This also helps in reducing the high effort needed for testing and maintenance of the software products. Effective software reuse is still a challenging task. Some of the components may not be reused effectively because of their highly cohesive nature. Such components have to be reconfigured. In this paper several quantitative measures are presented for software reusability. Further an approach is presented to identify the component(s) which is less reused. Later CBO measure is used to identify the reconfigurable components and a methodology is presented for reconfiguring the component(s). The remaining part of this paper is organized as follows: section-2 presents the related work, section-3 presents basic concepts of software reuse & domain engineering, section-4 describes the component measures which are realized on HR portal system, section -5 presents a methodology of identifying and realizing the reconfigurable component(s) and section -6 concludes the paper. DOI : 10.5121/ijsea.2012.3207

87

International Journal of Software Engineering & Applications (IJSEA), Vol.3, No.2, March 2012

2. RELATED WORK Reusability metrics defines an approach to measure reusable components. Several reusability metrics have been proposed in literature which has less emphasis on quantitative metrics. In [10] reusability metrics are based upon four characteristics viz. Self descriptiveness, modularity, portability and platform independence. However their weights are assumed based on assumed value which is qualitative in nature. In [11] a subset of reusability metrics are proposed. Though this approach is more efficient than non-automatable techniques, however the goal is to reuse the components interfaces only. This approach lacks the reuse measures at the design level. Zhongjie Wang et.al [12], proposed that the deficiencies of the components which are not suitable for reuse has to be redesigned. However no such approach to identify such components is presented. In this paper certain software reusability measures are presented. Later a quantitative strategy is presented to identify the components which are to be reconfigured.

3. SOFTWARE REUSE Software Reuse is the use of available software or to build new software from software knowledge. Reusable assets can be either reusable software or software knowledge. Reusability is a property of a software asset that indicates it’s probability of reuse [1]. Software Reuse means the process that use “designed software for reuse” again and again [2]. By software reusing, we can manage complexity of software development, increase product quality and makes faster production in the organization. Recently, design reuse has become popular with (object-oriented) class libraries, application frameworks, design patterns and along with the source code [3]. Jianli et al. proposed two complementary methods for reusing existing components. Among them one allows component evolution itself, which is achieved with binary class level inheritance across component modules. The other is by defined semantic entity so that they can be assembled at compile time or bind at runtime. Although component containment still is the main reuse model that leads to contribute the software product lines development [4]. Regarding the components much information has to be collected, maintained and processed for the retrieval of the components. Maurizio has proposed a methodology to automatically build a software catalogue the tools for archiving and retrieval of information are presented [5]. Software Reuse can be broadly divided into two categories viz. product reuse and process reuse. The product reuse includes the reuse of a software component and by producing a new component as a result of module integration and construction. The process reuse represents the reuse of legacy component from repository. These components may be either directly reused or may need a minor modification. The modified software component can be archived by versioning these components. The components may be classified and selected depending on the required domain. [6].

3.1 Domain Engineering Software Reuse can be improved by identifying objects and operations for a class of similar systems, i.e. for a particular domain. In the context of software engineering domains are application areas [7]. There are various definitions of what a domain is. Czarnecki’s defines [8]:” an area of knowledge scoped to maximize the satisfaction of the requirements of stakeholders, which includes concepts 88

International Journal of Software Engineering & Applications (IJSEA), Vol.3, No.2, March 2012

and terminology understood by practitioners in the area and the knowledge of how to build (part of) systems in the area”. Domain Engineering is a process in which the reusable component is developed and organized and in which the architecture meeting requirements of the domain is designed [9]. Domain Engineering can be defined by identifying the candidate domains and performing domain analysis and domain implementation which includes both application engineering and component engineering. Domain Analysis is a continuing process of creating and maintaining the reuse infrastructure in a certain domain. The main objective of domain analysis is to make the whole information readily available. The relevant components (if available) has to be extracted from the repository rather than building the new components from the scratch for a particular domain. Domain Analysis mainly focuses on reusability of analysis and design, but not code. This can be achieved by building common architectures, generic models or specialized languages that additionally improve the software development process in the specific problem area of the domain. A vertical domain is a specific class of systems. A horizontal domain contains general software parts being used across multiple vertical domains. Mathematical functions libraries container classes and UNIX tools are the examples of horizontal reuse. The purpose of domain engineering is to identify objects and operations of a class in a particular problem domain [7]. In the process of domain analysis, each component identified can be categorized as follows. • • •

General-purpose components: These components can be used in various applications of different domains (horizontal reuse). Domain-specific components: They are more specific and can be used in various applications of one domain (vertical reuse). Product-specific components: They are very specific and custom-built for a certain application, they are not reusable or only useful to a small extent.

3.2 HR Portal Application The system is designed in such a way that the client can interact with the web tier and business tier and can connect to the Data Access Object(DAO) component. The web-tier component consists of the JSP’s and Servlets.The Business tier consists of the EJB’s.The DAO’s consists of the classes with its objects communicating to the database.The web-tier components are HttpServlet, HRProcessServlet, Login Servlet, InterviewResultServlet and RegistrationServlet classes.The Business-tier components are EmployeeBean, InterviewResultsBean, HRProcessBean are the three stateless bean classes.The DAO components are BaseDAO, EmployeeDAO, InterviewDAO, HRDAO, ProcessDAO classes.

89

International Journal of Software Engineering & Applications (IJSEA), Vol.3, No.2, March 2012

Web Client

HR Portal Web

HR Portal Business Tier

DAO

Figure 1. Components of HR Portal Application

4. COMPONENT MEASURES Most of the reuse driven approaches often maintains a repository of reusable components. However an approach is needed to identify those components which are not reused or might have been used very less. Such components are known as Victim components. These components have to modified or reconfigured to achieve high reusability. The Object Oriented metrics are useful for measuring the effectiveness of component reusability. These metrics are also helpful in identifying the victim components. Some of these metrics are described as follows.

4.1 Weighted Component Measure (WCM) Each component may have several classes and each class may have several methods m1,m2,m3....mn..The complexity of all the methods of a particular class is evaluated to find weighted method measure of a class (WMC). The Weighted Component Measure (WCM) is the sum of Weighted Method Measure of Classes which are composed in the given component. WCM1= WMC1+WMC2+....................+WMCn where WMCi is a Weighted Measure of a classes i=1 to n The weighted measure of a particular class in a given component is evaluated as WMC1= C[M1]+C[M2]+C[M3]+..............+C[MK] Where M1 to MK are the methods of a class. The complexity of a method is evaluated as follows. C[Mj]= Number of edges – Number of vertices +1 (in a particular flow graph) or = Number of Decision Elements of a method + 1 The HR Portal Application consists of three components i.e. Web-Tier, Business-Tier, Data Access Object. These three components consists of 13 classes. Web tier component contains 5 90

International Journal of Software Engineering & Applications (IJSEA), Vol.3, No.2, March 2012

classes, business tier contains 3 classes and DAO component 5 classes. The Weighted Component Measure (WCM) of the Webtier component is as follows WCMWBT= WMCHR+WMCINT+WMCRS+WMCLS The Weighted Measures of a class are as follows: WMCHR=C[MPR]+C[MR] WMCINT=C[MPR]+C[MAR] WMCRS=C[MPR]+C[MRG] WMCLS=C[MPS] The complexity of the methods is evaluated as follows: C[MPR] = 11+1 = 12 C[MR] = 10+1 = 11 C[MPR] = 11+1 = 12 C[MAR] = 6+1 = 7 C[MPR] =11+1 =12 C[MRG] =8+1= 9 C[MPS] = 11+1 =12 WMCHR=C[MPR]+C[MR]=12+11=23 WMCINT=C[MPR]+C[MAR]=12+7=19 WMCRS=C[MPR]+C[MRG]=12+9=21 WMCLS=C[MPS]=12 The Weighted Component Measure(WMC) of the Webtier component is as follows: WCMWBT= WMCHR+WMCINT+WMCRS+WMCLS WCMWBT=23+19+21+12 =75 The Weighted Component Measure(WCM) of the Businesstier component is as follows: WCMBT= WMCEMP+WMCHRPB+WMCIR The Weighted Measures of a class are as follows: WMCEMP=C[MGS]+C[MSS]+ C[MA]+C[MACP] WMCHRPB=C[MRC]+C[MR] WMCIR=C[MVR]+C[MAIR] The cyclomatic complexity of a method is evaluated as follows: C[MGS]= 5+1 = 6 C[MSS] = 6+1 = 7 C[MA] = 7+1 = 8 C[MACP] = 21+1 = 22 C[MRC] =12+1 =13 91

International Journal of Software Engineering & Applications (IJSEA), Vol.3, No.2, March 2012

C[MR] =10+1= 11 C[MVR] = 9+1 =10 C[MAIR] = 13+1= 14 The Weighted Measures of a class are as follows: WMCBT=C[MGS]+C[MSS]+ C[MA]+C[MACP]=6+7+8+22=43 WMCHRPB=C[MRC]+C[MR]=13+11=24 WMCIR=C[MVR]+C[MAIR]=10+14=24 The Weighted Component Measure(WCM) of the Businesstier component is as follows: WCMBT= WMCEMP+WMCHRPB+WMCIR WCMBT= 43+24+24 =91 The Weighted Component Measure(WCM) of the Data Access Object component is as follows: WCMDAO= WMCBDO+WMCEDO+WMCIDO+WMCHRDO+WMCPDO The Weighted Measures of a class are as follows: WMCBDO=C[MGC]+C[MCC] WMCHRO=C[MRC]+C[MRE] WMCEDO=C[MGP]+C[MGE]+ C[MAE]+C[MGEE]+ C[MRC] WMCIDO=C[MVIR]+C[MAIR] WMCPDO=C[MRC]+C[MAT] The cyclomatic complexity of a method is evaluated as follows: C[MGC]=34+1=35 C[MCC]= 4+1=5 C[MRC]=12+1=12 C[MRE]=13+1=14 C[MGP]=9+1=10 C[MGE]=13+1=14 C[MAE]=21+1=22 C[MGEE]=14+1=15 C[MRC]=22+1=23 C[MVIR]=9+1=10 C[MAIR]=13+1=14 C[MRC]=29+1=30 C[MAT]=6+1=7 The Weighted Measures of a class are as follows: WMCBDO=C[MGC]+C[MCC]=35+5=40 WMCHRO=C[MRC]+C[MRE]=13+14=27 WMCEDO=C[MGP]+C[MGE]+ C[MAE]+C[MGEE]+ C[MRC]=10+14+22+15+23=84 92

International Journal of Software Engineering & Applications (IJSEA), Vol.3, No.2, March 2012

WMCIDO=C[MVIR]+C[MAIR]=10+14=24 WMCPDO=C[MRC]+C[MAT]=30+7=37 The Weighted Component Measure(WCM) of the Data Access Object component is as follows: WCMDAO= WMCBDO+WMCEDO+WMCIDO+WMCHRDO+WMCPDO WCMDAO=40+84+24+27+37=212 4.2 Depth of Inheritance Tree Measure The depth of inheritance is a length from the node where the class is located to the root of the tree. The depth of inheritance tree measures in the maximum length from the node to the root. The DIT for the Web-tier component is equal to 3. The DIT for the DAO Component is equal to 2. The DIT for the business-tier component is equal to 3. 4.3 Number of Children Measure The Number of Children (NOC) measure quantifies the number of immediate subclasses subordinated to a class in the class hierarchy. It measures how many subclasses are inherits the methods of the parent. The NOC for a class HTTPServlet in component Webtier is 4. The NOC for a class BaseDAO in DAO component is also 4. At any particular point of time, if the designer wants to know about which part of the system is not effectively reused then a lookup is to be performed on the component management relation. A Central repository maintains a table for managing a component reuse. This table contains two fields. One specifies the name of the component and the count specifies the number of times the component was reused by several systems. Table 1. Component Management Relation

Component

Count of Reuse

Webtier

12

Businesstier

5

DAO

18

Table 1. specifies the list of HR portal system components which were reused by several applications. If any component is not used frequently, they are termed as victim components. As Businesstier component was used only 5 times, it can be a candidate of victim component. The 93

International Journal of Software Engineering & Applications (IJSEA), Vol.3, No.2, March 2012

victim component has to be reconfigured by dividing it into several parts to increase the reusability count in future. However reconfiguring the non-victim components may also enhance the reusability of the system. The idea is to reconfigure those components which are highly cohesive. Hence, a Coupling Between Object Measure (CBOM) of such components is to be evaluated.

5. COMPONENT RECONFIGURATION Coupling represents the strength of relationship between the components of the system. A well structured system demands loose coupling and a tight cohesion. Those components which are highly cohesive in nature needs to be reconfigured. Coupling between object measure is used to identify the highly cohesive components. Coupling between object measure (CBOM) for a component is defined as the number of invocations by the specified component. Those components whose CBOM is high or those component(s) of the system whose CBOM is greater than certain scalar value are the components which needs to be reconfigured at the earliest. Hence a reconfigurable component (Cr) can be identified as Cr = Max { CBOM(Ci) }, where C1, C2,... Cn are components of the system (or) Crj = { CBOM(Ci) > P}, where P is a scalar value whose value differs from one domain to the other. The following figure specifies the number of invocations by different components in HR portal application.

94

International Journal of Software Engineering & Applications (IJSEA), Vol.3, No.2, March 2012 Figure 2.Invocations occurred for different components of HR Portal Application

Based on the invocations specified in the above figure, CBOM is evaluated to identify one reconfigurable component. As there are three components of the HR Portal application viz., Web-tier, Business-tier and DAO, the component with highest CBOM is the candidate for reconfigurable component. Cr = Max { CBOM(WBR), CBOM(BR), CBOM(DAO) } Cr = Max { 180, 95,224}= 224 Hence the DAO component has to further reconfigured to reduce the coupling. This is achieved by dividing the DAO component into two sub DAO components viz., DAO1 & DAO2. The division of the DAO component makes the DAO component less cohesive. This is realized later by evaluating the CBO measure of DAO1 & DAO2

6. CONCLUSION Component reusability helps in developing quality product as the component in the repository is successfully tested. Most of the reusability metrics proposed in literature or either qualitative or they realize only interface reusability metrics. In this paper an effort was made to propose reusable quantitative measures. Components which are less used are identified from the repository known as victim components. Further to achieve high reusability, certain components which are highly cohesive in nature have to be reconfigured. An approach using CBOM was proposed to identify such reconfigurable components. In future, strategies to reconfigure the components are to be realized.

ACKNOWLEDGEMENTS The work was partly supported by the R & D Cell of Muffakham Jah College of Engineering & Technology, Hyderabad, India. The authors would like to thank to all the people from Industry and Academia for their active support.

REFERENCES [1] [2] [3] [4] [5] [6] [7]

William B. Frakes, Kyo Kang: Software Reuse and Research: Status and Future, IEEE Transactions on Software Engineering”, Vol. 31, No. 7, July 2005 Xichen Wang, Luzi Wang: Software Reuse and Distributed Object Technology, IEEE Transactions on Software Engineering, 2011. Sametinger: Software Engineering with Reusable Components, Springer-Verlag, ISBN 3- 540-626956, 1997. Jianli He, Rong Chen, Weinan Gu: A New Method for Component Reuse, IEEE Transactions on Software Engineering, 2009. Maurizio Pighin: A New Methodology for Component Reuse and Maintenance, IEEE Transactions on Softwrae Engineering, 2001. Yong-liu, Aiguang-Yang: Research and Application of Software Reuse, ACIS International Conference on Software Engineeing, Artificial Intelligence, IEEE, 2007. N Md Jubair Basha, Salman Abdul Moiz, A.A.Moiz Qyser: Performance Analysis of HR Portal Domain Components Extraction, IJCSIT, Vol. 2(5), 2011, 2326-2331. 95

International Journal of Software Engineering & Applications (IJSEA), Vol.3, No.2, March 2012 [8]

Czarnecki, K., Eisenecker, U.W.:Generative Programming: methods, tools and applications. Addison Wesley, London, 2000. [9] Fuqing Yang, Bing Zhu, Hong Mei : Reuse oriented requirements modeling, Tsinghua University Press, Beizing, 2008. [10] James F Peters, Witold Pedrycz, “ Software Engineering, An Engineering Approach”, Wiley India Private Limited, 2007. [11] Marcus A.S.Boxall, Saeed Araban,” Interface Metrics for Reusability Analysis of Components”, Proceedings of 2004 IEEE Australian Software Engineering Conference (ASWEC’ 04). [12] Zhongjie Wang et.al, “ A Survey of Business Component Methods and Related Technique”, World Academy of Science, Engineering and Technology, pp.191-200, 2006.

Authors N Md Jubair Basha received his B.Tech. (IT) and M.Tech (IT) from JNTUH, Hyd erabad He is presently working as Assistant Professor in Department of Information Technology, Muffakham Jah College of Engineering and Technology, Hyderabad, India. His research interest includes Software Reusability, Mobile Computing and Cryptography. He is an active member of IEEE and CSI. You can reach him at [email protected]

Dr. Salman Abdul Moiz is working as a Professor in CSE/IT department at MVSR Engineering College, Hyderabad. He received B.Sc (Electronics) from Osmania University, MCA from Osmania University, M.Tech (CSE) from Osmania University, and M.Phil (CS) from Madurai Kamaraj University and Ph.D (CSE) from Osmania University. He worked as Research Scientist at Centre for Development of Advanced Computing, Bangalore. He has published 31 papers in various National/International Conf erences and Journals. His areas of interests include Mobile databases, Software Process Improvements; Component based software development & Disaster Recovery. He is an active member of IEEE, IETE and CSI.

96

Suggest Documents