skip to main content
research-article

Guided GUI testing of android apps with minimal restart and approximate learning

Published:29 October 2013Publication History
Skip Abstract Section

Abstract

Smartphones and tablets with rich graphical user interfaces (GUI) are becoming increasingly popular. Hundreds of thousands of specialized applications, called apps, are available for such mobile platforms. Manual testing is the most popular technique for testing graphical user interfaces of such apps. Manual testing is often tedious and error-prone. In this paper, we propose an automated technique, called Swift-Hand, for generating sequences of test inputs for Android apps. The technique uses machine learning to learn a model of the app during testing, uses the learned model to generate user inputs that visit unexplored states of the app, and uses the execution of the app on the generated inputs to refine the model. A key feature of the testing algorithm is that it avoids restarting the app, which is a significantly more expensive operation than executing the app on a sequence of inputs. An important insight behind our testing algorithm is that we do not need to learn a precise model of an app, which is often computationally intensive, if our goal is to simply guide test execution into unexplored parts of the state space. We have implemented our testing algorithm in a publicly available tool for Android apps written in Java. Our experimental results show that we can achieve significantly better coverage than traditional random testing and L*-based testing in a given time budget. Our algorithm also reaches peak coverage faster than both random and L*-based testing.

References

  1. Managing the Activity Lifecycle. http://developer.android.com/training/basics/activity-lifecycle/index.html.Google ScholarGoogle Scholar
  2. MonkeyRunner. http://developer.android.com/tools/help/monkeyrunner_concepts.html.Google ScholarGoogle Scholar
  3. UI/Application Exerciser Monkey. http://developer.android.com/tools/help/monkey.html.Google ScholarGoogle Scholar
  4. axml, read and write Android binary xml files. http://code.google.com/p/axml/, 2012.Google ScholarGoogle Scholar
  5. R. Alur, P. Cerny, P. Madhusudan, and W. Nam. Synthesis of interface specifications for java classes. In POPL, pages 98--109, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. D. Amalfitano, A. R. Fasolino, P. Tramontana, S. D. Carmine, and A. M. Memon. Using GUI ripping for automated testing of Android applications. In ASE, pages 258--261, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. S. Anand, M. Naik, M. J. Harrold, and H. Yang. Automated concolic testing of smartphone apps. In SIGSOFT FSE, page 59, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. A. A. Andrews, J. Offutt, and R. T. Alexander. Testing web applications by modeling with FSMs. Software and System Modeling, 4(3):326--345, 2005.Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. D. Angluin. Inference of reversible languages. J. ACM, 29(3):741--765, July 1982. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. D. Angluin. Learning regular sets from queries and counterex-amples. Inf. Comput., 75(2):87--106, 1987. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. F. Belli. Finite-state testing and analysis of graphical user interfaces. In 12th International Symposium on Software Reliability Engineering (ISSRE'01), page 34. IEEE Computer Society, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. T. Berg, O. Grinchtein, B. Jonsson, M. Leucker, H. Raffelt, and B. Steffen. On the correspondence between conformance testing and regular inference. In FASE, pages 175--189, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. J. M. Cobleigh, D. Giannakopoulou, and C. S. Pasareanu. Learning assumptions for compositional verification. In TACAS, pages 331--346, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. F. Coste, D. Fredouille, C. Kermorvant, and C. de la Higuera. Introducing domain and typing bias in automata inference. In ICGI, pages 115--126, 2004.Google ScholarGoogle Scholar
  15. J. N. Departarnento and P. Garcia. Identifying regular languages in polynomial. In Advances in Structural and Syntactic Pattern Recognition, volume 5 of Series in Machine Perception and Artificial Intelligence, pages 99--108. World Scientific, 1992.Google ScholarGoogle Scholar
  16. P. Godefroid, N. Klarlund, and K. Sen. DART: directed automated random testing. In PLDI, pages 213--223, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. A. Groce, D. Peled, and M. Yannakakis. AMC: An adaptive model checker. In CAV, pages 521--525, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. A. Groce, D. Peled, and M. Yannakakis. Adaptive model checking. Logic Journal of the IGPL, 14(5):729--744, 2006.Google ScholarGoogle ScholarCross RefCross Ref
  19. R. Groz, M.-N. Irfan, and C. Oriat. Algorithmic improvements on regular inference of software models and perspectives for security testing. In ISoLA (1), pages 444--457, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. C. Hu and I. Neamtiu. A GUI bug finding framework for Android applications. In SAC, pages 1490--1491, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. B. Lambeau, C. Damas, and P. Dupont. State-merging DFA induction algorithms with mandatory merge constraints. In ICGI, pages 139--153, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. K. Lang, B. Pearlmutter, and R. Price. Results of the Abbadingo One DFA learning competition and a new evidence-driven state merging algorithm, 1998.Google ScholarGoogle ScholarCross RefCross Ref
  23. K. J. Lang. Random DFA's can be approximately learned from sparse uniform examples. In COLT, pages 45--52, 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. X. Leroy. Java bytecode verification: algorithms and formalizations. Journal of Automated Reasoning, 30(3--4):235--269, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. A. MacHiry, R. Tahiliani, and M. Naik. Dynodroid: An input generation system for Android apps. In SIGSOFT FSE, pages 224--235, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. K. Meinke and M. A. Sindhu. Incremental learning-based testing for reactive systems. In TAP, pages 134--151, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. K. Meinke and N. Walkinshaw. Model-based testing and model inference. In ISoLA (1), pages 440--443, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. A. M. Memon. An event-flow model of GUI-based applications for testing. Softw. Test., Verif. Reliab., 17(3):137--157, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. A. Mesbah, A. van Deursen, and S. Lenselink. Crawling Ajax-based web applications through dynamic analysis of user interface state changes. TWEB, 6(1):3, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. N. Mirzaei, S. Malek, C. S. Pasareanu, N. Esfahani, and R. Mahmood. Testing Android apps through symbolic execution. ACM SIGSOFT Software Engineering Notes, 37(6):1--5, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. J. Nevo and P. Crégut. ASMDEX. http://asm.ow2.org/asmdex-index.html, 2012.Google ScholarGoogle Scholar
  32. W. M. Newman. A system for interactive graphical programming. In Proc. of the spring joint computer conference (AFIPS'68 (Spring)), pages 47--54. ACM, 1968. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. C. D. Nguyen, A. Marchetto, and P. Tonella. Combining model-based and combinatorial testing for effective test case generation. In ISSTA, pages 100--110, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. D. Peled, M. Y. Vardi, and M. Yannakakis. Black box checking. In FORTE, pages 225--240, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. H. Raffelt, B. Steffen, and T. Margaria. Dynamic testing via automata learning. In Haifa Verification Conference, pages 136--152, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. V. Rastogi, Y. Chen, and W. Enck. Appsplayground: automatic security analysis of smartphone applications. In CODASPY, pages 209--220, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. H. Reza, S. Endapally, and E. Grant. A model-based approach for testing GUI using hierarchical predicate transition nets. In International Conference on Information Technology (ITNG'07), pages 366--370. IEEE Computer Society, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. R. L. Rivest and R. E. Schapire. Inference of finite automata using homing sequences (extended abstract). In STOC, pages 411--420, 1989. Google ScholarGoogle ScholarDigital LibraryDigital Library
  39. R. K. Shehady and D. P. Siewiorek. A methodology to automate user interface testing using variable finite state machines. In FTCS, pages 80--88, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. T. Takala, M. Katara, and J. Harty. Experiences of system- level model-based GUI testing of an Android application. In ICST, pages 377--386, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. N. Walkinshaw, K. Bogdanov, J. Derrick, and J. Paris. Increasing functional coverage by inductive testing: A case study. In ICTSS, pages 126--141, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  42. N. Walkinshaw, J. Derrick, and Q. Guo. Iterative refinement of reverse-engineered models by model-based testing. In FM, pages 305--320, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  43. L. White and H. Almezen. Generating test cases for GUI responsibilities using complete interaction sequences. In 11th International Symposium on Software Reliability Engineering (ISSRE'00), page 110. IEEE Computer Society, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  44. T. Xie and D. Notkin. Mutually enhancing test generation and specification inference. In FATES, pages 60--69, 2003.Google ScholarGoogle Scholar
  45. W. Yang, M. R. Prasad, and T. Xie. A grey-box approach for automated GUI-model generation of mobile applications. In FASE, pages 250--265, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  46. X. Yuan, M. Cohen, and A. M. Memon. Covering array sampling of input event sequences for automated GUI testing. In ASE '07: Proceedings of the twenty-second IEEE/ACM international conference on Automated software engineering, pages 405--408, New York, NY, USA, 2007. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  47. X. Yuan and A. M. Memon. Iterative execution-feedback model-directed GUI testing. Information & Software Technology, 52(5):559--575, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Guided GUI testing of android apps with minimal restart and approximate learning

    Recommendations

    Comments

    Login options

    Check if you have access through your login credentials or your institution to get full access on this article.

    Sign in

    Full Access

    • Published in

      cover image ACM SIGPLAN Notices
      ACM SIGPLAN Notices  Volume 48, Issue 10
      OOPSLA '13
      October 2013
      867 pages
      ISSN:0362-1340
      EISSN:1558-1160
      DOI:10.1145/2544173
      Issue’s Table of Contents
      • cover image ACM Conferences
        OOPSLA '13: Proceedings of the 2013 ACM SIGPLAN international conference on Object oriented programming systems languages & applications
        October 2013
        904 pages
        ISBN:9781450323741
        DOI:10.1145/2509136

      Copyright © 2013 ACM

      Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 29 October 2013

      Check for updates

      Qualifiers

      • research-article

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader