Mining Annotation Usage Rules: A Case Study with MicroProfile

Batyr Nuryyev, Ajay Kumar Jha, Sarah Nadi, Yee Kang Chang, Emily Jiang, Vijay Sundaresan

Research output: Chapter in Book/Report/Conference proceedingConference contribution

Abstract

While Application Programming Interfaces (APIs) allow easier reuse of existing functionality, developers might make mistakes in using these APIs (a.k.a. API misuses). If an API usage specification exists, then automatically detecting such misuses becomes feasible. Since manually encoding specifications is a tedious process, there has been a lot of research regarding pattern-based specification mining. However, while annotations are widely used in Java enterprise microservices frameworks, most of these pattern-based rule discovery techniques have not considered annotation-based API usage rules. In this industrial case study of MicroProfile, an open-source Java microservices framework developed by IBM and others, we investigate whether the idea of pattern-based discovery of rules can be applied to annotation-based API usages. We find that our pattern-based approach mines 23 candidate rules, among which 4 are fully valid specifications and 8 are partially valid specifications. Overall, our technique mines 12 valid rules, 10 of which are not even documented in the official MicroProfile documentation. To evaluate the usefulness of the mined rules, we scan MicroProfile client projects for violations. We find 100 violations of 5 rules in 16 projects. Our results suggest that the mined rules can be useful in detecting and preventing annotation-based API misuses.

Original languageEnglish (US)
Title of host publicationProceedings - 2022 IEEE International Conference on Software Maintenance and Evolution, ICSME 2022
PublisherInstitute of Electrical and Electronics Engineers Inc.
Pages553-562
Number of pages10
ISBN (Electronic)9781665479561
DOIs
StatePublished - 2022
Event39th IEEE International Conference on Software Maintenance and Evolution, ICSME 2022 - Limassol, Cyprus
Duration: Oct 2 2022Oct 7 2022

Publication series

NameProceedings - 2022 IEEE International Conference on Software Maintenance and Evolution, ICSME 2022

Conference

Conference39th IEEE International Conference on Software Maintenance and Evolution, ICSME 2022
Country/TerritoryCyprus
CityLimassol
Period10/2/2210/7/22

Keywords

  • annotation
  • API usages
  • pattern mining

ASJC Scopus subject areas

  • Software
  • Safety, Risk, Reliability and Quality

Fingerprint

Dive into the research topics of 'Mining Annotation Usage Rules: A Case Study with MicroProfile'. Together they form a unique fingerprint.

Cite this