TY - GEN
T1 - Mining Annotation Usage Rules
T2 - 39th IEEE International Conference on Software Maintenance and Evolution, ICSME 2022
AU - Nuryyev, Batyr
AU - Kumar Jha, Ajay
AU - Nadi, Sarah
AU - Chang, Yee Kang
AU - Jiang, Emily
AU - Sundaresan, Vijay
N1 - Publisher Copyright:
© 2022 IEEE.
PY - 2022
Y1 - 2022
N2 - 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.
AB - 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.
KW - annotation
KW - API usages
KW - pattern mining
UR - http://www.scopus.com/inward/record.url?scp=85146234524&partnerID=8YFLogxK
UR - http://www.scopus.com/inward/citedby.url?scp=85146234524&partnerID=8YFLogxK
U2 - 10.1109/ICSME55016.2022.00075
DO - 10.1109/ICSME55016.2022.00075
M3 - Conference contribution
AN - SCOPUS:85146234524
T3 - Proceedings - 2022 IEEE International Conference on Software Maintenance and Evolution, ICSME 2022
SP - 553
EP - 562
BT - Proceedings - 2022 IEEE International Conference on Software Maintenance and Evolution, ICSME 2022
PB - Institute of Electrical and Electronics Engineers Inc.
Y2 - 2 October 2022 through 7 October 2022
ER -