Characterizing the Usage, Evolution and Impact of Java Annotations in Practice

Annotations have been formally introduced into Java since Java 5. Since then, annotations have been widely used by the Java community for different purposes, such as compiler guidance and runtime processing. Despite the ever-growing use, there is still limited empirical knowledge about the actual usage of annotations in practice, the changes made to annotations during software evolution, and the potential impact of annotations on code quality. To fill this gap, we perform the first large-scale empirical study about Java annotations on 1,094 notable open-source projects hosted on GitHub. Our study systematically investigates annotation usage, annotation evolution, and annotation impact, and generates 10 novel and important findings. We also present the implications of our findings, which shed light for developers, researchers, tool builders, and language or library designers in order to improve all facets of Java annotation engineering.

[1]  ANAESTHESIA MB3Rxm,et al.  Annotations , 1910, The Hospital.

[2]  Miss A.O. Penney (b) , 1974, The New Yale Book of Quotations.

[3]  Jacob Cohen,et al.  Applied multiple regression/correlation analysis for the behavioral sciences , 1979 .

[4]  David C. Luckham,et al.  An Overview of Anna, a Specification Language for Ada , 1985, IEEE Software.

[5]  David E. Evans,et al.  Static detection of dynamic memory errors , 1996, PLDI '96.

[6]  Guy L. Steele,et al.  The Java Language Specification , 1996 .

[7]  Guy L. Steele,et al.  Java Language Specification, Second Edition: The Java Series , 2000 .

[8]  Audris Mockus,et al.  Identifying reasons for software changes using historic databases , 2000, Proceedings 2000 International Conference on Software Maintenance.

[9]  Khaled El Emam,et al.  The Confounding Effect of Class Size on the Validity of Object-Oriented Metrics , 2001, IEEE Trans. Software Eng..

[10]  Greg Nelson,et al.  Extended static checking for Java , 2002, PLDI '02.

[11]  Sarfraz Khurshid,et al.  An analyzable annotation language , 2002, OOPSLA '02.

[12]  Guy L. Steele,et al.  Java(TM) Language Specification , 2005 .

[13]  Guy L. Steele,et al.  Java(TM) Language Specification, The (3rd Edition) (Java (Addison-Wesley)) , 2005 .

[14]  Stan Jarzabek,et al.  An Empirical Study on Limits of Clone Unification Using Generics , 2005, SEKE.

[15]  N. Nagappan,et al.  Use of relative code churn measures to predict system defect density , 2005, Proceedings. 27th International Conference on Software Engineering, 2005. ICSE 2005..

[16]  Michael D. Ernst,et al.  Practical pluggable types for java , 2008, ISSTA '08.

[17]  Ewan D. Tempero,et al.  How Do Java Programs Use Inheritance? An Empirical Study of Inheritance in Java Software , 2008, ECOOP.

[18]  Ewan D. Tempero How Fields are Used in Java: An Empirical Study , 2009, 2009 Australian Software Engineering Conference.

[19]  Carlo Ghezzi,et al.  An empirical investigation into a large-scale Java open source code repository , 2010, ESEM '10.

[20]  Michael D. Ernst,et al.  Building and using pluggable type-checkers , 2011, 2011 33rd International Conference on Software Engineering (ICSE).

[21]  Harald C. Gall,et al.  Don't touch my code!: examining the effects of ownership on software quality , 2011, ESEC/FSE '11.

[22]  Marco Tulio Valente,et al.  How Annotations are Used in Java: An Empirical Study , 2011, SEKE.

[23]  Yuanyuan Zhou,et al.  aComment: mining annotations from comments and code to detect interrupt related concurrency bugs , 2011, 2011 33rd International Conference on Software Engineering (ICSE).

[24]  Mei-Chen Hu,et al.  Zero-Inflated and Hurdle Models of Count Data with Extra Zeros: Examples from an HIV-Risk Reduction Intervention Trial , 2011, The American journal of drug and alcohol abuse.

