Advertisement

iPerfDetector: Characterizing and detecting performance anti-patterns in iOS applications

  • Sara Seif Afjehei
  • Tse-Hsun (Peter) ChenEmail author
  • Nikolaos Tsantalis
Article
  • 16 Downloads

Abstract

Performance issues in mobile applications (i.e., apps) often have a direct impact on the user experience. However, due to limited testing resources and fast-paced software development cycles, many performance issues remain undiscovered when the apps are released. As found by a prior study, these performance issues are one of the most common complaints that app users have. Unfortunately, there is a limited support to help developers avoid or detect performance issues in mobile apps. In this paper, we conduct an empirical study on performance issues in iOS apps written in Swift language. To the best of our knowledge, this is the first study on performance issues of apps on the iOS platform. We manually studied 225 performance issues that are collected from four open source iOS apps. We found that most performance issues in iOS apps are related to inefficient UI design, memory issues, and inefficient thread handling. We also manually uncovered four performance anti-patterns that recurred in the studied issue reports. To help developers avoid these performance anti-patterns in the code, we implemented a static analysis tool called iPerfDetector. We evaluated iPerfDetector on eight open source and three commercial apps. iPerfDetector successfully detected 34 performance anti-pattern instances in the studied apps, where 31 of them are already confirmed and accepted by developers as potential performance issues. Our case study on the performance impact of the anti-patterns shows that fixing the anti-pattern may improve the performance (i.e., response time, GPU, or CPU) of the workload by up to 80%.

Keywords

iOS apps Performance Anti-pattern detection Empirical study Refactoring 

Notes

