Supporting Source Code Comprehension During Software Evolution and Maintenance
Total Page:16
File Type:pdf, Size:1020Kb
SUPPORTING SOURCE CODE COMPREHENSION DURING SOFTWARE EVOLUTION AND MAINTENANCE A dissertation submitted to Kent State University in partial fulfillment of the requirements for the degree of Doctor of Philosophy by Nouh Alhindawi August, 2013 Dissertation written by Nouh Alhindawi M.S., Al-Balqa’ Applied University, Jordan, 2006 B.S., Yarmouk University, Jordan, 2004 Approved by Dr. Jonathan I. Maletic , Chair, Doctoral Dissertation Committee Dr. Feodor F. Dragan , Members, Doctoral Dissertation Committee Dr. Rouming Jin Dr. Michael L. Collard Dr. Catherine L. Smith Accepted by Dr. Javed I. Khan , Chair, Department of Computer Science Dr. James L. Blank , Dean, College of Arts and Sciences ii TABLE OF CONTENTS LIST OF FIGURES .....................................................................................................VIII LIST OF TABLES ........................................................................................................ XII ACKNOWLEDGMENTS ...........................................................................................XVI CHAPTER 1 INTRODUCTION..................................................................................... 1 1.1 Goals of the Research................................................................................................ 3 1.2 Contributions............................................................................................................. 5 1.3 Publication Notes ...................................................................................................... 6 1.4 Organization .............................................................................................................. 7 CHAPTER 2 BACKGROUND AND RELATED WORK ........................................... 8 2.1 Software Maintenance Overview .............................................................................. 8 2.2 Historical Perspective for Program Comprehension............................................... 12 2.3 Information Retrieval in Software Engineering...................................................... 19 CHAPTER 3 IMPROVING FEATURE LOCATION BY ENHANCING SOURCE CODE WITH STEREOTYPES......................................................................... 23 3.1 Approach Hypothesis .............................................................................................. 26 3.2 Related Work........................................................................................................... 27 3.2.1 Previous Work on Feature Location.............................................................. 27 3.2.2 Previous Work on Feature Location Using IR.............................................. 28 3.3 Method Stereotypes................................................................................................. 31 3.3.1 Stereotypes Definition................................................................................... 31 3.3.2 Method Stereotypes Taxonomy .................................................................... 31 iii 3.4 Latent Semantic Indexing (LSI).............................................................................. 36 3.4.1 Why LSI? ...................................................................................................... 38 3.4.2 LSI Processing Steps..................................................................................... 39 3.5 LSI+Stereotypes for Feature Location .................................................................... 43 3.6 Experimental Study................................................................................................. 45 3.6.1 Design and Objective of the Experimental Study ......................................... 45 3.6.2 Evaluation Measures ..................................................................................... 47 3.6.3 Experiments Feature Selection and Determining Relevant Methods............ 49 3.6.4 Locating Features in HippoDraw System ..................................................... 50 3.6.5 Locating Features in Qt System .................................................................... 55 3.7 Discussion ............................................................................................................... 58 3.8 Threats to Validity................................................................................................... 66 3.9 Summary ................................................................................................................. 67 CHAPTER 4 SOURCE CODE INDEXING FOR FEATURE LOCATION............ 69 4.1 A Case Study of Feature Location with and without Comments............................ 70 4.1.1 Code Comments Overview ........................................................................... 71 4.1.2 Code Comments Categorizations.................................................................. 74 4.1.3 Case Study Comments Samples.................................................................... 77 4.1.4 Evaluation Strategy and Results Discussion................................................. 78 4.1.5 Study Recommendations............................................................................... 84 4.1.6 Summary ....................................................................................................... 85 4.2 A Case Study of Feature Location with and without Function Calls...................... 86 iv 4.2.1 Function Calls Overview............................................................................... 87 4.2.2 Function Calls in Code Comprehension ....................................................... 88 4.2.3 Evaluation Strategy and Discussion.............................................................. 91 4.2.4 Summary ....................................................................................................... 96 CHAPTER 5 LSI-BASED SOLUTION FOR CATEGORIZING SOFTWARE REPOSITORY COMMITS FOR MAINTENANCE...................................... 97 5.1 Repository Commits Overview............................................................................... 99 5.2 Version Control Systems....................................................................................... 101 5.3 Commits Identification.......................................................................................... 102 5.4 Related Works ....................................................................................................... 103 5.4.1 Previous Work on Software Repository Classification............................... 103 5.4.2 Previous Work on the use of IR in Software Repository............................ 104 5.5 Case Study: Adaptive Commits Identification...................................................... 107 5.5.1 Latent Semantic Indexing (LSI) for Adaptive Commits............................. 108 5.5.2 Case Study Evaluation ................................................................................ 113 5.5.3 Experiments Findings.................................................................................. 115 5.5.4 Discussion ................................................................................................... 122 5.5.5 Threats to Validity....................................................................................... 127 5.6 Summary ............................................................................................................... 127 CHAPTER 6 SOURCE CODE QUERY ASSISTANT BUILDER.......................... 129 6.1 Preprocessing Steps............................................................................................... 131 6.2 Algorithm Pseudo-Code........................................................................................ 133 v 6.3 Tool Program Setup .............................................................................................. 134 6.4 Tool Usage Instructions ........................................................................................ 134 6.5 Tool Interface Components Description ............................................................... 136 6.5.1 File Menu .................................................................................................... 136 6.5.2 User Word Entries....................................................................................... 136 6.5.3 User Selected Terms/Entries ....................................................................... 138 6.5.4 Synonyms List............................................................................................. 138 6.5.5 Matching Document Count ......................................................................... 138 6.5.6 Co-occurring Term Count ........................................................................... 139 6.5.7 Function Name Terms Info ......................................................................... 139 6.5.8 Co-occurring Terms .................................................................................... 139 6.5.9 Number of Co-occurrences and Total Occurrences .................................... 139 6.5.10 Percentage of Matching Functions Containing Term ................................. 140 6.5.11 Percentage of All Functions Containing Term............................................ 140 6.6 Related Work......................................................................................................... 140 6.7 Tool Evaluation..................................................................................................... 142 6.8 Summary