Mining Annotation Usage Rules: A Case Study with MicroProfile
2022 IEEE International Conference on Software Maintenance and …, 2022•ieeexplore.ieee.org
While Application Programming Interfaces (APIs) allow easier reuse of existing functionality,
developers might make mistakes in using these APIs (aka 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 …
developers might make mistakes in using these APIs (aka 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 …
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.
ieeexplore.ieee.org
Showing the best result for this search. See all results