Nothing Special   »   [go: up one dir, main page]

skip to main content
10.1109/ASE.2015.50acmconferencesArticle/Chapter ViewAbstractPublication PagesaseConference Proceedingsconference-collections
research-article

Study and refactoring of Android asynchronous programming

Published: 09 November 2015 Publication History

Abstract

To avoid unresponsiveness, a core part of mobile development is asynchronous programming. Android provides several async constructs that developers can use. However, developers can still use the inappropriate async constructs, which result in memory leaks, lost results, and wasted energy. Fortunately, refactoring tools can eliminate these problems by transforming async code to use the appropriate constructs.
In this paper we conducted a formative study on a corpus of 611 widely-used Android apps to map the asynchronous landscape of Android apps, understand how developers retrofit asynchrony, and learn about barriers encountered by developers. Based on this study, we designed, implemented, and evaluated AsyncDroid, a refactoring tool which enables Android developers to transform existing improperly-used async constructs into correct constructs. Our empirical evaluation shows that AsyncDroid is applicable, accurate, and saves developers effort. We submitted 45 refactoring patches, and developers consider that the refactorings are useful.

References

[1]
"Activitys, Threads and Memory Leaks," May 2015, http://www.androiddesignpatterns.com/2013/04/activitys-threads-memory-leaks.html.
[2]
"Android Intents and Intent Filters," May 2015, http://developer.android.com/guide/components/intents-filters.html.
[3]
"Android Processes and Threads," May 2015, http://developer.android.com/guide/components/processes-and-threads.html.
[4]
"Android's AsyncTask," May 2015, http://steveliles.github.io/android_s_asynctask.html.
[5]
"Antennapod repository." May 2015, https://github.com/AntennaPod/AntennaPod.
[6]
"The dark side of AsyncTask," May 2015, http://bon-app-etit.blogspot.com/2013/04/the-dark-side-of-asynctask.html.
[7]
"Eclips Refactoring Engine," May 2015, https://www.eclipse.org/articles/Article-LTK/ltk.html.
[8]
"Eclipse Java development tools (JDT)," May 2015, http://www.eclipse.org/jdt/.
[9]
"Gartner." May 2015, http://www.gartner.com/newsroom/id/2153215.
[10]
"GiTective," May 2015, https://github.com/kevinsawicki/gitective.
[11]
"GitHub," May 2015, https://github.com.
[12]
"Java Serializability," May 2015, http://docs.oracle.com/javase/1.5.0/docs/guide/serialization/spec/serial-arch.html.
[13]
"JDK Swing Framework," May 2015, http://docs.oracle.com/javase/6/docs/technotes/guides/swing/.
[14]
"SLOCCount," May 2015, http://www.dwheeler.com/sloccount/.
[15]
"Stack Overflow." May 2015, http://stackoverflow.com.
[16]
"Tablet Sales." May 2015, http://www.gartner.com/newsroom/id/2954317.
[17]
"The SWT Toolkit," May 2015, http://eclipse.org/swt/.
[18]
"Whatandroid repository." May 2015, https://github.com/Gwindow/WhatAndroid.
[19]
N. Arijo, R. Heckel, M. Tribastone, and S. Gilmore, "Modular performance modelling for mobile applications," in Proceedings of the 2nd ACM/SPEC International Conference on Performance Engineering, ser. ICPE '11, 2011, pp. 329--334.
[20]
P. Banerjee, J. Chandy, M. Gupta, J. Holm, A. Lain, D. Palermo, S. Ramaswamy, and E. Su, "The paradigm compiler for distributed-memory message passing multicomputers," IEEE Computer, vol. 28, pp. 37--47, 1994.
[21]
A. Basumallik and R. Eigenmann, "Towards automatic translation of openmp to mpi," in Proceedings of the 19th Annual International Conference on Supercomputing, ser. ICS '05, 2005, pp. 189--198.
[22]
A. Basumallik and R. Eigenmann, "Optimizing irregular shared-memory applications for distributed-memory systems," in Proceedings of the Eleventh ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming, ser. PPoPP '06, 2006, pp. 119--128.
[23]
G. Bavota, B. D. Carluccio, A. D. Lucia, M. D. Penta, R. Oliveto, and O. Strollo, "When does a refactoring induce bugs? An empirical study," in Proceedings of the IEEE International Working Conference on Source Code Analysis and Manipulation, ser. SCAM '12, 2012, pp. 104--113.
[24]
L. Berardinelli, V. Cortellessa, and A. D. Marco, "Performance modeling and analysis of context-aware mobile software systems," in Proceedings of the International Conference on Fundamental Approaches to Software Engineering, ser. FASE 10, 2010, pp. 353--367.
[25]
R. P. L. Buse and W. Weimer, "Synthesizing API usage examples," in Proceedings of the 34th International Conference on Software Engineering, ser. ICSE '12, 2012, pp. 782--792.
[26]
O. Callaú, R. Robbes, E. Tanter, and D. Röthlisberger, "How developers use the dynamic features of programming languages: The case of Smalltalk," in Proceedings of the 8th Working Conference on Mining Software Repositories, ser. MSR '11, 2011, pp. 23--32.
[27]
D. Dig, J. Marrero, and M. Ernst, "Refactoring sequential Java code for concurrency via concurrent libraries," in Proceedings of the International Conference on Software Engineering, ser. ICSE '09, 2009, pp. 397--407.
[28]
R. Dyer, H. Rajan, H. A. Nguyen, and T. N. Nguyen, "Mining billions of AST nodes to study actual and potential usage of Java language features," in Proceedings of the 36th International Conference on Software Engineering, ser. ICSE 2014, 2014, pp. 779--790.
[29]
M. Grechanik, C. McMillan, L. DeFerrari, M. Comi, S. Crespi, D. Poshyvanyk, C. Fu, Q. Xie, and C. Ghezzi, "An empirical investigation into a large-scale java open source code repository," in Proceedings of the 2010 ACM-IEEE International Symposium on Empirical Software Engineering and Measurement, ser. ESEM '10, 2010, pp. 11:1--11:10.
[30]
W. G. Griswold, "Program restructuring as an aid to software maintenance," Ph.D. dissertation, University of Washington, Seattle, WA, USA, 1992.
[31]
S. Karus and H. Gall, "A study of language usage evolution in open source software," in Proceedings of the 8th Working Conference on Mining Software Repositories, ser. MSR '11, 2011, pp. 13--22.
[32]
F. Kjolstad, D. Dig, G. Acevedo, and M. Snir, "Transformation for class immutability," in Proceedings of the International Conference on Software Engineering, ser. ICSE '11, 2011, pp. 61--70.
[33]
Z. Li, L. Tan, X. Wang, S. Lu, Y. Zhou, and C. Zhai, "Have things changed now?: An empirical study of bug characteristics in modern open source software," in Proceedings of the 1st Workshop on Architectural and System Support for Improving Software Dependability, ser. ASID '06, 2006, pp. 25--33.
[34]
M. Lillack, C. Kästner, and E. Bodden, "Tracking load-time configuration options," in Proceedings of the 29th ACM/IEEE International Conference on Automated Software Engineering, ser. ASE '14, 2014, pp. 445--456.
[35]
Y. Lin and D. Dig, "Check-then-act misuse of Java concurrent collections," in Proceedings of the International Conference on Software Testing, Verification and Validation, ser. ICST '13, 2013, pp. 164--173.
[36]
Y. Lin, C. Radoi, and D. Dig, "Retrofitting concurrency for android applications through refactoring," in Proceedings of the 22Nd ACM SIGSOFT International Symposium on Foundations of Software Engineering, ser. FSE 2014, 2014, pp. 341--352.
[37]
Y. Liu, C. Xu, and S. Cheung, "Characterizing and detecting performance bugs for smartphone applications," in Proceedings of the International Conference on Software Engineering, ser. ICSE '14, 2014, pp. 1013--1024.
[38]
S.-J. Min and R. Eigenmann, "Optimizing irregular shared-memory applications for clusters," in Proceedings of the 22Nd Annual International Conference on Supercomputing, ser. ICS '08, 2008, pp. 256--265.
[39]
H. Muccini, A. Di Francesco, and P. Esposito, "Software testing of mobile applications: Challenges and future research directions," in Proceedings of the 7th International Workshop on Automation of Software Test, ser. AST '12, 2012, pp. 29--35.
[40]
M. Murphy, The Busy Coder's Guide to Android Development. CommonsWare, 2009.
[41]
S. Okur, D. Hartveld, D. Dig, and A. Deursen, "A study and toolkit for asynchronous programming in C#," in Proceedings of the International Conference on Software Engineering, ser. ICSE '14, 2014, pp. 1117--1127.
[42]
W. F. Opdyke, "Refactoring object-oriented frameworks," Ph.D. dissertation, University of Illinois at Urbana-Champaign, Champaign, IL, USA, 1992.
[43]
C. Parnin, C. Bird, and E. Murphy-Hill, "Adoption and use of Java generics," Empirical Softw. Engg., vol. 18, no. 6, pp. 1047--1089, Dec. 2013.
[44]
C. Sahin, L. Pollock, and J. Clause, "How do code refactorings affect energy usage?" in Proceedings of the 8th ACM/IEEE International Symposium on Empirical Software Engineering and Measurement, ser. ESEM '14, 2014, pp. 36:1--36:10.
[45]
M. Schäfer, J. Dolby, M. Sridharan, E. Torlak, and F. Tip, "Correct refactoring of concurrent Java code," in Proceedings of the 24th European Conference on Object-oriented Programming, ser. ECOOP'10, 2010, pp. 225--249.
[46]
M. Schäfer, M. Sridharan, J. Dolby, and F. Tip, "Refactoring Java programs for flexible locking," in Proceedings of the International Conference on Software Engineering, ser. ICSE '11, 2011, pp. 71--80.
[47]
M. Vakilian, D. Dig, R. Bocchino, J. Overbey, V. Adve, and R. Johnson, "Inferring method effect summaries for nested heap regions," in Proceedings of the IEEE/ACM International Conference on Automated Software Engineering, ser. ASE '09, 2009, pp. 421--432.
[48]
J. Wloka, M. Sridharan, and F. Tip, "Refactoring for reentrancy," in Proceedings of the ACM SIGSOFT Symposium on The Foundations of Software Engineering, ser. FSE '09, 2009, pp. 173--182.
[49]
D. Yan, S. Yang, and A. Rountev, "Systematic testing for resource leaks in Android applications," in Proceedings of the IEEE 24th International Symposium on Software Reliability Engineering, ser. ISSRE 13, 2013, pp. 411--420.
[50]
S. Yang, D. Yan, and A. Rountev, "Testing for poor responsiveness in Android applications," in Proceedings of the International Workshop on the Engineering of Mobile-Enabled Systems, ser. MOBS '13, 2013, pp. 1--6.
[51]
J. Zhu, J. Hoeflinger, and D. Padua, "Compiling for a hybrid programming model using the lmad representation," in Proceedings of the 14th International Conference on Languages and Compilers for Parallel Computing, ser. LCPC '01, 2003, pp. 321--335.

