Annotation practices in Android apps

Ajay Kumar Jha, Sarah Nadi

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

Abstract

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.

Original languageEnglish (US)
Title of host publicationProceedings - 20th IEEE International Working Conference on Source Code Analysis and Manipulation, SCAM 2020
PublisherInstitute of Electrical and Electronics Engineers Inc.
Pages132-142
Number of pages11
ISBN (Electronic)9781728192482
DOIs
StatePublished - Sep 2020
Event20th IEEE International Working Conference on Source Code Analysis and Manipulation, SCAM 2020 - Virtual, Adelaide, Australia
Duration: Sep 27 2020Sep 28 2020

Publication series

NameProceedings - 20th IEEE International Working Conference on Source Code Analysis and Manipulation, SCAM 2020

Conference

Conference20th IEEE International Working Conference on Source Code Analysis and Manipulation, SCAM 2020
Country/TerritoryAustralia
CityVirtual, Adelaide
Period9/27/209/28/20

Keywords

  • Android annotations
  • Android apps
  • annotations
  • custom annotations
  • Java annotations

ASJC Scopus subject areas

  • Software
  • Safety, Risk, Reliability and Quality

Fingerprint

Dive into the research topics of 'Annotation practices in Android apps'. Together they form a unique fingerprint.

Cite this