Portfolio: Finding Relevant Functions and Their Usages

Collin McMillan, Mark Grechanik, Denys Poshyvanyk, Qing Xie, and Chen Fu
College of William and Mary, USA; Accenture Technology Lab, USA

Different studies show that programmers are more interested in finding definitions of functions and their uses than variables, statements, or arbitrary code fragments. Therefore, programmers require support in finding relevant functions and determining how those functions are used. Unfortunately, existing code search engines do not provide enough of this support to developers, thus reducing the effectiveness of code reuse.

We provide this support to programmers in a code search system called Portfolio that retrieves and visualizes relevant functions and their usages. We have built Portfolio using a combination of models that address surfing behavior of programmer and sharing related concepts among functions. We conducted an experiment with 49 professional programmers to compare Portfolio to Google Code Search and Koders using a standard methodology. The results show with strong statistical significance that users find more relevant functions with higher precision with Portfolio than with Google Code Search and Koders.