[25]  Premkumar T. Devanbu,et al.  Ownership, experience and defects: a fine-grained study of authorship , 2011, 2011 33rd International Conference on Software Engineering (ICSE).

[26]  Emerson R. Murphy-Hill,et al.  Adoption and use of Java generics , 2012, Empirical Software Engineering.

[27]  Michael D. Ernst,et al.  Reim & ReImInfer: checking and inference of reference immutability and method purity , 2012, OOPSLA '12.

[28]  Michael Hoppe,et al.  Do developers benefit from generic types?: an empirical comparison of generic and raw types in java , 2013, OOPSLA.

[29]  Guy L. Steele,et al.  The Java Language Specification, Java SE 8 Edition , 2013 .

[30]  Matias Martinez,et al.  Fine-grained and accurate source code differencing , 2014, ASE.

[31]  Mihai Surdeanu,et al.  The Stanford CoreNLP Natural Language Processing Toolkit , 2014, ACL.

[32]  Premkumar T. Devanbu,et al.  A large scale study of programming languages and code quality in github , 2014, SIGSOFT FSE.

[33]  Hridesh Rajan,et al.  Mining billions of AST nodes to study actual and potential usage of Java language features , 2014, ICSE.

[34]  Bruno C. d. S. Oliveira,et al.  Scrap your boilerplate with object algebras , 2015, OOPSLA.

[35]  Premkumar T. Devanbu,et al.  Assert Use in GitHub Projects , 2015, 2015 IEEE/ACM 37th IEEE International Conference on Software Engineering.

[36]  Marcelo d'Amorim,et al.  Static Analysis of Implicit Control Flow: Resolving Java Reflection and Android Intents (T) , 2015, 2015 30th IEEE/ACM International Conference on Automated Software Engineering (ASE).

[37]  Eirini Kalliamvakou,et al.  An in-depth study of the promises and perils of mining GitHub , 2016, Empirical Software Engineering.

[38]  Premkumar T. Devanbu,et al.  On the "naturalness" of buggy code , 2015, ICSE.

[39]  Renaud Pawlak,et al.  SPOON: A library for implementing analyses and transformations of Java source code , 2016, Softw. Pract. Exp..

[40]  Abram Hindle,et al.  Energy Profiles of Java Collections Classes , 2016, 2016 IEEE/ACM 38th International Conference on Software Engineering (ICSE).

[41]  Michael D. Ernst,et al.  Locking Discipline Inference and Checking , 2016, 2016 IEEE/ACM 38th International Conference on Software Engineering (ICSE).

[42]  E. Guerra Design Patterns for Annotation-based APIs , 2016 .

[43]  Premkumar T. Devanbu,et al.  Belief & Evidence in Empirical Software Engineering , 2016, 2016 IEEE/ACM 38th International Conference on Software Engineering (ICSE).

[44]  Jens Dietrich,et al.  Contracts in the Wild: A Study of Java Programs (Artifact) , 2017, Dagstuhl Artifacts Ser..

[45]  James Cheney,et al.  µPuppet: A Declarative Subset of the Puppet Configuration Language , 2017, ECOOP 2017.

[46]  Alexander Serebrenik,et al.  Challenges for Static Analysis of Java Reflection - Literature Review and Empirical Study , 2017, 2017 IEEE/ACM 39th International Conference on Software Engineering (ICSE).

[47]  Brad A. Myers,et al.  Glacier: Transitive Class Immutability for Java , 2017, 2017 IEEE/ACM 39th International Conference on Software Engineering (ICSE).

[48]  Danny Dig,et al.  Understanding the use of lambda expressions in Java , 2017, Proc. ACM Program. Lang..

[49]  David Lo,et al.  Revisiting Assert Use in GitHub Projects , 2017, EASE.

[50]  Daniel E. Geer,et al.  Ownership , 2019, IEEE Secur. Priv..

[51]  Tsuyoshi Murata,et al.  {m , 1934, ACML.

[52]  P. Alam ‘T’ , 2021, Composites Engineering: An A–Z Guide.