Contract Usage and Evolution in Android Mobile Applications
Contracts and assertions are effective methods to enhance software quality by enforcing preconditions, postconditions, and invariants. Previous research has demonstrated the value of contracts in traditional software development. However, the adoption and impact of contracts in the context of mobile app development, particularly of Android apps, remain unexplored.
To address this, we present the first large-scale empirical study on the use of contracts in Android apps, written in Java or Kotlin. We consider contract elements divided into five categories: conditional runtime exceptions, APIs, annotations, assertions, and other. We analyzed 2,390 Android apps from the F-Droid repository and processed more than 51,749 KLOC to determine 1) how and to what extent contracts are used, 2) which language features are used to denote contracts, 3) how contract usage evolves from the first to the last version, and 4) whether contracts are used safely in the context of program evolution and inheritance. Our findings include: 1) although most apps do not specify contracts, annotation-based approaches are the most popular; 2) apps that use contracts continue to use them in later versions, but the number of methods increases at a higher rate than the number of contracts; and 3) there are many potentially unsafe specification changes when apps evolve and in subtyping relationships, which indicates a lack of specification stability. Finally, we present a qualitative study that gathers challenges faced by practitioners when using contracts and that validates our recommendations.
Wed 2 JulDisplayed time zone: Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna change
16:15 - 17:39 | |||
16:15 21mTalk | Automatic Goal Clone Detection in Rocq Technical Papers Ali Ghanbari Auburn University | ||
16:36 21mTalk | Contract Usage and Evolution in Android Mobile Applications Technical Papers David R. Ferreira Faculty of Engineering, University of Porto, Alexandra Mendes Faculty of Engineering, University of Porto & INESC TEC, João F. Ferreira INESC-ID and IST, University of Lisbon, Carolina Carreira Carnegie Mellon University, IST University of Lisbon, INESC-ID | ||
16:57 21mTalk | Chain of Grounded Objectives: Concise Goal-oriented Prompting for Code Generation Technical Papers Sangyeop Yeo ETRI (Electronics and Telecommunications Research Institute), seung-won hwang Seoul National University, Yu-Seung Ma Electronics and Telecommunications Research Institute | ||
17:18 21mTalk | Contract Systems Need Domain-Specific Notations Technical Papers Cameron Moy Northeastern University, Ryan Jung PLT @ Northeastern University, Matthias Felleisen Northeastern University |