Advertisement

Automated Software Engineering

, Volume 25, Issue 4, pp 833–873 | Cite as

Static window transition graphs for Android

  • Shengqian Yang
  • Haowei WuEmail author
  • Hailong Zhang
  • Yan Wang
  • Chandrasekar Swaminathan
  • Dacong Yan
  • Atanas Rountev
Article
  • 359 Downloads

Abstract

This work develops a static analysis to create a model of the behavior of an Android application’s GUI. We propose the window transition graph (WTG), a model representing the possible GUI window sequences and their associated events and callbacks. A key component and contribution of our work is the careful modeling of the stack of currently-active windows, the changes to this stack, and the effects of callbacks related to these changes. To the best of our knowledge, this is the first detailed study of this important static analysis problem for Android. We develop novel analysis algorithms for WTG construction and traversal, based on this modeling of the window stack. We also propose WTG extensions to handle certain aspects of asynchronous control flow. We describe an application of the WTG for GUI test generation, using path traversals. The evaluation of the proposed algorithms indicates their effectiveness and practicality.

Keywords

Android Static analysis GUI analysis 

Notes

Acknowledgements

This material is based upon work supported by the U.S. National Science Foundation under CCF-1319695 and CCF-1526459, and by a Google Faculty Research Award.

References

  1. Amalfitano, D., Fasolino, A.R., Tramontana, P., De Carmine, S., Memon, A.M.: Using GUI ripping for automated testing of Android applications. In: International Conference on Automated Software Engineering, pp. 258–261 (2012)Google Scholar
  2. Anand, S., Naik, M., Harrold, M.J., Yang, H.: Automated concolic testing of smartphone apps. In: ACM SIGSOFT International Symposium on the Foundations of Software Engineering, pp. 59:1–59:11 (2012)Google Scholar
  3. APV: APV PDF viewer. http://code.google.com/p/apv. Accessed 2015 (2015)
  4. Arlt, S., Podelski, A., Bertolini, C., Schäf, M., Banerjee, I., Memon, A.M.: Lightweight static analysis for GUI testing. In: IEEE International Symposium on Software Reliability Engineering, pp. 301–310 (2012)Google Scholar
  5. Arzt, S., Rasthofer, S., Fritz, C., Bodden, E., Bartel, A., Klein, J., Le Traon, Y., Octeau, D., McDaniel, P.: FlowDroid: Precise context, flow, field, object-sensitive and lifecycle-aware taint analysis for Android apps. In: ACM SIGPLAN Conference on Programming Language Design and Implementation, pp. 259–269 (2014)Google Scholar
  6. Azim, T., Neamtiu, I.: Targeted and depth-first exploration for systematic testing of Android apps. In: ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications, pp. 641–660 (2013)Google Scholar
  7. Baek, Y.M., Bae, D.H.: Automated model-based android gui testing using multi-level gui comparison criteria. In: International Conference on Automated Software Engineering, pp. 238–249 (2016)Google Scholar
  8. Banerjee, A., Chong, L.K., Chattopadhyay, S., Roychoudhury, A.: Detecting energy bugs and hotspots in mobile apps. In: ACM SIGSOFT International Symposium on the Foundations of Software Engineering, pp. 588–598 (2014)Google Scholar
  9. Cai, H., Ryder, B.G.: Understanding android application programming and security: a dynamic study. In: IEEE International Conference on Software Maintenance and Evolution, pp. 364–375 (2017)Google Scholar
  10. Chin, E., Felt, A.P., Greenwood, K., Wagner, D.: Analyzing inter-application communication in Android. In: International Conference on Mobile Systems, Applications, and Services, pp. 239–252 (2011)Google Scholar
  11. Choudhary, S.R., Gorla, A., Orso, A.: Automated test input generation for Android: Are we there yet? In: International Conference on Automated Software Engineering, pp. 429–440 (2015)Google Scholar
  12. Dubroy, P.: Memory management for Android applications. In: Google I/O Developers Conference (2011)Google Scholar
  13. Feng, Y., Anand, S., Dillig, I., Aiken, A.: Apposcopy: Semantics-based detection of Android malware through static analysis. In: ACM SIGSOFT International Symposium on the Foundations of Software Engineering, pp. 576–587 (2014)Google Scholar
  14. Fuchs, A.P., Chaudhuri, A., Foster, J.S.: SCanDroid: Automated security certification of Android applications. Technical Report CS-TR-4991, University of Maryland, College Park (2009)Google Scholar
  15. GATOR: Gator: Program analysis toolkit for Android. web.cse.ohio-state.edu/presto/software/gator (2017). Accessed Nov 2017
  16. Google Inc.: Android dialogs. developer.android.com/guide/topics/ui/dialogs.html (2017a). Accessed June 2018
  17. Google Inc.: Intents and intent filters. developer.android.com/guide/components/intents-filters.html (2017b). Accessed June 2018
  18. Google Inc.: Stopping and restarting an activity. developer.android.com/training/basics/activity-lifecycle/st opping.html (2017c). Accessed June 2018
  19. Google Inc.: Tasks and back stack. developer.android.com/guide/components/tasks-and-back-stack.html (2017d). Accessed June 2018
  20. Grace, M., Zhou, Y., Wang, Z., Jiang, X.: Systematic detection of capability leaks in stock Android smartphones. In: Network and Distributed System Security Symposium (2012)Google Scholar
  21. Gross, F., Fraser, G., Zeller, A.: Search-based system testing: high coverage, no false alarms. In: ACM SIGSOFT International Symposium on Software Testing and Analysis, pp. 67–77 (2012)Google Scholar
  22. Guo, C., Zhang, J., Yan, J., Zhang, Z., Zhang, Y.: Characterizing and detecting resource leaks in Android applications. In: International Conference on Automated Software Engineering, pp. 389–398 (2013)Google Scholar
  23. Hao, S., Liu, B., Nath, S., Halfond, W.G., Govindan, R.: PUMA: Programmable UI-automation for large-scale dynamic analysis of mobile apps. In: International Conference on Mobile Systems, Applications, and Services, pp. 204–217 (2014)Google Scholar
  24. Huang, J., Zhang, X., Tan, L., Wang, P., Liang, B.: AsDroid: Detecting stealthy behaviors in Android applications by user interface and program behavior contradiction. In: International Conference on Software Engineering, pp. 1036–1046 (2014)Google Scholar
  25. Jamrozik, K., von Styp-Rekowsky, P., Zeller, A.: BOXMATE (2017). boxmate.org
  26. Jensen, C.S., Prasad, M.R., Møller, A.: Automated testing with targeted event sequence generation. In: ACM SIGSOFT International Symposium on Software Testing and Analysis, pp. 67–77 (2013)Google Scholar
  27. Lee, Y.K., Safi, G., Shahbazian, A., Zhao, Y., Medvidovic, N., et al.: A sealant for inter-app security holes in Android. In: International Conference on Software Engineering, pp. 312–323 (2017)Google Scholar
  28. Li, D., Hao, S., Halfond, W.G.J., Govindan, R.: Calculating source line level energy information for Android applications. In: ACM SIGSOFT International Symposium on Software Testing and Analysis, pp. 78–89 (2013)Google Scholar
  29. Li, L., Bartel, A., Bissyandé, T.F., Klein, J., Le Traon, Y., Arzt, S., Rasthofer, S., Bodden, E., Octeau, D., McDaniel, P.: Iccta: Detecting inter-component privacy leaks in android apps. In: International Conference on Software Engineering, pp. 280–291 (2015)Google Scholar
  30. Li, L., Bissyandé, T.F., Papadakis, M., Rasthofer, S., Bartel, A., Octeau, D., Klein, J., Le Traon, Y.: Static analysis of android apps: A systematic literature review. In: Information and Software Technology (2017)Google Scholar
  31. Liang, S., Keep, A.W., Might, M., Lyde, S., Gilray, T., Aldous, P., Van Horn, D.: Sound and precise malware analysis for Android via pushdown reachability and entry-point saturation. In: ACM Workshop on Security and Privacy in Smartphones and Mobile Devices, pp. 21–32 (2013)Google Scholar
  32. Lin, Y., Radoi, C., Dig, D.: Retrofitting concurrency for Android applications through refactoring. In: ACM SIGSOFT International Symposium on the Foundations of Software Engineering, pp. 341–352 (2014)Google Scholar
  33. Liu, Y., Xu, C., Cheung, S.C., Lu, J.: GreenDroid: automated diagnosis of energy inefficiency for smartphone applications. IEEE Trans. Softw. Eng. 40, 911–940 (2014)CrossRefGoogle Scholar
  34. Lu, K., Li, Z., Kemerlis, V.P., Wu, Z., Lu, L., Zheng, C., Qian, Z., Lee, W., Jiang, G.: Checking more and alerting less: detecting privacy leakages via enhanced data-flow analysis and peer voting. In: Network and Distributed System Security Symposium (2015)Google Scholar
  35. Lu, L., Li, Z., Wu, Z., Lee, W., Jiang, G.: CHEX: Statically vetting Android apps for component hijacking vulnerabilities. In: ACM Conference on Computer and Communications Security, pp. 229–240 (2012)Google Scholar
  36. Machiry, A., Tahiliani, R., Naik, M.: Dynodroid: An input generation system for Android apps. In: ACM SIGSOFT International Symposium on the Foundations of Software Engineering, pp. 224–234 (2013)Google Scholar
  37. Mahmood, R., Mirzaei, N., Malek, S.: EvoDroid: Segmented evolutionary testing of Android apps. In: ACM SIGSOFT International Symposium on the Foundations of Software Engineering, pp. 599–609 (2014)Google Scholar
  38. Memon, A.M.: An event-flow model of GUI-based applications for testing. Softw. Test. Verif. Reliab. 17(3), 137–157 (2007)CrossRefGoogle Scholar
  39. Memon, A.M., Xie, Q.: Studying the fault-detection effectiveness of GUI test cases for rapidly evolving software. IEEE Trans. Softw. Eng. 31(10), 884–896 (2005)CrossRefGoogle Scholar
  40. Memon, A.M., Soffa, M.L., Pollack, M.E.: Coverage criteria for GUI testing. In: ACM SIGSOFT International Symposium on the Foundations of Software Engineering, pp. 256–267 (2001)CrossRefGoogle Scholar
  41. Memon, A.M., Banerjee, I., Nagarajan, A: GUI ripping: Reverse engineering of graphical user interfaces for testing. In: Working Conference on Reverse Engineering, pp. 260–269 (2003)Google Scholar
  42. Min, C., Lee, Y., Yoo, C., Kang, S., Choi, S., Park, P., Hwang, I., Ju, Y., Choi, S., Song, J.: PowerForecaster: Predicting smartphone power impact of continuous sensing applications at pre-installation time. In: ACM Conference on Embedded Networked Sensor Systems, pp. 31–44 (2015)Google Scholar
  43. Octeau, D., McDaniel, P., Jha, S., Bartel, A., Bodden, E., Klein, J., le Traon, Y.: Effective inter-component communication mapping in Android with Epicc. In: USENIX Security Symposium (2013)Google Scholar
  44. Octeau, D., Luchaup, D., Dering, M., Jha, S., McDaniel, P.: Composite constant propagation: Application to Android inter-component communication analysis. In: International Conference on Software Engineering, pp. 77–88 (2015)Google Scholar
  45. Oliner, A.J., Iyer, A.P., Stoica, I., Lagerspetz, E., Tarkoma, S.: Carat: Collaborative energy diagnosis for mobile devices. In: ACM Conference on Embedded Networked Sensor Systems, pp 10:1–10:14 (2013)Google Scholar
  46. Pathak, A., Jindal, A., Hu, Y.C., Midkiff, S.P.: What is keeping my phone awake? In: International Conference on Mobile Systems, Applications, and Services, pp. 267–280 (2012)Google Scholar
  47. Payet, E., Spoto, F.: Static analysis of Android programs. Inf. Softw. Technol. 54(11), 1192–1201 (2012)CrossRefGoogle Scholar
  48. Payet, E., Spoto, F.: An operational semantics for Android activities. In: ACM SIGPLAN Workshop on Partial Evaluation and Program Manipulation, pp. 121–132 (2014)Google Scholar
  49. Robotium: Robotium testing framework for Android (2016). code.google.com/p/robotium
  50. Rountev, A., Yan, D.: Static reference analysis for GUI objects in Android software. In: International Symposium on Code Generation and Optimization, pp. 143–153 (2014)Google Scholar
  51. SCanDroid: SCanDroid: Security Certifier for anDroid (2015). spruce.cs.ucr.edu/SCanDroid/tutorial.html. Accessed 2015
  52. Sharir, M., Pnueli, A.: Two approaches to interprocedural data flow analysis. In: Muchnick, S., Jones, N. (eds.) Program Flow Analysis: Theory and Applications, pp. 189–234. Prentice Hall, New York (1981)Google Scholar
  53. Song, W., Qian, X., Huang, J.: Ehbdroid: beyond GUI testing for android applications. In: International Conference on Automated Software Engineering, pp. 27–37 (2017)Google Scholar
  54. Soot: Soot Analysis Framework. http://www.sable.mcgill.ca/soot (2018). Accessed Nov 2017
  55. Takala, T., Katara, M., Harty, J.: Experiences of system-level model-based GUI testing of an Android application. In: IEEE International Conference on Software Testing, Verification, and Validation, pp. 377–386 (2011)Google Scholar
  56. Tramontana, P.: Android GUI Ripper(2013). wpage.unina.it/ptramont/GUIRipperWiki.htm
  57. Tsutano, Y., Bachala, S., Srisa-an, W., Rothermel, G., Dinh, J.: An efficient, robust, and scalable approach for analyzing interacting android apps. In: International Conference on Software Engineering, pp. 324–334 (2017)Google Scholar
  58. Wang, P., Liang, B., You, W., Li, J., Shi, W.: Automatic Android GUI traversal with high coverage. In: Communication Systems and Network Technologies, pp. 1161–1166 (2014)Google Scholar
  59. Wang, Y., Rountev, A.: Profiling the responsiveness of Android applications via automated resource amplification. In: IEEE/ACM International Conference on Mobile Software Engineering and Systems, pp. 48–58 (2016)Google Scholar
  60. Wang, Y., Zhang, H., Rountev, A.: On the unsoundness of static analysis for Android GUIs. In: ACM SIGPLAN International Workshop on the State Of the Art in Program Analysis, pp. 18–23 (2016)Google Scholar
  61. Wei, F., Roy, S., Ou, X., et al.: Amandroid: A precise and general inter-component data flow analysis framework for security vetting of android apps. In: ACM Conference on Computer and Communications Security, pp. 1329–1341 (2014)Google Scholar
  62. White, L., Almezen, H.: Generating test cases for GUI responsibilities using complete interaction sequences. In: IEEE International Symposium on Software Reliability Engineering, pp. 110–121 (2000)Google Scholar
  63. Wontae, C., George, N., Koushik, S.: Guided GUI testing of Android apps with minimal restart and approximate learning. In: ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages, and Applications, pp. 623–640 (2013)Google Scholar
  64. Wu, H., Yang, S., Rountev, A.: Static detection of energy defect patterns in Android applications. In: International Conference on Compiler Construction, pp. 185–195 (2016)Google Scholar
  65. Wu, H., Wang, Y., Rountev, A.: Sentinel: generating GUI tests for Android sensor leaks. In: IEEE/ACM International Workshop on Automation of Software Test (2018)Google Scholar
  66. Xie, Q., Memon, A.M.: Using a pilot study to derive a GUI model for automated testing. ACM Trans. Softw. Eng. Methodol. 18(2), 7:1–7:35 (2008)CrossRefGoogle Scholar
  67. Xiong, B., Xiang, G., Du, T., He, J.S., Ji, S.: Static taint analysis method for intent injection vulnerability in android applications. In: International Symposium on Cyberspace Safety and Security, pp 16–31 (2017)CrossRefGoogle Scholar
  68. Yan, D.: Program analyses for understanding the behavior and performance of traditional and mobile object-oriented software. Ph.D. thesis, Ohio State University (2014)Google Scholar
  69. Yan, D., Yang, S., Rountev, A.: Systematic testing for resource leaks in Android applications. In: IEEE International Symposium on Software Reliability Engineering, pp. 411–420 (2013)Google Scholar
  70. Yang, S.: Static analyses of GUI behavior in Android applications. Ph.D. thesis, Ohio State University (2015)Google Scholar
  71. Yang, S., Yan, D., Rountev, A.: Testing for poor responsiveness in Android applications. In: Workshop on Engineering Mobile-Enabled Systems, pp. 1–6 (2013a)Google Scholar
  72. Yang, S., Yan, D., Wu, H., Wang, Y., Rountev, A.: Static control-flow analysis of user-driven callbacks in Android applications. In: International Conference on Software Engineering, pp. 89–99 (2015a)Google Scholar
  73. Yang, S., Zhang, H., Wu, H., Wang, Y., Yan, D., Rountev, A.: Static window transition graphs for Android. In: IEEE/ACM International Conference on Automated Software Engineering, pp. 658–668 (2015b)Google Scholar
  74. Yang, W., Prasad, M., Xie, T.: A grey-box approach for automated GUI-model generation of mobile applications. In: International Conference on Fundamental Approaches to Software Engineering, pp. 250–265 (2013b)CrossRefGoogle Scholar
  75. Yuan, X., Memon, A.M.: Generating event sequence-based test cases using GUI run-time state feedback. IEEE Trans. Softw. Eng. 36(1), 81–95 (2010)CrossRefGoogle Scholar
  76. Yuan, X., Cohen, M.B., Memon, A.M.: GUI interaction testing: incorporating event context. IEEE Trans. Softw. Eng. 37(4), 559–574 (2011)CrossRefGoogle Scholar
  77. Zhang, H., Wu, H., Rountev, A.: Automated test generation for detection of leaks in Android applications. In: IEEE/ACM International Workshop on Automation of Software Test, pp. 64–70 (2016)Google Scholar
  78. Zhang, P., Elbaum, S.: Amplifying tests to validate exception handling code. In: International Conference on Software Engineering, pp. 595–605 (2012)Google Scholar
  79. Zhang, S., Lü, H., Ernst, M.D.: Finding errors in multithreaded GUI applications. In: ACM SIGSOFT International Symposium on Software Testing and Analysis, pp. 243–253 (2012)Google Scholar
  80. Zheng, C., Zhu, S., Dai, S., Gu, G., Gong, X., Han, X., Zou, W.: SmartDroid: An automatic system for revealing UI-based trigger conditions in Android applications. In: ACM Workshop on Security and Privacy in Smartphones and Mobile Devices, pp. 93–104 (2012)Google Scholar

Copyright information

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

Authors and Affiliations

  1. 1.Google Inc.Mountain ViewUSA
  2. 2.Ohio State UniversityColumbusUSA

Personalised recommendations