Universiti Putra Malaysia Slicing Object Oriented Programs For . - Upm

Transcription

UNIVERSITI PUTRA MALAYSIASLICING OBJECT ORIENTED PROGRAMS FOR MAINTENANCEPURPOSESHAMED JASEM KHALED AL-FAWAREHFSKTM 2001 6

SLICING OBJECT ORIENTED PROGRAMS FOR MAINTENANCE PURPOSESByHAMED JASEM KHALED AL-FAWAREHThesis Submitted in Fulfilment of the Requirements for the Degree of Doctor ofPhilosophy in the Faculty of Computer Science and Information TechnologyUniversiti Putra MalaysiaJuly 2001

In the nameof Allah, the Beneficent, the Merciful.Has there not been over Man a long period of Time when he was nothmg-- (not even)mentioned?2Verily We created Man from a drop of mingled sperm m order to try him so We gave him(the gifts) of Hearing and Sight3We showed him the Way whether he be grateful or ungrateful (rests on his will)"Holy Quran, Surat Al-Insan Ayah1-3 "ToUnconditional (Loves, Dua, Supports, Guidance, and En,couragement)To My Mother, Eldest Brother Ali, and My Family11

Abstract of thesis presented to the Senate of Universiti Putra Malaysia in fulfilment of therequirement for the degree of Doctor of PhilosophySLICING OBJECT ORIENTED PROGRAMS FOR MAINTENANCE PURPOSESByHAMED JASEM KHALED AL-FAWAREHJuly 2001Chairman: Associate Professor Abdul Azim Abd. Ghani, Ph.D.,Faculty:Computer Science and Information TechnologyObject oriented approach is growing very fast in various applications of thecomputer science. Those applications may contain a lot o f entity relationships which,need to be understood by the maintainers. These relationships (involving classes,message, variables, . . . etc.) will make maintainers and developers face several problemsto understand, make changes, modify, or enhance a huge software system that containsthousands of classes without automatic aids. Therefore several problems arise in themaintenance of object oriented program that is software understanding, complexdependencies, inheritance, polymorphism and dynamic binding.An approach for formally defining slices for object o riented programs is animportant problem in the maintenance phase. This thesis proposes definitions of slices forobject o riented programs. Basic relations such as Usage, Affect and Inheritance aredefined, and they are extended to a family of dependence relations between entities inobject oriented programs and defines slicing techniques based on these relations. SliceIII

collection methods for specified slice criteria are given. This approach shows how theproposed slicing concepts and rules can be applied within the s oftware maintenanceprocess by giving an illustration through examples written by Java and Delphiprogramming languages.2The research also develop a prototype of an object oriented system tool (0 SMt)which represent an automatically extractable and captures an object oriented softwaresystem dependencies in order to aid in maintenance phase. The dependencies occurs andexplain in this research are control dependence, statement dependence on a variable,statement dependence on a method, variable dependence on statement, variabledependent on a method, Class-Class dependence through usage, Class-Class dependencethrough inheritance,Class-Class dependence for causing side effects,methoddependence on another method, and method dependence on a variable. The 02SMtcaptures program slicing according to the slicing concepts, rules and definitions to featureout the dependencies with the basic object oriented relations.This research also, discusses an object oriented dependence graph (02DG). The02DG categorized according levels. The first category is class-level i nvolving a class toanother class. The second category ismethod-levelinvolving a method or a statementwithin a method to another method or variable in a class. The final category is statement level which is basically intra-method involving statements within a given method. S lices,in tum, can also be categorized according to such levels of dependencies they intend tocapture.iv

Abstrak tesis yang dikemukakan kepada Senat Universiti Putra Malaysia sebagaimemenuhi keperluan untuk i jazah Doktor FalsafahSLICING OBJECT ORIENTED PROGRAMS FOR MAINTENANCE PURPOSESOlehHAMED JASEM KHALED AL-FAWAREHJulai 2001Pengerusi:Profesor Madya Abdul Azim Abd. Ghani, Ph.D.,Fakulti:Sains Komputer Dan Teknologi MaklumatPendekatan berorientasi objek berkembang dengan pesat dalam pelbagai aplikasisains komputer. Aplikasi-aplikasi itu mungkin mengandungi beberapa hubungan entitiyang perlu difahami oleh penyenggara. Hubungan-hubungan ini (termasuk kelas, mesej,pembolehubah, . . . dll) akan meyebabkan penyenggara dan pembangun menghadapibeberapa masalah untuk memahami, membuat penukaran, perubahan, atau penambahanterhadap sistem perisian yang besar yang mengandungi ribuan kelas tanpa bantuanautomatik. Oleh kerana itu beberapa masalah timbul dalam penyenggaraan atur carabero rientasiobjekiaitu kefahama,kebergantunganyang kompleks,pewarisan,polimorfisma dan ikatan dinamik.Satu pendekatan untuk mentakrif secara formal keratan untuk atur yenggaraan.Tesisinimencadangkan takrifan keratan untuk atur cara berorientasi objek. Hubungan as as sepertiUsage, Affect dan Inheritence ditakrifkan, dan mereka dipanjangkan ke kelompokhubungan kebergantungan diantara entiti-entiti dalam atur cara berorientasi objek danmentakrif teknik mengerat berasaskan hubungan ini. Kaedah pengumpulan keratan untukv

