AN ANALYSIS OF USER CREATED SOURCE CODE SAMPLE USAGE MASTER OF BUSINESS ADMINISTRATION IN INFORMATION TECHNOLOGY Himidumage C.N.T Department of Computer Science & Engineering University of Moratuwa Sri Lanka December 2008 ii AN ANALYSIS OF USER CREATED SOURCE CODE SAMPLE USAGE By Himidumage C.N.T The Dissertation was submitted to the Department of Computer Science & Engineering of the University of Moratuwa in partial fulfillment of the requirement for the Degree of Master of Business Administration. Department of Computer Science & Engineering University of Moratuwa Sri Lanka December 2008 iii Declaration I hereby recommend that the dissertation prepared under my supervision by Mr. C.N.T Himidumage titled “An Analysis of User Created Source Code Sample Usage” be accepted in partial fulfillment of the requirement for the Degree of Master of Business Administration in Information Technology. Approved by, ----------------------------------------- ------------------ Dr. Buddinath Jayathileke Date Director – Software Engineering Creative Solutions Pvt. Ltd Prepared by, ----------------------------------------- ------------------ Mr. C.N.T Himidumage Date Student - MBA in IT 2007/2009 iv Abstract Software development is a challenging task. Technologies change rapidly and engineers get new problems to solve often. Software engineering is a discipline where reusability can be used to simplify complexities and speedup development. Among the many different approaches of code reuse, sample source code plays a major role in speeding up the development process. With the growth of the internet, it became easier to publish and consume content via the World Wide Web including source code samples. This research statistically verifies using a hypothesis test the User Created Source Code Sample (UCSCS) usage level among Sri Lankan Software Engineers. Additionally, qualitative analysis of how UCSCS are used by engineers with different levels of experience and different stages of a project delivery are also performed. The study showed that the usage level of UCSCS is generally high among engineers but varied significantly with the experience level and purpose of use. v Acknowledgement This dissertation is an outcome of effort to complete a successful research during last ten months duration. Many people helped me in various ways to make this venture a success during this time period. First of all, my gratitude should go to my external supervisor Dr. Buddinath Jayathileke who guided me through this research with a great interest. His guidance and directions added extra value to the analysis and finding of this dissertation. Then my gratitude goes to Dr. Sanath Jayasena who acted as the internal supervisor for the research who helped me throughout the last year for sharing his expertise with me to make this research a success. I take this opportunity to thank each and every individual professional, who participated and contributed their views and responses by spending time for interviews, which lead to comprehend my research results. If not for there valuable contributions, this research would not have been a success. Special thanks to Mrs. Vishaka Nanayakkara and her staff in the CSE Department of University of Moratuwa for their devotion and commitment towards the MBA program. I also wish to convey my heartfelt thanks to all lecturers who guided me during the entire course for nearly two years. Last, but definitely not the least, my heartfelt thanks go to my wife who always encouraged and helped me to complete the research on time. Many thanks also extend to my parents and all family members for their help, support and encouragement that have given to me over the years for the completion of the MBA. Chinthaka Himidumage vi Table of Content 1. INTRODUCTION ..............................................................................................................1 1.1 Problem Statement ........................................................................................................3 1.2 Research Objectives ......................................................................................................4 1.3 Scope of the Study ........................................................................................................4 1.4 Importance of the Study ................................................................................................5 1.5 Structure of the Thesis ..................................................................................................6 2. LITERATURE REVIEW ..................................................................................................7 2.1 Software Development Challenges ................................................................................7 2.2 Methods of Code Reuse .............................................................................................. 10 2.3 User Created Content .................................................................................................. 13 3. RESEARCH METHODOLOGY AND DESIGN ........................................................... 21 3.1 Type and Nature of the Study ...................................................................................... 21 3.2 Unit of Analysis .......................................................................................................... 22 3.3 Sample Design ............................................................................................................ 23 3.4 Data Collection ........................................................................................................... 23 3.5 Definitions and Attributes ........................................................................................... 25 3.6 Hypothesis .................................................................................................................. 26 3.7 A Framework for Qualitative Analysis ........................................................................ 28 4. RESULTS AND DISCUSSION ....................................................................................... 29 4.1 Classifying code samples as User Created Content ...................................................... 29 vii 4.2 Preliminary Analysis ................................................................................................... 32 4.3 Hypothesis Testing ...................................................................................................... 34 4.4 Qualitative Analysis .................................................................................................... 35 4.4.1 Sample Usage Patterns Vs Years of Experience of Engineers ............................... 35 4.4.2 UCSCS Usage Vs Engineer‟s Experience ............................................................ 37 4.4.3 Variations of UCSCS usage Vs Project Life Cycle ............................................... 44 4.4.4 UCSCS usage Vs. Individual performance ........................................................... 47 4.4.5 Contribution Aspect ............................................................................................. 47 4.4.6 Special Findings................................................................................................... 48 5. CONCLUSION AND FUTURE WORK ......................................................................... 50 6. REFERENCES................................................................................................................. 52 7. APPENDIX A – QUESTIONNAIRE .............................................................................. 55 viii List of Figures Figure 3-1 : Research Design .................................................................................................... 22 Figure 3-2 : Conceptual Framework for Hypothesis Testing ...................................................... 27 Figure 4-1 : Frequency Distribution of Usage of UCSCS........................................................... 32 Figure 4-2 : Frequency Distribution of Year of Experience of Engineers ................................... 34 Figure 4-3 : Usage of UCSCS for „Syntax Related Problems‟ against Years of Experience ....... 37 Figure 4-4 : Usage of UCSCS for „Functionality and Behavior‟ against Years of Experience .... 38 Figure 4-5 : Usage of UCSCS for „Application Troubleshooting‟ against Years of Experience .. 40 Figure 4-6 : Variation of „Use as It Is‟ with Years of Experience ............................................... 42 Figure 4-7 : Variation of „Understand and Rewrite‟ with Years of Experience ........................... 43 Figure 4-8 : Variation of „Modify and Use‟ with Years of Experience ....................................... 43 Figure 4-9 : Usage of „Use as It Is‟ in Different Stages of a Project ........................................... 45 Figure 4-10 : Usage of „Modify as Required‟ in Different Stages of a Project ............................ 46 Figure 4-11 : Usage for „Troubleshooting‟ in Different Stages of a Project ................................ 47 ix List of Tables Table 1-1 : Different Job Categories in Sri Lankan ICT Sector ....................................................4 Table 2-1 : Identified Types of User Created Content ................................................................ 17 Table 2-2 : Possible Platforms for UCC Distribution ................................................................. 18 Table 3-1 : Definitions of Variables .......................................................................................... 27 Table 3-2 : Framework for UCSCS usage pattern analysis ......................................................... 28 Table 4-1 : Categorization of Freely Available Source Code Samples as UCC .......................... 32 Table 4-2 : How often an engineer uses UCSCS given a problem .............................................. 32 Table 4-3 : Years of experience in Development ....................................................................... 33 Table 4-4 : One-Sample Statistics for Frequency of UCSCS usage ............................................ 34 Table 4-5 : One Sample T-Test results of Frequency of Usage for Test Value 3 ........................ 35 Table 4-6 : Cumulative Contribution Frequency Distribution .................................................... 47 x Abbreviations AOP Aspect Oriented Programming CKO Chief Knowledge Officer ICTA Information and Communication Technology Agency KM Knowledge Management OOP Object Oriented Programming SOA Service Oriented Architecture UCC User Created Content UCSCS User Created Source Code Samples WWW World Wide Web