UNIVERSITY of CALIFORNIA, IRVINE Understanding the Impact of Support for Iteration on Code Search DISSERTATION Submitted In
Total Page:16
File Type:pdf, Size:1020Kb
UNIVERSITY OF CALIFORNIA, IRVINE Understanding the Impact of Support for Iteration on Code Search DISSERTATION submitted in partial satisfaction of the requirements for the degree of DOCTOR OF PHILOSOPHY in Software Engineering by Lee Thomas Martie Dissertation Committee: Professor André van der Hoek, Chair Professor Cristina V. Lopes Associate Professor James A. Jones 2017 © 2017 Lee Thomas Martie DEDICATION To my wife, Hsiao-Hsuan Yu, who supported me more than I imagined anyone could and anyone deserved. To my cats, Fred and Maymay, who added just the right amount of chaos and companionship to my life at home. To my parents, Richard and Lisa Martie, who let me play and have fun with BASIC when I was a kid and supported my education in programming. To my brothers, Phil and Ben Martie, who laughed at the absurdity of life with me. To my sister-in-laws, Jude and Meghan Martie, for being the sisters I did not have growing up. To Edward Shafranske, who taught me courage and helped me grow into a more capable person. “The art is to always be willing to make the guess, be willing to be completely wrong, be humble to the fact, and be completely haughty to man… Otherwise, you get laughed out of a right idea.” — Warren McCulloch “Always look on the bright side of life.” — Monty Python “Never give up.” — Grandma Martie ii TABLE OF CONTENTS LIST OF FIGURES ................................................................................................................... v LIST OF TABLES ................................................................................................................. viii LIST OF EQUATIONS ............................................................................................................. x ACKNOWLEDGMENTS ......................................................................................................... xi CURRICULUM VITAE ........................................................................................................... xii ABSTRACT OF THE DISSERTATION ................................................................................. xiv Introduction ......................................................................................................................... 1 1.1 Dissertation Structure ................................................................................................. 18 Background ......................................................................................................................... 20 2.1 Empirical Studies on Code Search ....................................................................................... 20 2.1.1 Surveys ................................................................................................................................ 21 2.1.2 User Studies ........................................................................................................................ 23 2.1.4 Empirical Study Discussion ............................................................................................... 29 2.2 Tool Support for Code Search .............................................................................................. 32 2.2.1 More Expressive Queries .................................................................................................. 32 2.2.5.3 Improving Ranking with Weighted Matching .............................................................. 40 2.2.14 Tool Support Discussion ................................................................................................. 54 2.3 Iterative Search in Information Retrieval .......................................................................... 58 Research Question ............................................................................................................. 61 CodeExchange ..................................................................................................................... 66 4.2 CodeExchange Interface ....................................................................................................... 78 4.3 Query Refinement Recommendations ................................................................................ 81 4.4 Critiques ................................................................................................................................. 82 4.5 Language Constructs ............................................................................................................. 84 4.6 Query Parts ............................................................................................................................ 85 CodeLikeThis .................................................................................................................... 118 5.1 Architecture ......................................................................................................................... 127 5.2 Interface ............................................................................................................................... 131 5.3 The Ranking Algorithms of CodeLikeThis ........................................................................ 132 5.3.1 Similarity Function .......................................................................................................... 133 5.3.2.1 Size of R .......................................................................................................................... 140 5.3.2.2 Size of S .......................................................................................................................... 146 5.3.2.3 ST Design ....................................................................................................................... 147 5.3.2.4 MWL-ST Hybrid Design ................................................................................................ 147 5.3.2.4.1 ComplexityMC Density ................................................................................................ 150 .................................................................................................................................................... 153 5.2.2.4.2 Using ComplexityMC Density in MWL-ST Hybrid ..................................................... 154 iii Evaluation ......................................................................................................................... 184 6.1 Experiment Design .............................................................................................................. 185 6.1.1 Non-Iterative Approaches ............................................................................................... 185 6.1.2 Participants ...................................................................................................................... 187 .................................................................................................................................................... 188 6.1.3 Assignments ..................................................................................................................... 188 6.1.4 Search Tasks ..................................................................................................................... 191 6.1.5 Survey System .................................................................................................................. 193 6.2 Results .................................................................................................................................. 195 6.2.1 Experience Scores ............................................................................................................ 196 6.2.2 Task Times ....................................................................................................................... 206 6.2.2.1 Experience and Task Times ......................................................................................... 212 .................................................................................................................................................... 223 .................................................................................................................................................... 224 6.2.2.2 Number of Queries and Task Times CE versus BL ..................................................... 225 6.2.3 Task Completion as a Success Measure ......................................................................... 229 Discussion ......................................................................................................................... 267 Conclusion ......................................................................................................................... 281 iv LIST OF FIGURES Figure 1 Grep in use to find ‘x’ in C code. ..................................................................................... 4 Figure 2 Creative Computing Deep Space Game. .......................................................................... 5 ...................................................................................... 6 ........................................................................................ 7 FigureFigure 3 Creative Computing Heapsort. 5 Game Code Example for BBS. ......................................................................................... 7 FigureFigure 64 AlienBulletin Board System Menu. Stacking Game Example. ..................................................................................... 14 Figure 7 AGORA screenshot. ......................................................................................................