Back to search

University of Alberta

Improving API Documentation Quality Through Identifying Missing Code Examples

Abstract

dc:description.abstract

Software libraries often provide documentation to describe the Application Programming Interfaces (APIs) they offer. Such API documentation helps potential users understand how to use the library. Studies have shown that having code examples is one of the key criteria of good software documentation quality and that lack of examples is one of the reasons why API documentation becomes difficult to understand for library users. Thus, in this thesis, our goal is to improve API documentation quality by identifying missed opportunities for code examples. Specifically, we propose a methodology to identify APIs from library API documentation websites that require code examples for improving documentation quality. We use web scraping and heuristics to identify APIs with missing code examples (APIsnoeg) from a library’s documentation website. We then look for Stack Overflow questions about the APIsnoeg. Next, we use a large language model (LLM) to determine if the post discusses the author’s struggle with using those APIsnoeg. If it does, then we mark that apinoeg as a potential API that may need a code example. Finally, we identify a list of APIs, for which, adding code examples can improve the documentation quality. We can then encourage library authors to add code examples for the APIs in this list. Based on our methodology, we create a prototype tool. We evaluate the intermediate steps of our tool for the API documentation of 3 libraries and then analyze the API documentation of 12 libraries using the tool. We find that although there are Stack Overflow posts where authors discuss an apinoeg, it is not always an indicator that having code examples would resolve the authors’ issues.

Degree

thesis:*
Name thesis:degree_name
Master of Science
Level thesis:degree_level
Master's
Grantor
University of Alberta
Year dc:date.issued
2024

Author and committee

dc:creator, dc:contributor.*
Author dc:creator
  • Sarah, Afiya Fahmida
Advisor dc:contributor.advisor
  • Nadi, Sarah (Computing Science)

Subjects

dc:subject × 2

Rights

dc:rights
Statement dc:rights
  • This thesis is made available by the University of Alberta Library with permission of the copyright owner solely for non-commercial purposes. This thesis, or any portion thereof, may not otherwise be copied or reproduced without the written consent of the copyright owner, except to the extent permitted by Canadian copyright law.
Language dc:language.iso
en

Identifiers

dc:identifier.*
DOI dc:identifier.doi
https://doi.org/10.7939/r3-xzc4-9b78

Chain of custody

source
Harvested from
University of Alberta
Base URL
era.library.ualberta.ca/oai
Last updated
2026-11-26
Source record
OAI-PMH GetRecord
citation

Sarah, Afiya Fahmida. Improving API Documentation Quality Through Identifying Missing Code Examples. Master's thesis, University of Alberta, 2024. https://doi.org/10.7939/r3-xzc4-9b78