Science  People  Locations  Timeline
Index: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Home > GUI Testing


 

1 Introduction

Before there were graphical user interfaces (GUI’s) to software systems most systems interacted with the user with character based user interfaces (CUI’s). Because of the inherent design of the CUI systems the interaction with the user was very predictable. With CUI’s the system would present a menu (or some similar fixed command interface) to the user or implement some specific command grammar. From there the system would then wait for the user to make a choice. From a testing point of view, it was easy to test the system because the structure of the interface was fixed into a repeatable hierarchy and the number of possible system states was fixed. There was (usually) a one to one relationship between the commands and the system functions so testing the system only required the tester to test all the commands presented.

With most GUI based systems, testing is a much more difficult problem. The main difficulty lies in the fact that the GUI allows almost an infinite number of possible system states. When the user is given a mouse and a screen filled with menus, buttons and dialog boxes, the state of the system changes after each sequence of commands [1]. Studies have shown that the GUI code on average takes up to 50% of the system code [2]. This fact implies that since the GUI itself is a very complex piece of software, testing should be done on it. Simlar to non-GUI software, a suite of test cases are generated and they are run on the system and checked to see if they passed or failed. Both of these tasks have seen many different methods proposed.

2 Test Case Generation

To generate a ‘good’ set of test cases, the test designer must be certain that their suite covers all the functionality of the system and also has to be sure that the suite fully exercises the GUI itself. The difficulty in accomplishing this task is twofold, one has to deal with domain size and then one has to deal with sequences. In addition, the tester faces more difficulty when they have to do regression testing.

The size problem can be easily illustrated. Unlike a CUI system a GUI has many operators that need to be tested. A very small program such as Microsoft WordPad has 325 possible GUI operations [1]. In a large program, the number of operations can easily be an order of magnitude larger.

The second problem is the sequencing problem. Some functionality of the system may only be accomplishable by following some complex sequence of GUI events. For example, to open a file a user may have to click on the File Menu and then select the Open operation and then use a dialog box to specify the file name and then focus the application on the newly opened window. Obviously, increasing the number of possible operations increases the sequencing problem exponentially. This can become a serious issue when the tester is creating test cases manually.

Regression testing also becomes a problem with GUI’s as well. This is because the GUI may change significantly across versions of the application even though the underlying application may not. A test designed to follow a certain path through the GUI may not be able to follow that path since a button, menu item or dialog may not be where it used to be.

These issues have driven the GUI testing problem domain towards automation. Many different techniques have been proposed to automatically generate test suites that are complete and that simulate user behavior.

Most of the techniques attempt to build on previously used CUI techniques. However most have scaling problems when they are applied to GUI’s. For example, Finite State Machine based modeling [3,4] where a system is modeled as a finite state machine and a program is used to generate test cases that exercise all states can work well on a system that has a limited number of states but become overly complex and unwieldy for a GUI.

3 Planning and AI

A novel approach to test suite generation, adapted from a CUI technique [6] involves using a planning system. Planning is a well studied technique from the AI domain that attempts to solve problems that involve 4 parameters: an initial state, a goal state, a set of operators and a set of objects to operate on. Planning systems determine a path from the initial state to the goal state by using the operators. An extremely simple planning problem would be one where you had two words and one operation called ‘change a letter’ that allowed you to change one letter in a word to another letter – the goal of the problem would be to change one word into another.

For GUI testing, the problem is a bit more complex. In [1] the authors used a planner called IPP [5] to demonstrate this technique. The method used is very simple to understand. First, the systems UI is analyzed to determine what operations are possible. These operations become the operators used in the planning problem. Next an initial system state is determined. Next a goal state is determined that the tester feels would allow exercising of the system. Lastly the planning system is used to determine a path from the initial state to the goal state. This path becomes the test plan.

Using a planner to generate the test cases has some specific advantages over manual generation. A planning system by its very nature generates solutions to planning problems in a way that is very beneficial to the tester. First, the plans are always valid. What this means is that the output of the system can be one of two things, a valid and correct plan that uses the operators to attain the goal state or no plan at all. This is beneficial because much time can be wasted when manually creating a test suite due to invalid test cases that the tester thought would work but didn’t. Secondly, a planning system pays attention to order. Often to test a certain function, the test case must be complex and follow a path through the GUI where the operations are performed in a specific order. When done manually, this can lead to errors and also can be quite difficult and time consuming to do. Finally, and most importantly, a planning system is goal oriented. What this means and what makes this fact so important is that the tester is focusing test suite generation on what is most important, testing the functionality of the system. When manually creating a test suite, the tester is more focused on how to test a function (ie. The specific path through the GUI). By using a planning system, the path is taken care of and the tester can focus on what function to test. An additional benefit of this is that a planning system is not restricted in any way when generating the path and may often times find a path that was never anticipated by the tester. This problem is a very important one to combat [7].



Read more »

Non User