kriteria keratan tertentu diberi juga. Pendekatan ini menunjukkan bagaimana konsep danperaturan mengerat dapat digunakanke dalam process penyenggaraan perisian denganmemberi ilustrasi melalui contoh-contoh yang ditulis dalam bahasa Java dan Delphi.Kajian ini juga membangunkan satu prototaip sistem alatan berorientasi objek(02SMt) yang mewakili ekstraksi secara automatik dan mengambil kebergantungan kebergantungan sistem perlSlan berorientasi-objek untuk membantu dalamfasapenyenggaraan. Kebergantungan yang terjadi dan diterangkan dalam kajian ini nkeataspembolehubah,kebergantungan pemyataan ke atas kaedah, kebergantungan pembolehubah ke ataspernyataan, kebergantungan pembolehubah ke atas kaedah, kebergantungan kelas-kelasmelalui kegunaan, kebergantungan kelas-kelas melalui pewarisan, kebergantungan kelas kelas untuk menyebabkan kesan sampingan, kebergantungankaedah ke atas kaedah lain,2dan kebergantungan kaedah ke atas pembolehubah. 0 SMt mengambil keratan aturcaramengikut konsep, peraturan dan takrifan pengeratan untuk mencirikan kebergantungandengan hubungan berorientasi-objek asas.2Kajian ini juga membincangkan graf kebergantungan berorientasi objek (0 DG).02DG dikategorikan menuruti peringkat-peringkat. Kategori pertama ialah peringkatkelas yang melibatkan satu kelas kepada kelas lain. Kategori kedua ialah peringkatkaedahyangmelibatkansatukaedahatau satu pemyataan dalam satu kaedah ke kaedahlain atau pembolehubah dalam satu kelas. Kategori terakhir ialah peringkat pernyataanyang secara asasnya ialah kaedah-intra yang melibatkan pernyataan di dalam rgantungan yang ingin ditawan.vimenurutiperingkat-peringkat

PERPUSTAKAANlt ITI PUT A MALAYSIAACKNOWLEDGMENT IV In the name of Allah, the Beneficent, the Merciful.I would like to take this opportunity to record my gratitude towards the manypeople who touched my life in significant ways; particularly those who help me duringthe time I was enrolling in the Ph.D. program at University Putra Malaysia.Associate Prof. Dr. Abdul Azim Abd. Ghani and Dr. Nor Adnan Yahaya my supervisorand co-supervisor, guide and friend have shown me how wonderful a student-teacherrelationship can be. They have always takes time to listen to my ideas, and they havepatiently answered my questions, invaluable guidance, fruitful discussion, patience andcontinued encouragement provided me at every stage of this thesis.I would like to thank all the member of my Ph.D. supervision committee.Dr. Ramlan Mahmod and Associate Prof. Dr. Md. Yazid for taking the time to review mythesis and offer thei r invaluable suggestions. I would also like to thank Associate Prof.Dr. Ali Mamat the member of my supervision committee during my master degree for hishelp and suggestions.I would like to convey my appreciation to the Faculty of C omputer Science andIT, The University Library and Universiti Putra Malaysia for providing assistance at onetime or another. I would like also to thank the faculty dean Secretary Puan Norhaidah forher help and patient. My special thanks to the gentle honesty friends from Jordan,Malaysia, Iraq, Libya, . . for their encouragement.lowe very special thank to Associate Prof. Dr. Azim, Associate Prof. Dr. Bachog,and Prof. Usmani to provide me work in the Software Development Institute (SDI) myvery gratefully acknowledgment to them.My families are amongst the wisest teachers I have and they have taught me thefine arts of survival, communication, and humanity. To covert my weaknesses into mystrengths; to comprehend the importance of understanding fundamental concepts in theirentirety; to fully realize the harm that any form of deception can cause; to learn to adaptto new environments and coexist with a wide cross-section of humanity; to acceptdisappointments, rewards and appreciation: to be honest, truthful, enterprising,resourceful and hardworking. My mother, unconditional loves, prayer (Dua) and supportshave been my greatest source of solace, strength and security. Gentle guidance, support,encourage and help a l ot, my elder brother Ali l owe special thanks for urging me tocomplete my studies. I would like also record my appreciation for the help extended,support and concern shown by my brothers Khaled, Mammdoh, M obarak, Omar andMohd. I would like to express my warmest gratitude to my sisters, nephews, nieces,uncles, aunts, and cousins for their prayers, love, generous moral and support during mystudy. Finally and most important, I would like to express my most sincere and warmestgratitude to my wife for her patient and encouragement.All praises for the Almighty, without whose will everything would cease to be.vii

