TEGDroid: Test Case Generation Approach for Android Apps Considering Context and GUI Events

Asmau Usman, Noraini Ibrahim, Ibrahim A Salihu


The advancement in mobile technologies has led to the production of mobile devices (e.g. smartphone) with rich innovative features. This has enabled the development of mobile applications that offer users an advanced and extremely localized context-aware content. The recent dependence of people on mobile applications for various computational needs poses a significant concern on the quality of mobile applications. In order to build a high quality and more reliable applications, there is a need for effective testing techniques to test the applications. Most existing testing technique focuses on GUI events only without sufficient support for context events. This makes it difficult to identify other defects in the changes that can be inclined by context in which an application runs. This paper presents an approach named TEGDroid for generating test case for Android Apps considering both context and GUI Events. The GUI and context events are identified through the static analysis of bytecode, and the analysis of app’s permission from the XML file. An experiment was performed on real world mobile apps to evaluate TEGDroid. Our experimental results show that TEGDroid is effective in identifying context events and had 65%-91% coverage across the eight selected applications. To evaluate the fault detection capability of this approach, mutation testing was performed by introducing mutants to the applications. Results from the mutation analysis shows that 100% of the mutants were killed. This indicates that TEGDroid have the capability to detect faults in mobile apps.


context event; GUI event; mobile application test case generation; software testing.

Full Text:



H. Muccini, A. Di Francesco, and P. Esposito, "Software testing of mobile applications: Challenges and future research directions," in 7th International Workshop on Automation of Software Test (AST), 2012, pp. 29-35.

T. Tamilarasi and M. Prasanna, "Research and Development on Software Testing Techniques and Tools," in Encyclopedia of Information Science and Technology, Fourth Edition, ed: IGI Global, 2018, pp. 7503-7513.

I.-A. Salihu, R. Ibrahim, B. S. Ahmed, K. Z. Zamli, and A. Usman, "AMOGA: A Static-Dynamic Model Generation Strategy for Mobile Apps Testing," IEEE Access, vol. 7, pp. 17158-17173, 2019.

I. Qasim, F. Azam, M. W. Anwar, H. Tufail, and T. Qasim, "Mobile User Interface Development Techniques: A Systematic Literature Review," in IEEE 9th Annual Information Technology, Electronics and Mobile Communication Conference (IEMCON), 2018, pp. 1029-1034.

D. Amalfitano, A. R. Fasolino, and P. Tramontana, "A gui crawling-based technique for android mobile application testing," in Fourth International Conference on Software Testing, Verification and Validation Workshops (ICSTW), IEEE, 2011, pp. 252-261.

B. N. Nguyen, B. Robbins, I. Banerjee, and A. Memon, "GUITAR: an innovative tool for automated testing of GUI-driven software," Automated Software Engineering, vol. 21, pp. 65-105, 2014.

Z. Liu, X. Gao, and X. Long, "Adaptive random testing of mobile application," in 2nd International Conference on Computer Engineering and Technology (ICCET), 2010, pp. V2-297-V2-301.

I. C. Morgado, A. C. Paiva, and J. P. Faria, "Automated pattern-based testing of mobile applications," in 9th International Conference on the Quality of Information and Communications Technology (QUATIC), 2014, pp. 294-299.

I. A. Salihu and R. Ibrahim, "Comparative Analysis of GUI Reverse Engineering Techniques," in Advanced Computer and Communication Engineering Technology, ed: Springer, 2016, pp. 295-305.

S. Anand, E. K. Burke, T. Y. Chen, J. Clark, M. B. Cohen, W. Grieskamp, et al., "An orchestrated survey of methodologies for automated software test case generation," Journal of Systems and Software, vol. 86, pp. 1978-2001, 2013.

P. Aho, M. Suarez, A. Memon, and T. Kanstrén, "Making GUI Testing Practical: Bridging the Gaps," in 12th International Conference on Information Technology-New Generations (ITNG), 2015, pp. 439-444.

D. Amalfitano, N. Amatucci, P. Tramontana, A. R. Fasolino, and A. M. Memon, "A General Framework for comparing Automatic Testing Techniques of Android Mobile Apps," Journal of Systems and Software, 2016.

P. Kong, L. Li, J. Gao, K. Liu, T. F. Bissyandé, and J. Klein, "Automated testing of android apps: A systematic literature review," IEEE Transactions on Reliability, vol. 68, pp. 45-66, 2018.

I. A. Salihu and R. Ibrahim, "Systematic Exploration of Android Apps' Events for Automated Testing," in Proceedings of the 14th International Conference on Advances in Mobile Computing and Multi Media, 2016, pp. 50-54.

N. Mirzaei, J. Garcia, H. Bagheri, A. Sadeghi, and S. Malek, "Reducing combinatorics in GUI testing of android applications," in Proceedings of the 38th International Conference on Software Engineering, 2016, pp. 559-570.

K. Song, A.-R. Han, S. Jeong, and S. D. Cha, "Generating various contexts from permissions for testing Android applications," in SEKE, 2015, pp. 87-92.

A. Méndez-Porras, C. Quesada-López, and M. Jenkins, "Automated testing of mobile applications: a systematic map and review," in XVIII Ibero-American Conference on Software Engineering, Lima-Peru, 2015, pp. 195-208.

