A static analysis of android source code for lifecycle development usage patterns

Noura Hoshieah, Samer Zein, Norsaremah Salleh, John Grundy

Research output: Contribution to journalArticleResearchpeer-review

Abstract

Building robust Android apps is a non-trivial task that requires skilled developers to understand various Android platform peculiarities. However, among the Android developers community, a large fractions are considered to be novice and inexperienced developers. One of the main peculiarities in the Android app development is the activity lifecycle model. A developer needs to have deep understanding of the different lifecycle states and callback methods that an Android activity can go through during its runtime. These callback methods are called by the system whenever an app activity changes its state. The developer needs to override appropriate callback methods correctly to avoid app memory leaks and data loss or other phone resource compromise. Detailed static analysis of software applications provides actionable insights and helps us to understand how applications are actually built. Although there have been many studies focusing on static analysis of Android apps in the areas of testing, quality, design, privacy and security; no studies to date focus on lifecycle development practices and usage patterns thus far. In this paper, we analyzed 842 open-source Android apps containing 5577 activities to explore and understand how Android developers actually comply with best practices regarding the Android activity lifecycle model. We developed a tool named SAALC that is capable of analyzing Android activities and extracting valuable information about lifecycle callback methods usage. Our results show, which callback methods are implemented and the nature of the code they contain. The results also show incorrect implementation of the callback methods and incorrect acquiring and releasing of system resources in many Android apps and we argue that a relatively large fraction of Android developers do not sufficiently well understand the app lifecycle model. We also discuss our results in comparison to the Android app lifecycle model best practices.

Original languageEnglish
Pages (from-to)92-107
Number of pages16
JournalJournal of Computer Science
Volume15
Issue number1
DOIs
Publication statusPublished - 2019

Keywords

  • Activity lifecycle
  • Android
  • Application
  • Mobile Apps
  • Static analysis

Cite this

Hoshieah, Noura ; Zein, Samer ; Salleh, Norsaremah ; Grundy, John. / A static analysis of android source code for lifecycle development usage patterns. In: Journal of Computer Science. 2019 ; Vol. 15, No. 1. pp. 92-107.
@article{d89ff93afb5849628f708e655e6854bc,
title = "A static analysis of android source code for lifecycle development usage patterns",
abstract = "Building robust Android apps is a non-trivial task that requires skilled developers to understand various Android platform peculiarities. However, among the Android developers community, a large fractions are considered to be novice and inexperienced developers. One of the main peculiarities in the Android app development is the activity lifecycle model. A developer needs to have deep understanding of the different lifecycle states and callback methods that an Android activity can go through during its runtime. These callback methods are called by the system whenever an app activity changes its state. The developer needs to override appropriate callback methods correctly to avoid app memory leaks and data loss or other phone resource compromise. Detailed static analysis of software applications provides actionable insights and helps us to understand how applications are actually built. Although there have been many studies focusing on static analysis of Android apps in the areas of testing, quality, design, privacy and security; no studies to date focus on lifecycle development practices and usage patterns thus far. In this paper, we analyzed 842 open-source Android apps containing 5577 activities to explore and understand how Android developers actually comply with best practices regarding the Android activity lifecycle model. We developed a tool named SAALC that is capable of analyzing Android activities and extracting valuable information about lifecycle callback methods usage. Our results show, which callback methods are implemented and the nature of the code they contain. The results also show incorrect implementation of the callback methods and incorrect acquiring and releasing of system resources in many Android apps and we argue that a relatively large fraction of Android developers do not sufficiently well understand the app lifecycle model. We also discuss our results in comparison to the Android app lifecycle model best practices.",
keywords = "Activity lifecycle, Android, Application, Mobile Apps, Static analysis",
author = "Noura Hoshieah and Samer Zein and Norsaremah Salleh and John Grundy",
year = "2019",
doi = "10.3844/jcssp.2019.92.107",
language = "English",
volume = "15",
pages = "92--107",
journal = "Journal of Computer Science",
issn = "1549-3636",
publisher = "Science Publications",
number = "1",

}

