Automated Java GUI Modeling for Model-Based Testing Purposes Pekka Aho 1 , Nadja Menz 2 , Tomi Räty 1 and Ina Schieferdecker 2 1 VTT Technical Research Centre of Finland 2 Fraunhofer FOKUS Abstract Advanced methods and tools for GUI software development allow a rapid and iterative process of prototyping and usability testing. Unfortunately, even with the support of test automation tools, testing of GUI software requires a lot of manual work, especially when the application under test is changing rapidly. In this paper we present an improved method and tool support for automated test modeling of Java GUI applications for model-based testing (MBT) purposes. The implemented GUI Driver tool generates structural models combined with a GUI state model presenting the behavior of the GUI application that is executed and observed automatically. The GUI Driver tool is combined with an open source MBT tool to form a tool chain to support automated testing of Java GUI applications. The models generated by the GUI Driver are used to generate test sequences with MBT tool, and the test sequences are then executed with the GUI Driver to generate a test report. Keywords: automatic model generation, GUI state model, GUI testing, model-based testing, tool chain 1. Introduction Graphical User Interface (GUI) software is often large and complex, and the correctness of GUI’s code is essential to the correct execution of the overall software [1]. Although advanced development methods and tools have helped to reduce the time to build software products, the time and effort required to test the products has not been significantly reduced [2]. Virtually all GUI applications today are built using toolkits and interface builders enabling a rapid and iterative process of prototyping and usability testing, crucial for achieving high-quality user interfaces [3]. Due to the iterative development process, the requirements, design and implementation of GUI software change often, increasing the time and resources required for testing. One approach trying to improve the efficiency of software testing is model-based testing (MBT). The general idea of MBT is to create an abstract test model describing the expected behavior of the system under test (SUT), and to use some kind of tool to generate tests from this model [4]. The goal in MBT is to increase the efficiency and quality of software testing by automating the testing process, which allows decreasing the testing effort and avoiding manual error prone activities [5]. Ideally, a test model could be obtained from a design model through sophisticated model transformations. However, such tools are not available today and the approach would also rely on the availability of the design model. Currently, the models for automated testing need to be manually crafted from the specifications of the SUT, using some visual modeling tool [6]. Due to the iterative process of GUI development, manually designing and maintaining the models for MBT purposes requires too much effort, negating the increased efficiency gained from using test automation. Instead, the models should be generated automatically from the source code or by executing and observing the GUI application. The currently available solutions for automated GUI testing are not optimal and there is an obvious need for more efficient approaches. The starting point for our work was the GUITAR tool [7], which was the most advanced open source or otherwise free tool available for automatically creating models for MBT, based on the execution and reverse engineering of an existing Java GUI application. It supports creating structural models, and generating and executing test cases for Java GUI applications. However, while using the GUITAR tool, we encountered major problems in generating models of complicated Java GUI applications. Therefore we took a slightly different approach for automated GUI test modeling and implemented GUI Driver tool to support our approach. This paper presents our approach for automatically modeling a Java GUI application and its behavior for MBT purposes, the GUI Driver tool that we 2011 Eighth International Conference on Information Technology: New Generations 978-0-7695-4367-3/11 $26.00 © 2011 IEEE DOI 10.1109/ITNG.2011.54 268