Cited By

View all
  • (2023)An Automated Approach to Extracting Local VariablesProceedings of the 31st ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering10.1145/3611643.3616261(313-325)Online publication date: 30-Nov-2023
  • (2023)A systematic literature review on Android-specific smellsJournal of Systems and Software10.1016/j.jss.2023.111677201:COnline publication date: 1-Jul-2023
  • (2022)E-APK: Energy Pattern Detection in Decompiled Android ApplicationsProceedings of the XXVI Brazilian Symposium on Programming Languages10.1145/3561320.3561328(50-58)Online publication date: 6-Oct-2022
  • Show More Cited By

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM Conferences
ASE '15: Proceedings of the 30th IEEE/ACM International Conference on Automated Software Engineering
November 2015
935 pages
ISBN:9781509000241

Sponsors

In-Cooperation

  • IEEE CS

Publisher

IEEE Press

Publication History

Published: 09 November 2015

Check for updates

Qualifiers

  • Research-article

Conference

ASE '15
Sponsor:

Acceptance Rates

Overall Acceptance Rate 82 of 337 submissions, 24%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)1
  • Downloads (Last 6 weeks)0
Reflects downloads up to 21 Nov 2024

Other Metrics

Citations

Cited By

View all
  • (2023)An Automated Approach to Extracting Local VariablesProceedings of the 31st ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering10.1145/3611643.3616261(313-325)Online publication date: 30-Nov-2023
  • (2023)A systematic literature review on Android-specific smellsJournal of Systems and Software10.1016/j.jss.2023.111677201:COnline publication date: 1-Jul-2023
  • (2022)E-APK: Energy Pattern Detection in Decompiled Android ApplicationsProceedings of the XXVI Brazilian Symposium on Programming Languages10.1145/3561320.3561328(50-58)Online publication date: 6-Oct-2022
  • (2022)ReInstancerProceedings of the ACM/IEEE 44th International Conference on Software Engineering: Companion Proceedings10.1145/3510454.3516868(183-187)Online publication date: 21-May-2022
  • (2022)Enabling Mutant Generation for Open- and Closed-Source Android AppsIEEE Transactions on Software Engineering10.1109/TSE.2020.298263848:1(186-208)Online publication date: 7-Jan-2022
  • (2021)Automatic migration from synchronous to asynchronous JavaScript APIsProceedings of the ACM on Programming Languages10.1145/34855375:OOPSLA(1-27)Online publication date: 15-Oct-2021
  • (2021)An Empirical Study of Refactorings and Technical Debt in Machine Learning SystemsProceedings of the 43rd International Conference on Software Engineering10.1109/ICSE43902.2021.00033(238-250)Online publication date: 22-May-2021
  • (2020)An Exploratory Study on the Refactoring of Unit Test Files in Android ApplicationsProceedings of the IEEE/ACM 42nd International Conference on Software Engineering Workshops10.1145/3387940.3392189(350-357)Online publication date: 27-Jun-2020
  • (2020)Static asynchronous component misuse detection for Android applicationsProceedings of the 28th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering10.1145/3368089.3409699(952-963)Online publication date: 8-Nov-2020
  • (2019)A preliminary study of Android refactoringsProceedings of the 6th International Conference on Mobile Software Engineering and Systems10.5555/3340730.3340760(148-149)Online publication date: 25-May-2019
  • Show More Cited By

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media