A static analysis of android source code for lifecycle development usage patterns. / Hoshieah, Noura; Zein, Samer; Salleh, Norsaremah; Grundy, John.

In: Journal of Computer Science, Vol. 15, No. 1, 2019, p. 92-107.

Research output: Contribution to journalArticleResearchpeer-review

TY - JOUR

T1 - A static analysis of android source code for lifecycle development usage patterns

AU - Hoshieah, Noura

AU - Zein, Samer

AU - Salleh, Norsaremah

AU - Grundy, John

PY - 2019

Y1 - 2019

N2 - Building robust Android apps is a non-trivial task that requires skilled developers to understand various Android platform peculiarities. However, among the Android developers community, a large fractions are considered to be novice and inexperienced developers. One of the main peculiarities in the Android app development is the activity lifecycle model. A developer needs to have deep understanding of the different lifecycle states and callback methods that an Android activity can go through during its runtime. These callback methods are called by the system whenever an app activity changes its state. The developer needs to override appropriate callback methods correctly to avoid app memory leaks and data loss or other phone resource compromise. Detailed static analysis of software applications provides actionable insights and helps us to understand how applications are actually built. Although there have been many studies focusing on static analysis of Android apps in the areas of testing, quality, design, privacy and security; no studies to date focus on lifecycle development practices and usage patterns thus far. In this paper, we analyzed 842 open-source Android apps containing 5577 activities to explore and understand how Android developers actually comply with best practices regarding the Android activity lifecycle model. We developed a tool named SAALC that is capable of analyzing Android activities and extracting valuable information about lifecycle callback methods usage. Our results show, which callback methods are implemented and the nature of the code they contain. The results also show incorrect implementation of the callback methods and incorrect acquiring and releasing of system resources in many Android apps and we argue that a relatively large fraction of Android developers do not sufficiently well understand the app lifecycle model. We also discuss our results in comparison to the Android app lifecycle model best practices.

AB - Building robust Android apps is a non-trivial task that requires skilled developers to understand various Android platform peculiarities. However, among the Android developers community, a large fractions are considered to be novice and inexperienced developers. One of the main peculiarities in the Android app development is the activity lifecycle model. A developer needs to have deep understanding of the different lifecycle states and callback methods that an Android activity can go through during its runtime. These callback methods are called by the system whenever an app activity changes its state. The developer needs to override appropriate callback methods correctly to avoid app memory leaks and data loss or other phone resource compromise. Detailed static analysis of software applications provides actionable insights and helps us to understand how applications are actually built. Although there have been many studies focusing on static analysis of Android apps in the areas of testing, quality, design, privacy and security; no studies to date focus on lifecycle development practices and usage patterns thus far. In this paper, we analyzed 842 open-source Android apps containing 5577 activities to explore and understand how Android developers actually comply with best practices regarding the Android activity lifecycle model. We developed a tool named SAALC that is capable of analyzing Android activities and extracting valuable information about lifecycle callback methods usage. Our results show, which callback methods are implemented and the nature of the code they contain. The results also show incorrect implementation of the callback methods and incorrect acquiring and releasing of system resources in many Android apps and we argue that a relatively large fraction of Android developers do not sufficiently well understand the app lifecycle model. We also discuss our results in comparison to the Android app lifecycle model best practices.

KW - Activity lifecycle

KW - Android

KW - Application

KW - Mobile Apps

KW - Static analysis

UR - http://www.scopus.com/inward/record.url?scp=85061607758&partnerID=8YFLogxK

U2 - 10.3844/jcssp.2019.92.107

DO - 10.3844/jcssp.2019.92.107

M3 - Article

VL - 15

SP - 92

EP - 107

JO - Journal of Computer Science

JF - Journal of Computer Science

SN - 1549-3636

IS - 1

ER -