Software documentation is a very crucial resource for developers in understanding various aspects of software development process. A unique nature of such documentation is the presence of code elements embedded in natural-language texts that explain their purposes, usages and mutual relations with others. Some recent work has explored that nature for different purposes such as discovering code elements in documents and generating summaries for classes and methods with context. However, none of the existing approaches is capable of further capturing semantic relations of code elements with related words and with other relevant APIs at the same time. In this paper, by considering an embedded API element as a word, we characterize this API via a low-dimensional continuous vector that encodes information on many contexts in which that API appears as possible. Our empirical study shows that the vector representation learned from a large corpus of documentation is capable of capturing semantic relations between API elements and words. That is, APIs with similar functionalities have similar embeddings; and APIs and related words are close to each other in the vector space without explicit textual matching. Our experiment also suggests that the proposed representation for embedded API elements has a promising application in API code search.
['Thanh Van Nguyen', 'Anh Tuan Nguyen', 'Tien N. Nguyen']
Characterizing API elements in software documentation with vector representation