Back to search

University of Alberta

A Human-in-the-loop Approach to Generate Annotation Usage Rules

Abstract

dc:description.abstract

Frameworks and libraries provide functionality through Application Programming Interfaces (APIs). Developers might misuse these APIs because the library's usage rules are often implicit, undocumented, or not readily available in the form of checkable rules. At the same time, manually writing usage rules for each API is time-consuming. Therefore, researchers have proposed various techniques to automatically mine API usage rules. However, mined rules are not always accurate, resulting in false positives when used for misuse detection. To overcome these trade-offs, in this thesis, we combine rule mining and manual rule authoring approaches by creating a human-in-the-loop API usage rule generation pipeline. Based on our industrial collaborator's needs, our work focuses on generating annotation-based API usage rules for MicroProfile, a framework designed for building microservices using Enterprise Java. We use an existing frequent itemset-based pattern-mining technique to mine MicroProfile annotation usage rules. We contribute a GUI-based rule validation tool (RVT) that represents rules in an easy-to-read English-like syntax and allows experts to browse through the mined rules to validate (accept, edit, discard) them. Our pipeline then automatically generates checkable API usage rules from the confirmed rules, which can then be used to detect misuses or to enhance documentation. We verify the correctness of the automatically generated static analysis checks by evaluating our misuse detector against 517 projects. Our results show that our misuse detector can find misuses with 100% recall and 84% precision. To assess the usefulness of having mined rules as a starting point for rule authoring and to assess the usability of RVT in validating rules, we perform a user study with four MicroProfile API experts where they validate 18 mined rules. The results show that the API experts find having starting points useful when it comes to rule authoring. Additionally, the experts unanimously agree on the usefulness of having a dedicated tool for authoring rules.

Degree

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

Author and committee

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

Subjects

dc:subject × 3

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-jpjh-nz90

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

Gulami, Mansur. A Human-in-the-loop Approach to Generate Annotation Usage Rules. Master's thesis, University of Alberta, 2022. https://doi.org/10.7939/r3-jpjh-nz90