Exploiting Similarity Patterns in Web Applications For
Total Page:16
File Type:pdf, Size:1020Kb
View metadata, citation and similar papers at core.ac.uk brought to you by CORE provided by ScholarBank@NUS EXPLOITING SIMILARITY PATTERNS IN WEB APPLICATIONS FOR ENHANCED GENERICITY AND MAINTAINABILITY DAMITH CHATURA RAJAPAKSE (BSc.Eng (Hons), SL) A THESIS SUBMITTED FOR THE DEGREE OF DOCTOR OF PHILOSOPHY SCHOOL OF COMPUTING NATIONAL UNIVERSITY OF SINGAPORE Acknowledgments My profound thanks are due to the following persons. • My advisor A/P Stan Jarzabek, for the innumerable ways in which he made this thesis possible, and for guiding me with boundless patience, never shying away when help was needed. • Members of my thesis committee A/P Dong Jin Song and A/P Khoo Siau Cheng for their valuable advice throughout this journey of four years, and for spending their valuable time in various administration tasks related to my candidature. • Collaborators, advisors, and evaluators who gave feedback about my research: Dr. Bimlesh Wadhwa, Dr. Irene Woon, and Prof Kim Hee-Woong (NUS), Prof. Andrea De Lucia and Dr. Giuseppe Scanniello (Università di Salerno, Italy), Prof. Katsuro Inoue, Dr. Shinji Kusumoto, and Higo Yoshiki (Osaka Uni. Japan), Dr. Toshihiro Kamiya (PRESTO, Japan), Sidath Dissanayake (SriLogic Pvt Ltd, Sri Lanka), Ulf Pettersson (STE Eng Pte Ltd., Singapore), Yeo Ann Kian, Lai Zit Seng, and Chan Chee Heng (NUS), Prof. Athula Ginige (UWS, Sydney), Prof. San Murugesan (Southern Cross University, Australia). • My colleagues at NUS, Hamid Abdul Basit, Upali Sathyajith Kohomban, Vu Tung Lam, Sun Jun, Yuan Fang, David Lo, and Sridhar KN in particular, for the comradeship during the last four years. • Other friends at NUS, and back home in Sri Lanka (whom I shall not name for the fear of missing out one), for lightening my PhD years with your companionship. • Various colleagues and students who took part in my experiments, Pavel Korshunov, Fok Yew Hoe, Li Meixuan, Anup Chan Poudyal and Tiana Ranaivojoelina in particular. ii • Madam Loo Line Fong and others in the graduate office, and system admin Bernard Tay for taking care of various admin matters related to my candidacy. • Anonymous examiners for their valuable comments, advice and very encouraging feedback on the thesis. • My parents and sister for being there for me at good and bad times. • Most of all, my wife Pradeepika who was a pillar of strength at every step of the way. Her boundless love, encouragement and assistance simply defy description. iii Table of Contents ACKNOWLEDGMENTS ................................................................................................................II SUMMARY……. ........................................................................................................................VI LIST OF TABLES. ........................................................................................................................1 LIST OF FIGURES ........................................................................................................................2 CHAPTER 1. INTRODUCTION ................................................................................................6 1.1. The problem..............................................................................................................6 1.2. Thesis objectives ......................................................................................................7 1.3. Thesis scope..............................................................................................................7 1.4. Research and contributions.......................................................................................8 1.5. Experimental methods............................................................................................12 1.6. Thesis roadmap.......................................................................................................12 1.7. Research outcomes .................................................................................................14 CHAPTER 2. BACKGROUND AND RELATED WORK ............................................................15 2.1. Clones.....................................................................................................................16 2.1.1. Simple clones .................................................................................................16 2.1.2. Structural clones............................................................................................17 2.1.3. Reasons for clones .........................................................................................18 2.1.4. Effects of clones .............................................................................................21 2.1.5. Clone detection ..............................................................................................23 2.1.6. Clone taxonomies...........................................................................................24 2.2. Clone management .................................................................................................24 2.2.1. Preventive clone management .......................................................................24 2.2.2. Corrective clone management .......................................................................27 2.2.3. Compensatory clone management .................................................................29 2.2.4. Practical challenges in clone management ...................................................30 2.3. An overview of web application domain................................................................35 2.3.1. Web applications............................................................................................35 2.3.2. Web technologies ...........................................................................................37 2.4. Web engineering Vs software engineering.............................................................45 2.5. Cloning in the web application domain..................................................................48 2.6. Chapter conclusions................................................................................................49 CHAPTER 3. AN INVESTIGATION OF CLONING IN WEB APPLICATIONS .............................51 3.1. Experimental method..............................................................................................52 3.2. Overall cloning level ..............................................................................................56 3.3. Cloning level in WAs Vs cloning level in traditional applications ........................61 3.4. Factors that affect the cloning level........................................................................62 3.5. Identifying the source of clones..............................................................................63 3.6. Chapter conclusions................................................................................................65 CHAPTER 4. MORE EVIDENCE OF TENACIOUS CLONES .....................................................66 4.1. Case study 1: Java Buffer library ...........................................................................67 4.2. Case study 2: Standard Template Library ..............................................................70 4.3. Examples of tenacious clones.................................................................................71 4.4. Chapter conclusions................................................................................................77 CHAPTER 5. MIXED-STRATEGY .........................................................................................78 5.1. Introduction to XVCL ............................................................................................79 5.2. Overview of mixed-strategy ...................................................................................83 5.3. Benefits and drawbacks of mixed-strategy.............................................................84 5.4. Mixed-strategy success stories ...............................................................................86 5.5. Mixed-strategy and tenacious clones......................................................................86 5.6. Why choose mixed-strategy?..................................................................................87 5.7. Chapter conclusions................................................................................................88 ii CHAPTER 6. UNIFICATION TRADE-OFFS.............................................................................89 6.1. Case study: Project Collaboration Environment.....................................................90 6.1.1. Project Collaboration Environment (PCE) ...................................................91 6.1.2. Experimental method .....................................................................................93 6.1.3. PCEsimple .....................................................................................................96 6.1.4. PCEpatterns...................................................................................................97 6.1.5. PCEunified...................................................................................................100 6.1.6. PCEms .........................................................................................................101 6.1.7. Overall comparison .....................................................................................102 6.1.8. PCE on other platforms ...............................................................................105