Abstract
Reusing large software systems, including libraries of reusable components, is often time consuming. While some core library features can be well-documented, most other features lack informative API documentation that can help developers locate needed components. Furthermore, even when needed components are found, such libraries provide little help in the form of code examples that show how to instantiate these components. This article proposes a system that provides two features to help combat these difficulties. Firstly, we provide a mechanism for retrieving reusable components. Secondly, we provide support for generating context-sensitive code snippets that demonstrate how the retrieved components can be instantiated and reused in the programmer's current project. This approach utilizes semantic modeling and ontology formalisms in order to conceptualize and reverse-engineer the hidden knowledge in library code. Empirical evaluation demonstrates that semantic techniques are efficient and can improve programmer's productivity when retrieving components and recommending code samples.