Understanding Services and Their Clients
Total Page:16
File Type:pdf, Size:1020Kb
1 Web Service Growing Pains: Understanding Services and Their Clients Tiago Espinha © 2014, Tiago Espinha Thesis style design: Tiago Espinha Cover design: Tiago Espinha Printed by: CPI Koninklijke Wöhrmann In memory of my grandfather, José Aurélio Mourinho Rodrigues Web Service Growing Pains: Understanding Services and Their Clients Proefschrift ter verkrijging van de graad van doctor aan de Technische Universiteit Delft, op gezag van de Rector Magnificus prof. ir. K.C.A.M. Luyben, voorzitter van het College voor Promoties, in het openbaar te verdedigen op vrijdag 20 maart 2015 om 10:00 uur door Tiago ESPINHA Master of Science University of Leicester, United Kingdom geboren te Marinha Grande, Portugal. Dit proefschrift is goedgekeurd door de promotor: Prof. dr. A. van Deursen Copromotor Dr. A.E. Zaidman Samenstelling promotiecommissie: Rector Magnificus Voorzitter Prof. dr. A. van Deursen Delft University of Technology, promotor Dr. A.E. Zaidman Delft University of Technology, copromotor Prof. dr. G.-J. Houben Delft University of Technology Prof. dr. ir. M.F.W.H.A. Janssen Delft University of Technology Prof. dr. B. Adams École Polytechnique de Montréal, Canada Dr. S. Jansen Utrecht University, The Netherlands Dr. H.-G. Gross Esslingen University, Germany This work was carried out as part of the Jacquard ScaleItUp project, sponsored by the Netherlands Organisation for Scientific Research (Nederlandse Organisatie voor Weten- schappelijk Onderzoek — NWO). ISBN: 978-94-6186-406-2 Copyright © 2014, Tiago Espinha Thesis style design: Tiago Espinha Cover design: Tiago Espinha Cover artwork: © Depositphotos.com/lightsource Printed by: CPI Koninklijke Wöhrmann Contents 1 Introduction 3 1.1 From the Internet to Web Services ...................... 3 1.1.1 Simple Object Access Protocol (SOAP) ................ 4 1.1.2 Representational state transfer (REST) ................ 4 1.1.3 Web Services .............................. 4 1.2 Terminology ................................... 5 1.3 Problem Statement ............................... 7 1.3.1 Research Questions ........................... 8 1.3.2 Research Methods ........................... 9 1.4 Thesis Outline ................................. 11 1.5 Origin of Chapters ............................... 11 1.6 Additional Publications ............................ 11 2 Web APIs: Loosely Coupled yet Strongly Tied 13 2.1 Introduction ................................... 13 2.2 Terminology ................................... 15 2.2.1 SOAP .................................. 15 2.2.2 REST .................................. 15 2.2.3 JSON-RPC & JSON .......................... 16 2.3 Experimental Setup ............................... 16 2.3.1 Experimental Setup for the Client-Side Investigation ........ 17 2.3.2 Experimental Setup For The End-to-End Analysis ......... 20 2.4 Client-side Analysis ............................... 21 2.4.1 Interviews With Client Developers .................. 21 2.4.2 Web API Characteristics ........................ 26 2.4.3 Impact on Client Code ......................... 28 2.5 End-to-End Analysis .............................. 34 i ii CONTENTS 2.5.1 VirtualBox ............................... 34 2.5.2 XBMC .................................. 37 2.6 Discussion .................................... 41 2.6.1 Answering the Research Questions .................. 41 2.6.2 Recommendations ........................... 43 2.6.3 Threats to validity ........................... 46 2.7 Related work .................................. 46 2.8 Conclusion .................................... 48 3 Web API Clients: How Robust is Yours 51 3.1 Introduction ................................... 51 3.2 Approach .................................... 53 3.2.1 Mutation Analysis — Mutant Generation .............. 53 3.3 Experimental Setup ............................... 57 3.3.1 Application Selection .......................... 57 3.3.2 Applying the Mutations ........................ 58 3.3.3 Caching and Versioning ........................ 60 3.3.4 Developer Interviews .......................... 60 3.4 Experimental Results .............................. 61 3.4.1 Application Behavior .......................... 62 3.4.2 Behaviors Per Mutation Type ..................... 62 3.4.3 Data Caching .............................. 66 3.4.4 Versioning ................................ 66 3.4.5 Developer Interviews .......................... 67 3.5 Threats to Validity ............................... 69 3.6 Related Work .................................. 70 3.7 Conclusion .................................... 70 4 SOA: Proposing a Standard Case Study 73 4.1 Introduction ................................... 73 4.2 Background Research .............................. 74 4.3 Stonehenge ................................... 78 4.3.1 Motivation ............................... 78 4.3.2 System Description ........................... 78 4.3.3 Usage Scenarios ............................. 80 4.4 Research Agenda ................................ 81 4.4.1 Online Updating and Versioning ................... 81 4.4.2 Online Diagnosis and Testing ..................... 82 4.5 Summary .................................... 82 5 SOA: Understanding its Runtime Topology 85 5.1 Introduction ................................... 85 5.2 Approach .................................... 87 CONTENTS iii 5.2.1 Required data .............................. 87 5.2.2 Data extraction ............................. 89 5.2.3 Data presentation ........................... 90 5.2.4 Serviz .................................. 91 5.3 Experimental Setup ............................... 91 5.3.1 One-group pretest-posttest ....................... 91 5.3.2 Assignment ............................... 94 5.3.3 Pilot ................................... 96 5.4 Results ...................................... 96 5.4.1 Pretest Data .............................. 96 5.4.2 Posttest Data .............................. 98 5.5 Discussion .................................... 101 5.5.1 Revisiting the Research Questions .................. 101 5.5.2 Threats to validity ........................... 102 5.6 Related work .................................. 103 5.7 Conclusion .................................... 104 5.7.1 Future work ............................... 104 6 SOA: Users and Versions in Multi-Tenant Systems 107 6.1 Introduction ................................... 107 6.2 Approach .................................... 109 6.2.1 Data Requirements ........................... 110 6.2.2 Data Extraction ............................ 110 6.3 Serviz ...................................... 111 6.3.1 User Filtering .............................. 112 6.3.2 Service/Version Filtering ........................ 112 6.3.3 Combined Filtering ........................... 112 6.3.4 Histograms ............................... 113 6.4 Experimental Setup ............................... 113 6.4.1 Case Study System ........................... 114 6.4.2 Questionnaire .............................. 115 6.4.3 Participants ............................... 116 6.5 Results ...................................... 116 6.5.1 General Questions ........................... 116 6.5.2 Generic Software Engineering Questions ............... 118 6.5.3 User Filtering .............................. 119 6.5.4 Service Filtering ............................ 120 6.5.5 Version Filtering ............................ 120 6.5.6 Combined Filtering ........................... 121 6.6 Discussion .................................... 122 6.6.1 The Research Questions Revisited .................. 122 6.6.2 Lessons Learned ............................ 123 6.6.3 Threats to Validity ........................... 123 CONTENTS 1 6.7 Related Work .................................. 124 6.8 Conclusion .................................... 125 6.8.1 Future Work .............................. 125 7 Conclusion 127 7.1 Summary of Contributions ........................... 128 7.2 The Research Questions Revisited ....................... 129 7.2.1 RQ1 — How do web service APIs evolve and what are the conse- quences for clients of web APIs? .................... 129 7.2.2 RQ2 — How well-prepared are Android mobile applications with regard to changes in response messages from the web API? ..... 131 7.2.3 RQ3 — How can the topology of a running SOA-based system help in its maintenance? ........................... 132 7.2.4 RQ4 — Does the combination of user, service-version and timing information projected on a runtime topology help in the under- standing of SOA-based multi-tenant software systems? ....... 133 7.3 Recommendations For Future Work ...................... 133 7.3.1 Automated Web API Evolution .................... 133 7.3.2 Versioning Data versus Versioning Interfaces ............. 134 7.3.3 Runtime Topology ........................... 134 7.3.4 Dead Code Warnings .......................... 136 7.3.5 Web API Documentation Mining ................... 136 7.3.6 Metrics for Web API Frequency of Change .............. 137 7.3.7 Coupling Metrics for Organizational Co-evolution .......... 137 7.3.8 Per-user, At-will Web API Version Migration ............ 137 7.3.9 Closed versus Open-source ....................... 138 Acknowledgement 139 Summary 141 Samenvatting 145 2 CONTENTS CHAPTER 1 Introduction 1.1 From the Internet to Web Services The creation of the Internet in the 1980s paved the way for the connected world as we know it today. The Internet, which as of December 2013 was connecting in excess of 2.8 billion people1, opened the door not only for the relatively fast sharing