I J C A 7(), 202 pp. 49-53 SYSTEM LEVEL REUSE METRICS FOR OBJECT ORIENTED SOFTWARE : AN ALTERNATIVE APPROACH Sushil Goel and 2 Rajesh Vema Associate Pofesso, Depatment of Compute Science, Dyal Singh College, Kanal, India 2 Pofesso & Head, Depatment of Compute Science & Engineeing, KITM, Kuuksheta, India Abstact: Reusing existing softwae components is an impotant featue of object-oiented pogamming. Main advantages of it ae : incease softwae poductivity, educe the cost, educe testing time, educe maintenance time and cost, impove the quality of the softwae. In this pape, vaious flaws and inconsistencies have been obseved in the existing system level euse metics. Two new metics namely Method Reuse Facto (MRF) and Attibute Reuse Facto (ARF) have been poposed. These metics ae helpful to find the euse level of objectoiented systems. Fou existing system level euse metics, namely, Method Inheitance Facto (MIF) Attibute Inheitance Facto (AIF), Method Reuse Pe Inheitance Relation (MRPIR) and Attibute Reuse Pe Inheitance elation (ARPIR) have been selected fo compaison with poposed metics. Finally, metics ae evaluated against the case study. Keywods : Reuse, Reuse Metics, MOOD Metics etc.. INTRODUCTION Public euse was defined by Fenton as The popotion of a poduct which was constucted extenally []. The code defined extenally means built-in-functions in vaious libaies. Pivate euse was defined by Fenton as the extent to which modules within a poduct ae eused within the same poduct []. In object-oiented tem public and pivate euse ae not consideed sepaately [2] due to difficulty in identifying extenal code. Bieman descibed this difficulty as due to fact that a new system is built as an extension to an existing class libay. In object oiented system, euse in due to inheitance, whee a class s methods o attibutes can be oveidden. Diect euse is euse without going though an intemediate class. Indiect euse is euse though an intemediate class. This eseach pape investigates seveal euse metics poposed by vaious eseaches and obseves vaious flaws and inconsistencies in the existing euse metics. This pape poposes two new euse metics namely Method Reuse Facto (MRF) and Attibute Reuse Facto (ARF). Rest of the pape is oganized in five sections. Section 2 pesents a bief oveview of elated wok and motivation of this eseach wok. Section 3 pesents the poposed metics. Section 4 explains flaws in existing metics and all flaws ae esolved by poposed metics. Finally, section 5 conducts the case study by taking thee simple systems. Finally, section 6 pesents discussion concluding emak. 2. RELATED WORK Vaious effots wee put in building metics fo softwae euse and eusability ae seen fom [4, 5]. This section gives the fou metics. These metics ae available at the poject level o system level. They descibe the entie poject o system, not an individual class. (a) Method Inheitance Facto (MIF): This metic is defined by Fenando Bito e Abeu [5]. MIF is defined as MIF sumof allinheitedmethodsinallclasses = sumof allinheitedmethodsinallclasses + sumof allmethodsdeclaeinallclasses Highe the value of MIF moe is the amount of euse in the poject. If MIF is 0%, it means thee is no method inheitance in the classes.
50 Sushil Goel and Rajesh Vema (b) Attibute Inheitance Facto (AIF) : This metic is also defined by Fenando Bito e Abeu [5]. AIF is defined as AIF sumof allinheitedattibutesinallclasses = sumof allinheited attibutesinallclasses + sumof all attibutesdeclaeinallclasses Highe the value of AIF moe is the amount of euse in the poject. If AIF is 0%, it means thee is no attibute inheitance in the classes. (c) Method Reuse Pe Inheitance Relation (MRPIR): This metic is defined by Nasib S. Gill et al. [4]. MRPIR computes the total numbe of methods eused pe inheitance elation in the inheitance hieachy. It applies on whole inheitance hieachy in the system. It is defined as MRPIR = k= MI k Whee = Total numbe of inheitance elationship MI K = No. of methods inheited though k th inheitance elationship. If same method is inheited though diffeent inheitance elationships then it is computed sepaately in each elationship. (d) Attibute Reuse Pe Inheitance Relation (ARPIR): This metic is defined by Nasib S. Gill et al [4]. ARPIR computes the total numbe of attibutes eused pe inheitance elation in the inheitance hieachy. It applies on whole inheitance hieachy in the system. It is defined as ARPIR = k= AI k Whee =Total numbe of inheitance elationship AI K = No. of attibutes inheited though k th inheitance elationship. If same attibute is inheited though diffeent inheitance elationships then it is computed sepaately in each elationship. 3. PROPOSED METRICS (a) Method Reuse Facto (MRF) MRF is defined as euse methods in allclasses MRF = total methods in allclasses The MRF fist counts all euse methods in all classes o system and finally divided by the total numbes of methods in all classes o system. The MRF is poject level o system level metic. In MRF, each euse method is counts once. If same method is eused in moe than one classes, then it is counted only once. In othe wods, If same method is inheited though diffeent inheitance elationships then it is computed only once in all elationships. The maximum value of MRF is and minimum value of MRF is 0. Method Reuse Level of system is calculated as (MRF x 00)%. (b) Attibute Reuse Facto (ARF) ARF is defined as euse attibutesin allclasses ARF = total attibutesin allclasses The ARF fist counts all euse attibutes in all classes o system and finally divided by the total numbes of attibutes in all classes o system. The ARF is poject level o system level metic. In ARF, each euse attibute is counts once. If same attibute is eused in moe than one classes, then it is counted only once. In othe wods, If same attibute is inheited though diffeent inheitance elationships then it is computed only once in all elationships. The maximum value of ARF is and minimum value of ARF is 0. Attibute Reuse Level of system is calculated as (ARF x 00)%. 4. FLAW IN EXISTING METRICS To study the flaws in existing metics conside the following system : (a) Flaw in MIF: Definition of the MIF is inconsistent with the 0- scale [6]. In the system shown in figue, all methods of base class have been inheited, by all classes that ae able to inheit them. But MIF = 66.6%. But it seems that the MIF value fo this system should be 00%.
System Level Reuse Metics fo Object Oiented Softwae: An Altenative Appoach 5 4.4 Flaw in ARPIR Definition of the ARPIR has same poblem as discussed in MRPIR and esolved by ARF metic. 5. CASE STUDY Conside the following thee systems : Figue Poposed Metic MRF esolved this poblem. In the system shown in figue, 3 MRF = = 3 Hence MRF = 00% (b) Flaw in AIF: Definition of the AIF has same poblem as discussed in MIF and it is esolved by ARF. 4.3 Flaw in MRPIR Definition of the MRPIR is dependent on numbe of methods in the base class. Conside the system shown in figue, MRPIR = 3 If the numbe of methods in base class A ae 4 then MRPIR = 4. That means value of MRPIR depends upon the numbe of inheited methods in the base class. Thee is futhe no maximum and minimum value of MRPIR. Poposed Metic MRF esolved this poblem. In the system shown in figue, value of MRF = i.e. 00%. If the numbe of methods in base class A ae 4 then also value of MRF = i.e. 00%. Figue 2: Figue 3: (System) (System2)
52 Sushil Goel and Rajesh Vema Table 2 shown the value of AIF, ARPIR and ARF fo system, system 2 and system 3. Table 2 SYSTEM SYSTEM2 SYSTEM3 AIF 0.286 0.333 0.353 ARPIR ARF 0.4 0.5 0.545 A compaison study of AIF, ARPIR and ARF is shown in following chat : Figue 4: (System 3) Table shows the value of MIF, MRPIR and MRF fo system, system 2 and system 3. Table SYSTEM SYSTEM 2 SYSTEM 3 MIF 0.545 0.533 0.62 MRPIR 3 2.66 3 MRF 0.8 0.857 0.727 A compaison study of MIF, MRPIR and MRF is shown in following ba chat : Figue 5 Figue 6 6. DISCUSSION AND CONCLUDING REMARK Accoding to table, value of MRF is maximum is system 2. It indicates that level of method euse is highest in system 2 as compae to system and system 3. Howeve, value of MIF is maximum in system 3. It indicates that level of method euse is highest in system 3 as compae to system and system 2. The value of MRPIR is same in system and system 3. It indicate that level of method euse is same in system and system 2. Accoding to table 2, value of ARF is maximum in system 3. It indicates that level of attibute euse is highest in system 3 as compae to system and system 2. Howeve, value of AIF is also maximum in system 3. The value of ARPIR is same in system, system 2 and system 3. It indicates that level of attibute euse is same in all systems. This pape have been poposed two new system level euse metics. These metics esolved the flaws o inconsistencies in the existing euse metics. These metics ae helpful to find the euse
System Level Reuse Metics fo Object Oiented Softwae: An Altenative Appoach 53 level of object-oiented system. This study is suppoted by simple case study howeve, the same study can be eplicated empiically with lage industial pojects to genealize esults. REFERENCES [] Fenton, N., Softwae Metics : A Rigoous Appoach, Chapman & Hall, London, 99. [2] Fenton, N. E., and Pfleege, S. L., Softwae Metics : A Rigoous and Pactical Appoach, Intenational Thomson Compute Pess, London, 996. [3] Bieman, J., Deiving Measues of Softwae Reuse in Object-Oiented Systems. Spinge- Velag, London 992, p. 63-83. [4] Nasib S. Gill and Sunil Sikka., Inheitance Hieachy Based Reuse & Reusability Metics in OOSD, IJCSE, 3(6), 20. [5] Abeu, Fenando B, The MOOD Metics Suit, Poc. ECOOP 95 Wokshop on Metics, 995. [6] Amandeep Kau, Satwinde Singh, D. K. S. Kahlon and D. Pavinde S. Sandhu, Empiial Analysis of CK & MOOD Metic Suit, Intenational Jounal of Innovation, Management and Technology, (5), 200. [7] G. Shanmugasundaam, V. Pasanna Venkatesan and C. Punitha Devi, Reusability Metics An Evolution based Study on Object-Oiented System, Component based System and Sevice. Oiented System, Jounal of Computing Pess, NY. USA, 3(9), 20. [8] S. R. Chidambe and C. F. Kemee, A Metics Suite fo Object Oiented Design, IEEE Tansactions on Softwae Engineeing, 20(6), 994, 476-493. [9] S.R. Chidambe and C.F. Kemee, Towads a Metics Suite fo Object Oiented Design, Poceeding on Object Oiented Pogamming Systems, Languages and Applications Confeence (OOPSLA 9), ACM, 26(), 99, 97-2. [0] W.Li, Anothe Metic Suite fo Object Oiented Pogamming, The Jounal of System and Softwae, 44(2), 998, 55-62. [] K. K. Aggawal, Yogesh Singh, Avinde Kau, Ruchika Malhota, Empiical Study of Object Oiented Metics, Jounal of Object Technology, 5(8), 2006. [2] Sushil Goel, Pogamming with C++, Nataj Publishing House, Fist Edition, 2006.