I certify that an Examination Committee met on 18th July 2001 to conduct the finalexamination of Hamed Jasem Khaled AI-Fawareh on his Doctor of Philosophy thesisentitled "Slicing Object Oriented Programs for Maintenance Purposes" in accordancewith Universiti Pertanian Malaysia (Higher Degree) Act 1980 and Universiti PertanianMalaysia (Degree) Regulations 1981. The Committee recommends that the candidate beawarded the relevant degree. Members of the Examination Committee are as follows:MOHAMED OTHMAN, Ph.D.Faculty of Computer Science and Information TechnologyUniversiti Putra Malaysia(Chairman)ABDUL AZIM ABD. GHANI, Ph.D.Associate ProfessorFaculty of Computer Science and Information TechnologyUniversiti Putra Malaysia(Member)RAMLAN BIN MAHMOOD, Ph.D.Faculty of Computer Science and Information TechnologyUniversiti Putra Malaysia(Member)MD YAZID MOHD SAMAN, Ph.D.Associate ProfessorFaculty of Computer Science and Information TechnologyUniversiti Putra Malaysia(Member)NOR ADNAN YAHAVA, Ph.D.Telekom Malaysia (R&D)UPM-MTDC Technology Incubation CentreUniversiti Putra Malaysia(Member)PAUL BAILES, Ph.D.ProfessorDepartment of Computer Science and EngineeringUniversity of QueenslandAustralia(External Examiner).::III.rf LJALI MOHAYIDIN, Ph.D.ProfessorlDeputy Dean of Graduate SchoolUniversiti Putra MalaysiaDate:24VlllAUG 2001

This thesis submitted to the Senate of Universiti Putra Malaysia has been acceptedfulfilment for the requirement for the degree of Doctor of Philosophy.AlNI IDERIS, Ph.D.ProfessorDean of Graduate School,Universiti Putra MalaysiaDate:o 8 NOV 7001as

I hereby declare that the thesis is based on my original work except for quotations andcitations which, have been duly acknowledged. I declare that it has not been previously orconcurrently submitted for any other degree at UPM or other institutions.(Hamed Jasem Khaled AI-Fawareh)

TABLE OF CONTENTSPageDEDICATION.ABSTRACT.ABSTRAK. . . . . . . . . . . . . . . . . . . . . . . . .ACKNOWLEDGEMENTS.APPROVAL . , . .DECLARATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .LIST OF TABLES. . .LIST OF Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1 .2Problem Definition. . . . . . " . . . . . . . . . . . . . . . . . . . . " . . . . . . . . . . . . . . . . . . .1.3Aims of the Research . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1 .4Research Methodology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .221 .4. 1Overview o f 0 SMt and 0 DG. . . . . . ." . . .1 .4Thesis Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1 .11 .31 .71.91 . 101. 1 2OVERVIEW OF SOFTWARE MAINTENANCEIntroduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2. 12.2Historical Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2.3Definitions and Activity. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Approaches . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2.4ForwardEngineering. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2 .4. 1Restructuring. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2.4.2Reengineering. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2 .4 . 32.4.4Reverse Engineering. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2 .4.4. l Redocumentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2.4.4.2 Design Recovery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2.4.4 . 3 Reverse Engineering Purposes . . . . . . . . . . . . . . . . .System Automated Support. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2.5The Essence of Object Oriented Technique . . . . . . . . . . . . . . . . . . . . . . . . .2.62.7Maintaining Object Oriented System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2.8Summary and Conclusion. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2 .12.22.32.52.62.62.92.92.92. 122. 1 32.142. 1 42. 1 72.20OVERVIEW OF PROGRAM SLICINGIntroduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3. 1Program Slicing: Original Studies. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3.2., .,Program Slicing Techniques . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .) .)3.4Static Slicing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3.5Static Relation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3.6Dynamic Slicing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3. 7Dynamic Relation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3. 13.2., .,.) . .)3.43.53.63. 9.23xi