References

  1. Afjehei SS, Chen T-HP (2018) iOS performance issue reports. https://docs.google.com/spreadsheets/d/1hX8IBcYIVv6x4nWfWczT5oLV0b1SMQK03q6_xC9B8eQ/edit#gid=1079185239. Accessed 2018-07-23
  2. Apple (2015) More core data and concurrency. https://cocoacasts.com/more-core-data-and-concurrency. Accessed 2018-06-15
  3. Apple (2017) Apple threading programming guide. https://developer.apple.com/documentation/code_diagnostics/main_thread_checker. Accessed 2018-06-15
  4. Apple (2017) Nsmanagedobject programming guide. https://developer.apple.com/documentation/coredata/nsmanagedobjectcontext. Accessed 2018-06-15
  5. Apple (2018a) Apple guide on swift programming language. https://developer.apple.com/swift/. Accessed 2018-06-15
  6. Apple (2018b) Apple UIKit. https://developer.apple.com/documentation/uikit. Accessed 2018-06-15
  7. Apple (2018c) Instruments. https://help.apple.com/instruments/mac/current/#/dev7b09c84f5/. Accessed 2018-07-23
  8. Apple (2018d) Making core data your model layer. https://developer.apple.com/documentation/coredata/making_core_data_your_model_layer. Accessed 2018-06-15
  9. Apple (2018g) Using core data in the background. https://developer.apple.com/documentation/coredata/using_core_data_in_the_background. Accessed 2018-06-15
  10. Cassee N, Pinto G, Castor F, Serebrenik A (2018) How swift developers handle errors. In: 15Th international conference on mining software repositories (MSR 2018)Google Scholar
  11. Chen T-H, Weiyi S, Jiang ZM, Hassan AE, Nasser M, Flora P (2014) Detecting performance anti-patterns for applications developed using object-relational mapping. In: Proceedings of the 36th international conference on software engineering (ICSE), pp 1001–1012Google Scholar
  12. Chen T.-H., Shang W, Hassan AE, Nasser M, Flora P (2016a) Detecting problems in the database access code of large scale systems: an industrial experience report. In: Proceedings of the 38th international conference on software engineering companion, ICSE ’16, pp 71–80Google Scholar
  13. Chen T-H, Shang W, Jiang ZM, Hassan AE, Nasser M, Flora P (2016b) Finding and evaluating the performance impact of redundant data access for applications that are developed using object-relational mapping frameworks. IEEE Trans Softw Eng 42(12):1148–1161CrossRefGoogle Scholar
  14. Chen T-H, Syer MD, Shang W, Jiang ZM, Hassan AE, Nasser M, Flora P (2017) Analytics-driven load testing: an industrial experience report on load testing of large-scale systems. In: Proceedings of the 39th international conference on software engineering: software engineering in practice track, ICSE-SEIP ’17, pp 243–252Google Scholar
  15. Chowdhury S, Di Nardo S, Hindle A, Jiang ZMJ (2018) An exploratory study on assessing the energy impact of logging on android applications. Empir Softw Eng 23(3):1422–1456CrossRefGoogle Scholar
  16. Cruz L, Abreu R (2017) Performance-based guidelines for energy efficient mobile applications. In: 2017 IEEE/ACM 4th international conference on mobile software engineering and systems (MOBILESoft). IEEE, pp 46–57Google Scholar
  17. Facebook (2017) Facebook’s infer static analysis tool. http://fbinfer.com/. Accessed 2018-06-15
  18. Github (2018) Trending swift projects on github. https://github.com/trending/swift?since=monthly. Accessed 2018-06-15
  19. Gottschalk M, Jelschen J, Winter A (2014) Saving energy on mobile devices by refactoring. In: EnviroInfo, pp 437–444Google Scholar
  20. Grechanik M, Fu C, Xie Q (2012) Automatically finding performance problems with feedback-directed learning software testing. In: Proceedings of the 34th international conference on software engineering (ICSE), pp 156–166Google Scholar
  21. Guide ACDP (2017) Core data programming guide. https://developer.apple.com/documentation/coredata. Accessed 2018-06-15
  22. Habchi S, Hecht G, Rouvoy R, Moha N (2017) Code smells in ios apps: how do they compare to android?. In: Proceedings of the 4th international conference on mobile software engineering and systems. IEEE Press, pp 110–121Google Scholar
  23. Hecht G, Moha N, Rouvoy R (2016) An empirical study of the performance impacts of Android code smells. In: Proceedings of the international workshop on mobile software engineering and systems. ACM, pp 59–69Google Scholar
  24. Hu H, Bezemer C-P, Hassan AE (2018) Studying the consistency of star ratings and the complaints in 1 & 2-star user reviews for top free cross-platform android and iOS apps. Empir Softw EngGoogle Scholar
  25. Jiang ZM, Hassan AE, Hamann G, Flora P (2008) Automatic identification of load testing problems. In: Proceedings of 24th international conference on software maintenance (ICSM), pp 307–316Google Scholar
  26. Jin G, Song L, Shi X, Scherpelz J, Lu S (2012a) Understanding and detecting real-world performance bugs. In: Proceedings of the 33rd ACM SIGPLAN conference on programming language design and implementation, PLDI ’12Google Scholar
  27. Jin G, Song L, Shi X, Scherpelz J, Lu S (2012b) Understanding and detecting real-world performance bugs. In: Proceedings of the 33rd ACM SIGPLAN conference on programming language design and implementation, PLDI ’12, pp 77–88Google Scholar
  28. Jin G, Song L, Shi X, Scherpelz J, Lu S (2012c) Understanding and detecting real-world performance bugs. ACM SIGPLAN Not 47(6):77–88CrossRefGoogle Scholar
  29. Jindal A, Pathak A, Hu YC, Midkiff S (2013) On death, taxes, and sleep disorder bugs in smartphones. In: Proceedings of the workshop on power-aware computing and systems. ACM, p 1Google Scholar
  30. Khalid H, Shihab E, Nagappan M, Hassan AE (2015) What do mobile app users complain about? IEEE Softw 32(3):70–77CrossRefGoogle Scholar
  31. Lin Y, Okur S, Dig D (2015) Study and refactoring of android asynchronous programming (t). In: 2015 30th IEEE/ACM international conference on automated software engineering (ASE). IEEE, pp 224–235Google Scholar
  32. Liu Y, Xu C, Cheung S-C (2014) Characterizing and detecting performance bugs for smartphone applications. In: Proceedings of the 36th international conference on software engineering. ACM, pp 1013–1024Google Scholar
  33. Mannan UA, Ahmed I, Almurshed RAM, Dig D, Jensen C (2016) Understanding code smells in android applications. In: 2016 IEEE/ACM international conference on mobile software engineering and systems (MOBILESoft). IEEE, pp 225–236Google Scholar
  34. Martin W, Sarro F, Jia Y, Zhang Y, Harman M (2017) A survey of app store analysis for software engineering. IEEE Trans Softw Eng 43(9):817–847CrossRefGoogle Scholar
  35. Fowler M, Beck K, Brant J, Opdyke W, Roberts D (1999) Refactoring: improving the design of existing code. Addison-Wesley, ReadingGoogle Scholar
  36. McDonnell T, Ray B, Kim M (2013) An empirical study of api stability and adoption in the android ecosystem. In: Proceedings of the 2013 IEEE international conference on software maintenance, ICSM ’13, pp 70–79Google Scholar
  37. Medium (2015) Diagnose and solve performance problems with xcode instruments. https://medium.com/@zhenya.peteliev/diagnose-and-solve-performance-problem-with-xcode-instruments-5c25c27f21d5. Accessed 2018-11-05
  38. Medium (2016) 21 amazing open source iOS apps written in swift. https://medium.mybridge.co/21-amazing-open-source-ios-apps-written-in-swift-5e835afee98e. Accessed 2018-06-11
  39. Morales R, Saborido R, Khomh F, Chicano F, Antoniol G (2017) Earmo: an energy-aware refactoring approach for mobile apps. IEEE Trans Softw Eng, (1):1–1Google Scholar
  40. Nistor A, Jiang T, Tan L (2013a) Discovering, reporting, and fixing performance bugs. In: Proceedings of the 10th working conference on mining software repositories. IEEE Press, pp 237–246Google Scholar
  41. Nistor A, Song L, Marinov D, Lu S (2013b) Toddler: detecting performance problems via similar memory-access patterns. In: Proceedings of the 2013 international conference on software engineering, ICSE ’13, pp 562–571Google Scholar
  42. Nistor A, Chang P-C, Radoi C, Lu S (2015) Caramel: detecting and fixing performance problems that have non-intrusive fixes. In: Proceedings of the 2015 international conference on software engineering, ICSE ’15, pp 902–912Google Scholar
  43. Okur S, Hartveld DL, Dig D, Deursen AV (2014) A study and toolkit for asynchronous programming in C#. In: Proceedings of the 36th international conference on software engineering. ACM, pp 1117–1127Google Scholar
  44. Palomba F, Di Nucci D, Panichella A, Zaidman A, De Lucia A (2017) Lightweight detection of android-specific code smells: the adoctor project. In: Proceedings of the 24th international conference on software analysis, evolution and reengineering, SANER ’17, pp 487–491Google Scholar
  45. Pathak A, Hu YC, Zhang M (2011) Bootstrapping energy debugging on smartphones: a first look at energy bugs in mobile devices. In: Proceedings of the 10th ACM workshop on hot topics in networks. ACM, p 5Google Scholar
  46. Pathak A, Hu YC, Zhang M (2012) Where is the energy spent inside my app?: fine grained energy accounting on smartphones with eprof. In: Proceedings of the 7th ACM European conference on computer systems. ACM, pp 29–42Google Scholar
  47. Rebouças M, Pinto G, Ebert F, Torres W, Serebrenik A, Castor F (2016) An empirical study on the usage of the swift programming language. In: 2016 IEEE 23rd international conference on software analysis, evolution, and reengineering (SANER). IEEE, pp 634–638Google Scholar
  48. RedMonk (2018) The RedMonk programming language rankings: January 2018. http://redmonk.com/sogrady/2018/03/07/language-rankings-1-18/. Accessed 2018-06-11
  49. Reimann J, Brylski M, Aßmann U (2014) A tool-supported quality smell catalogue for android developers. In: Proceeding of the conference modellierung 2014 in the workshop modellbasierte und modellgetriebene softwaremodernisierung–MMSMGoogle Scholar
  50. Smith CU, Williams LG (2001) Software performance antipatterns; common performance problems and their solutions. In: Int CMG conference, pp 797–806Google Scholar
  51. Statista (2018) Number of apps available in leading app stores. https://www.statista.com/statistics/276623/number-of-apps-available-in-leading-app-stores/. Accessed 2018-07-23
  52. Statistia (2018) Number of apps available in leading app stores as of 1st quarter 2018. https://www.statista.com/statistics/276623/number-of-apps-available-in-leading-app-stores/. Accessed 2018-06-15
  53. SwiftAST (2018) Swift-ast tool on github. https://github.com/yanagiba/swift-ast. Accessed 2018-6-30
  54. Syer MD, Nagappan M, Hassan AE, Adams B (2013) Revisiting prior empirical findings for mobile apps: an empirical case study on the 15 most popular open-source android apps. In: Proceedings of the 2013 conference of the center for advanced studies on collaborative research, CASCON ’13, pp 283–297Google Scholar
  55. Zaman S, Adams B, Hassan AE (2012) A qualitative study on performance bugs. In: Proceedings of the 9th IEEE working conference on mining software repositories. IEEE Press, pp 199–208Google Scholar

Copyright information

© Springer Science+Business Media, LLC, part of Springer Nature 2019

Authors and Affiliations

  1. 1.Department of Software Engineering and Computer Science, Software PErformance, Analysis, and Reliability (SPEAR) LabConcordia UniversityMontrealCanada
  2. 2.Department of Software Engineering and Computer ScienceConcordia UniversityMontrealCanada

Personalised recommendations