TY - GEN
T1 - Annotation practices in Android apps
AU - Jha, Ajay Kumar
AU - Nadi, Sarah
N1 - Publisher Copyright:
© 2020 IEEE.
PY - 2020/9
Y1 - 2020/9
N2 - Understanding the adoption and usage of any programming language feature is crucial for improving it. Existing studies indicate that Java annotations are widely used by developers. However, there is currently no empirical data on annotation usage in Android apps. Android apps are often smaller than general Java applications and typically use Android APIs or specific libraries catered to the mobile environment. Therefore, it is not clear if the results of existing Java studies hold for Android apps. In this paper, we investigate annotation practices in Android apps through an empirical study of 1, 141 open-source apps. Using previously studied metrics, we first compare annotation usage in Android apps to existing results from general Java applications. Then, for the first time, we study why developers declare custom annotations. Our results show that the density of annotations and the values of various other annotation metrics are notably less in Android apps than in Java projects. Additionally, the types of annotations used in Android apps are different than those in Java, with many Android-specific annotations. These results imply that researchers may need to distinguish mobile apps while performing studies on programming language features. However, we also found examples of extreme usage of annotations with, for example, a large number of attributes, as well as a low adoption rate for most annotations. By looking at such results, annotation designers can assess adoption patterns and take various improvement measures, such as modularizing their offered annotations or cleaning up unused ones. Finally, we find that developers declare custom annotations in different apps but with the same purpose, which presents an opportunity for annotation designers to create new annotations.
AB - Understanding the adoption and usage of any programming language feature is crucial for improving it. Existing studies indicate that Java annotations are widely used by developers. However, there is currently no empirical data on annotation usage in Android apps. Android apps are often smaller than general Java applications and typically use Android APIs or specific libraries catered to the mobile environment. Therefore, it is not clear if the results of existing Java studies hold for Android apps. In this paper, we investigate annotation practices in Android apps through an empirical study of 1, 141 open-source apps. Using previously studied metrics, we first compare annotation usage in Android apps to existing results from general Java applications. Then, for the first time, we study why developers declare custom annotations. Our results show that the density of annotations and the values of various other annotation metrics are notably less in Android apps than in Java projects. Additionally, the types of annotations used in Android apps are different than those in Java, with many Android-specific annotations. These results imply that researchers may need to distinguish mobile apps while performing studies on programming language features. However, we also found examples of extreme usage of annotations with, for example, a large number of attributes, as well as a low adoption rate for most annotations. By looking at such results, annotation designers can assess adoption patterns and take various improvement measures, such as modularizing their offered annotations or cleaning up unused ones. Finally, we find that developers declare custom annotations in different apps but with the same purpose, which presents an opportunity for annotation designers to create new annotations.
KW - Android annotations
KW - Android apps
KW - annotations
KW - custom annotations
KW - Java annotations
UR - http://www.scopus.com/inward/record.url?scp=85097644581&partnerID=8YFLogxK
UR - http://www.scopus.com/inward/citedby.url?scp=85097644581&partnerID=8YFLogxK
U2 - 10.1109/SCAM51674.2020.00020
DO - 10.1109/SCAM51674.2020.00020
M3 - Conference contribution
AN - SCOPUS:85097644581
T3 - Proceedings - 20th IEEE International Working Conference on Source Code Analysis and Manipulation, SCAM 2020
SP - 132
EP - 142
BT - Proceedings - 20th IEEE International Working Conference on Source Code Analysis and Manipulation, SCAM 2020
PB - Institute of Electrical and Electronics Engineers Inc.
T2 - 20th IEEE International Working Conference on Source Code Analysis and Manipulation, SCAM 2020
Y2 - 27 September 2020 through 28 September 2020
ER -