Debugging. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Control and Data Dependencies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Related Research. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .XREF/XREFDB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3. 1 0. 1OOTM: Object Oriented Testing and Maintenance. .3. 1 0.2SAMS : System Analysis and Maintenance System. . . . .3. 1 0. 3SCRUPLE. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3. 1 0.4LLSA/LLDP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3. 1 0. 53. 1 0.6Valhalla. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .CIAICIA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3. 1 0. 7Related Research in Program S licing. . . . . . . . . . . . . . . . .3. 1 0 . 9Summary and conclusion. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3. 103. 1 13. 123. 1 33 . 143. 1 43. 143. 1 53. 1 53. 1 63.1 63. 1 7CONCEPTS FOR SLICING OBJECT ORIENTED PROGRAMS4. 1Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4.2Work on Slicing Object Oriented Programs. . . . . . . . . . . . . . . . . . . . . . .4.2 . 1Inheritance. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Polymorphism. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4.2.2Dynamic Binding. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4.2. 3Object Oriented Relationships . . . . . . . . . . . . . . . . . . . . . . . .4.2.44.3Dependencies i n Object-Oriented Programs. . . . . . . . . . . . . . .4.4Basic Relationships . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4.5Dependencies. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Underlying Concepts for Slicing Object-Oriented Programs . . . .4.64.7Summary and Conclusion. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4.14.14.44.54.64.74.S4.94. 1 14 . 154.24TECHNIQUES AND ALGORITHMS FOR SLICING OBJECTORIENTED PROGRAMSIntroduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5.15.2General Approach. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Slicing Algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5.35 .4Apply Program Slicing to Maintenance phase . . . . . . . . . . . . . . . . . . . . . .25.5Object Oriented Dependence Graph (0 DG). . . . . . . . . . . . . . .5.6Summary and Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5.15.15.35. 1 S5. 1 95 .243.83. 93. 1 03. 1 1456OBJECT ORIENTED SYSTEM MAINTENANCE TOOL (02SMT)DESIGN AND IMPLEMENTATIONIntroduction . . . . . . . , . . . . , . . . . . . . . . . . . . . . , . . . . . . . . . . . . 6.16.16.202SMt Process and Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.26.302SMt Architecture and Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.5Syntax Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.66 . 3. 1Extractor Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 . 96. 3.2S licing Module . . . . . . . . . . . . . . . . . . . . . . . . . .6. 1 06.3.3Features (Users Interface) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6. 1 36. 3.4Query Module . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6. 1 46. 3.5Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6. 1 66. 3.66.5Summary and Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6 . 1 7.xii. . .

TESTING METHODOLOGYIntroduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7. 17.2The Test Scenarios . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7.2 . 1 The First Program: Hotel Reservation System Using JavaLanguage. . . . . . . . . . . . . . . .7.2.2 The Second Program: Compute Area System Using JavaLanguage. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7 . 2. 3 The Third Program: Personal Book Inventory SystemU sing Java Language. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7.2 . 4 The Fourth Program: Compute Area System UsingDelphi Language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7.5Summary and Conclusion. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7.227 .25EVALUATING PROGRAM SLICES AS A MAINTENANCEMETHODOLOGY8.1Software Maintenance Process Model. . . . . . . . . . . . . . . . . . . . . . . . . . . .Validation Approach . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8.2A pilot study. . . . . . . . . . .8.38 . 3. 1 Rules for Modifying the Program . . . . . . . . . . . . . . . . . . . . . . . . .8.3.2 Verifying the Change . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8 . 3.3 B ackground o f the Subjects. . . . . . . . . . . . . . . . . . . . . . . . . . . . .8 . 3. 4 SubjectExperiment 1 (without S licing Technique):. . . . . . . .8. 3.5 SubjectExperiment 1 (with S licing Technique):. . . . . . . . . .Analysis. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4.88.5Experiment Subjects' Comments. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8. 18.38.68.68.78.78.88 .98.1 28. 1 3CONCLUSION AND FURTHER RESEARCHConclusion. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9. 1Contribution. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9.2Further Research. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9. 39. 19. 39.6REFERENCES.R. 1789APPENDICESAppendix A: Hotel Reservation System Using Java Language. . . . . .Appendix B: Compute Area System Using Java Language . . . . . . . . . . . . .Appendix C: Example of Book Reservation Using Java Language . . . . . . .AppendixD:ComputeAreaSystemU singDelphiLanguage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .AppendixE: Coordi nate System Using Java Language . . . . . . . . . . . . . . . . . . . .Appendix F: Java Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Appendix G: Background Questionnaire . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Appendix H: Post-experiment questionnaire for experiment 2 only(slicing group only). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .BIODATA OF THE AUTHOR. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .xiii7.17.27.47. 1 67.20A.2A. 8A. IlA. 14A. 17A. 1 9A.2 1A.2 3B. 1

