Understanding the Impact of Support for Iteration on Code Search
- Author(s): Martie, Lee Thomas
- Advisor(s): van der Hoek, André
- et al.
Sometimes, when programmers use a search engine, they know more or less what they need. Other times, programmers use the search engine to look around and generate possible ideas for the programming problem on which they are working. The key insight we explore in this dissertation is that, in the latter case, the results found tend to serve as inspiration or triggers for the next queries issued.
We introduce two search engines, CodeExchange and CodeLikeThis, both of which are specifically designed to enable the user to directly leverage results from a previous query in formulating a next query. CodeExchange does this with a set of four features that enable the programmer to use characteristics of the results to find other code with or without those characteristics. For instance, by selecting characteristics of the results the programmer likes (e.g., libraries used or method calls) or dislikes (e.g., code complexity or size), the programmer can refine their query for results with or without those characteristics. CodeLikeThis explores a different mechanism of supporting iteration by letting developers simply select an entire result to find code that is analogous, to some degree, to that result. For instance, the developer can select an algorithm implementation (e.g., quick sort) with a directive to find more similar implementations, less similar implementations (e.g., heap sort), or somewhat similar implementations.
We evaluated the impact of CodeExchange and CodeLikeThis on the experience, time, and success of the code search process. We compared our iterative approaches with two approaches not explicitly supporting iteration, a baseline and Google, in a laboratory experiment among 24 developers. We found that search engines that support using results to form the next query can improve the programmers' search experience and different approaches to iteration can provide better experiences depending on the kind of task.
The main contributions of this dissertation are six-fold. First, it contributes a new approach to code search, implemented in CodeExchange, that supports the programmer in iteratively searching by bringing characteristics of the results into their query. Second, it contributes, a new approach to code search, implemented in CodeLikeThis, that supports the programmer in iteratively searching by simply selecting a result to issue a query for other similar code. Third, it contributes an extensive laboratory experiment evaluating the impact of iterative approaches on the experience, time, and success of the code search process. Fourth, it contributes new findings about how developers search for code . Fifth, it contributes the implementation of CodeExchange and CodeLikeThis as fully functioning search engines over 10 million Java classes mined off the Internet. Sixth, it contributes an Index of 10 million Java classes indexed by different technical and social properties.