|Thesis abstract: |
Code examples play a crucial role in modern software development complementing the existing documentation and facilitating the learning curve of developers. However, generating meaningful code examples for a given API and finding the relevant ones is a difficult and time-consuming activity. In practice, insufficient or inadequate examples represent the greatest obstacle to effectively learn an API. This aspect becomes even more relevant during software maintenance where maintainers usually have to deal with multiple and different APIs that they may have not exercised neither recently nor frequently.
In response to the increasing need of meaningful code examples, research has been focusing on techniques to automatically extract or generate them. Approaches that propose relevant examples to support developers while they code are commonly referred to as code recommendation systems and represent the focus of my research. To find or generate the examples to recommend, existing approaches typically rely on external sources such as the source code of existing projects, and code fragments available online. Although they assume availability of such sources of information, in reality, these sources may be inaccessible or limited (e.g., let us consider the case of newly released APIs that are not publicly released). In addition, even if available, these sources of information may be untrustworthy or may contain outdated and low quality content. These issues hamper the applicability of existing code recommendation solutions in many practical scenarios.
My research addresses these issues and proposes a novel and general approach for code recommendation based on unit tests. The proposed solution mines the unit tests of a given API and synthesizes appropriate and relevant examples from them. The rationale behind this idea is that we believe unit tests may represent an ideally self-contained, consistent, and trusted source of information from which it is possible to synthesize meaningful and useful code examples to be shown as relevant recommendations to developers.
Please visit my homepage for more information.