Abstract
To improve software productivity, software reuse with API (Application Programming Interface) such as library is common. However, APIs are not always easy to use because some of them are too large or complicated. Code example search is a common approach against it. In this paper, we propose a novel code example search method to help developers to understand how APIs should be used. Our approach has three features. (1) Variable data-flow can be specified with our original query to show helpful code examples. (2) Searching for various APIs is realized by downloading search targets on demand from the existing code search engine. (3) It is implemented as a web application with a low-cost algorithm using finite automaton. A result of an experiment shows that the proposal method helps API comprehension effectively in some cases, our original query is relatively easy to write, and the search time is practical.