Reusing existing functionality from legacy code and third party programming libraries is often hard, because the vast number of definitions and the complexity of the APIs require a detailed knowledge of the programming environment. To help developers discovering such functionality when working with a statically typed, object-oriented programming language, we designed an API retrieval system that supports querying indexed APIs with textual keywords and type signatures. The feature of the search engine is inspired by a similar tool for the Haskell programming language called Hoogle. Though, we decided to develop another approach to address the API search problem based on traditional information retrieval techniques which, we argue, is better suited for object-oriented languages.As a proof of concept, we implemented the API retrieval system for the Scala programming language and provided a web-based user interface. Furthermore, we demonstrate how Scala-specific language features like user-defined implicit conversions and implicit parameters can be included into our basic approach. A comparison to a system using only exact matches of partial types of the query shows that the effectiveness of API retrieval can be substantially improved with our approach.
Management SummaryThis thesis describes the design of a type directed search engine for statically-typed, object-oriented programming languages. Furthermore, we provide an implementation for the Scala programming language that incorporates Scala specific language constructs.
Status QuoA crucial part of creating high quality software projects is the reuse of existing functionality provided by in-house or third party programming libraries. This ensures that functionality is not unnecessarily reimplemented and lowers the risk of introducing erroneous behavior. Code reused over various projects tends to be well-tested and battle-proofed.Discovering existing functionality is a task that requires either a deep knowledge of the according libraries or appropriate tools that provide access convenient to the definitions in a library. Some examples of such tools are code completion assistants that list the accessible members of an object in question and automatically generated documentation pages for the available classes. Though, these tools tend to give an incomplete picture of the available operations, because functionality provided through utility classes or by additional libraries are usually not listed.In this case, developers often resort to universal search engines like Google to find a specific implementation. While these search engines often provide suitable results, users have to manually mine the result pages for suitable content. Additionally, the result pages may refer to outdated revisions of a library.In the functional programming community, a popular tools to overcome these issues are search engines, like Hoogle for Haskell, that accept type signatures as search queries and retrieve definitions of a similar type. In combination with a powerful type syst...