LIST OF FIGURESFigure1PageSoftware Restructure(ArnoldI 989).ofCOBOLprogramming(25],p12 9. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .22.8An Example of a Function Invocation in Object Oriented Program(King et. al. 1 995) . . . . . . . . . . . . . . . . . . . . . . '" . . . . . . . . . . . . . . . . . . . . . . . . . . . .2.1 63Static SlicingExample . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3.54Dynamic slicingExample. . . . . . . . . . . . . . .3.95CFG of the example program of Figure 3 (b). . . . . . . . . . . . . . . . . . . . . . . . . . .3.1 26A Class Can Have Many Different Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4.37A Cylinder Class Inherits Data and Method from Circle Class. . . . . . . . . . . . .4.48A Polymorphism Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4.69A Diagram Illustrating the Steps in the Proposed Approach . . . . . . . . . . . . . .5.210JavaExample o ne . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5.511JavaExample Two . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5.512Algorithm for Statement Number. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5.613Algorithm for Slicing Rule One . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5.714Algorithm for Slicing Rule Two . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5 .815Algorithm for Slicing Rule Three . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ,.5.916Algorithm for S licing Rule Four . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5. 1 117Algorithm for Slicing Rule Five . . . . . . . . . . . . . . . . . . . . " . . . . . . . . . . ,.5 . 1218Algorithm for Slicing Rule Six . . . . . . . . . . . . . . . . . . . . . '" . . . . . . . . . .5.1 319Algorithm for Slicing Rule Seven . . . . . . . . . . . . . . . . . . . . , . . . . . . . . . . . . . . . . . . . . .5.14xiv

20Algorithm for Slicing Rule Eight. . . . . . . . . . . . . . . . . . . . . . . . .5. 1 521Algorithm for Slicing Rule Nine . . . . . . . . . . . . . . . . . . . . . . ,5. 1 622Algorithm for Slicing Rule Ten. . . . . . . . . . . . . . . . . .5. 1 7Level of Dependence Graph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5.2024Illustration of Class Level . , . . . .5.2125Hierarchical 02DG with Method Level. . . . . . . . . . . . . . . . . . . . . . ,.5.22262Hierarchical 0 DG with Statement Level. . . . . .5.242720 SMt Process. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.32820 SMt Environment. . . . . . . . . . . , " . , . . .6.42920 SMt Architecture. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.630Interaction of Scanner with Parser. . . . . . . . . . ,. . .6.731Scanner Interaction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.832Parser Interaction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.833Hashtable. . . . . . . . . . . . . . . . . . . . .6.1 034Structure of Slicing Representation. . . . . . . . . . . . . . . . . ,6.1 135Dynamic Structure of Slicing Representation. . . . . . . . . . . . . . . . . . .6. 1 236Main Window. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.1 437Class Selections Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.1538Method Selections Menu . . . . . . . . . . " . . . . . . . . . . . . . . .6. 1 539Variable Selections Menu . . . . . . . . . . . . . . . . . . . . .6.1640Mai ntaining steps using slicing program . . . . . . . . . . . . . . . . . . . . . . . .7.4."e4142Slice( , Discount. increase.], Discount. increase.] 0, {Rate}» . . . . . . . . .Slicing Menu for Slicing Criteria 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .,xv7.77.8

c4344Shce« DIscount zncrease46DIscount zncrease10,(discount»)Shcmg Menu for SlICIng Cntena 2"451,Shce« ,Dlscount zncrease1,79710DIscount zncrease 7,{Rate,dlscount»)711712ShcIng Menu for SlICIng Cntena 3II47Shce« , Hotel ReservatIOnmazn, L1StLznkB prznt, {length, node2}»71311484950c , TestComputeArea mazn 2, Czrcle Czrcle, {radius, weight} "SlIce( ,C TestComputeArea mazn.f.,Myinput x,»II , bookMazn mazn 53, Bookshelf count, 717718721II5152c , InnerCylznderArea InnerArea 1, Cylznder CylmderArea, {r,h} 724Software Mamtenance Pro

An approach for formally defining slices for object oriented programs is an important problem in the maintenance phase. This thesis proposes definitions of slices for object oriented programs. Basic relations such as Usage, Affect and Inheritance are defined, and they are extended to a family of dependence relations between entities in