D. Amalfitano, A. R. Fasolino, P. Tramontana, and N. Amatucci, "Considering context events in event-based testing of mobile applications," in IEEE Sixth International Conference on Software Testing, Verification and Validation Workshops (ICSTW), 2013, pp. 126-133.

W. Song, X. Qian, and J. Huang, "Ehbdroid: beyond GUI testing for android applications," in Proceedings of the 32nd IEEE/ACM International Conference on Automated Software Engineering, 2017, pp. 27-37.

A. Machiry, R. Tahiliani, and M. Naik, "Dynodroid: An input generation system for android apps," in Proceedings of the 9th Joint Meeting on Foundations of Software Engineering, 2013, pp. 224-234.

T. Y. Chen, F.-C. Kuo, R. G. Merkel, and T. Tse, "Adaptive random testing: The art of test case diversity," Journal of Systems and Software, vol. 83, pp. 60-66, 2010.

T. Griebe and V. Gruhn, "A model-based approach to test automation for context-aware mobile applications," in Proceedings of the 29th Annual ACM Symposium on Applied Computing, 2014, pp. 420-427.

T. A. Majchrzak and M. Schulte, "Context-dependent testing of applications for mobile devices," Open Journal of Web Technologies (OJWT), vol. 2, pp. 27-39, 2015.

S. Yu and S. Takada, "Mobile application test case generation focusing on external events," in Proceedings of the 1st International Workshop on Mobile Development, 2016, pp. 41-42.

A. Bartel, J. Klein, Y. Le Traon, and M. Monperrus, "Dexpler: converting android dalvik bytecode to jimple for static analysis with soot," in Proceedings of the ACM SIGPLAN International Workshop on State of the Art in Java Program analysis, 2012, pp. 27-38.

B. Wichmann, A. Canning, D. Clutterbuck, L. Winsborrow, N. Ward, and D. Marsh, "Industrial perspective on static analysis," Software Engineering Journal, vol. 10, pp. 69-75, 1995.

S. Yang, H. Wu, H. Zhang, Y. Wang, C. Swaminathan, D. Yan, et al., "Static window transition graphs for Android," Automated Software Engineering, vol. 25, pp. 833-873, 2018.

W. Yang, M. R. Prasad, and T. Xie, "A grey-box approach for automated GUI-model generation of mobile applications," in International Conference on Fundamental Approaches to Software Engineering, 2013, pp. 250-265.

I. A. Salihu, R. Ibrahim, and A. Mustapha, "A Hybrid Approach for Reverse Engineering GUI Model from Android Apps for Automated Testing," Journal of Telecommunication, Electronic and Computer Engineering (JTEC), vol. 9, pp. 45-49, 2017.

"GATOR: Program Analysis Toolkit For Android."

S. Mujahid, R. Abdalkareem, and E. Shihab, "Studying permission related issues in android wearable apps," in 2018 IEEE International Conference on Software Maintenance and Evolution (ICSME), 2018, pp. 345-356.

A. Usman, N. Ibrahim, and I. A. Salihu, "Test Case Generation from Android Mobile Applications Focusing on Context Events," in Proceedings of the 2018 7th International Conference on Software and Computer Applications, 2018, pp. 25-30.

J. Levinson, Software Testing with Visual Studio 2010: Pearson Education, 2011.

F. Horváth, T. Gergely, Ã. Beszédes, D. Tengeri, G. Balogh, and T. Gyimóthy, "Code coverage differences of Java bytecode and source code instrumentation tools," Software Quality Journal, vol. 27, pp. 79-123, 2019.

Emma, An open source Java code coverage tool [Online]. Available: http://emma.sourceforge.net/.

G. Gay, M. Staats, M. Whalen, and M. P. Heimdahl, "The risks of coverage-directed test case generation," IEEE Transactions on Software Engineering, vol. 41, pp. 803-819, 2015.

L. Inozemtseva and R. Holmes, "Coverage is not strongly correlated with test suite effectiveness," in Proceedings of the 36th International Conference on Software Engineering, 2014, pp. 435-445.

R. Gopinath, C. Jensen, and A. Groce, "Code coverage for suite evaluation by developers," in Proceedings of the 36th International Conference on Software Engineering, 2014, pp. 72-82.

M. Papadakis, M. Kintis, J. Zhang, Y. Jia, Y. Le Traon, and M. Harman, "Mutation testing advances: an analysis and survey," in Advances in Computers. vol. 112, ed: Elsevier, 2019, pp. 275-378.

Y. Wei, "MuDroid: Mutation Testing for Android Apps," 2016.

Y. Jia and M. Harman, "An analysis and survey of the development of mutation testing," IEEE transactions on software engineering, vol. 37, pp. 649-678, 2011.

C. Iida and S. Takada, "Reducing mutants with mutant killable precondition," in 2017 IEEE International Conference on Software Testing, Verification and Validation Workshops (ICSTW), 2017, pp. 128-133.

DOI: http://dx.doi.org/10.18517/ijaseit.10.1.10194


  • There are currently no refbacks.

Published by INSIGHT - Indonesian Society for Knowledge and Human Development