GUI has been pervasive today and it has been used in safety-critical application where failures of the application can have serious consequences. Unfortunately, GUI testing is expensive and currently many of steps are manual. Currently, most GUI testing techniques focus on capture-and-replay mechanism. Even though it is a powerful technique and has been used testing numerous GUI testing projects, the initially set of test cases must be developed, possibly manually. Furthermore, it is difficult to state the coverage of GUI by using the capture-and-replay mechanism because the coverage is provided with respect to the existing test cases, rather than with respect to other criteria such as navigation.
This paper presents a technique to develop the initial set of GUI test cases. In this approach, test cases can be generated systematically thus ensuring test coverage. This approach divides testing GUI into two parts:
By separating GUI testing into these two parts, the testing effort and complexity can be significantly reduced. This paper will illustrate the saving that can be achieved using this approach. Since widget logic is application dependent, this paper then focuses on screen navigation.
- Screen navigation: this part ensures that each screen will be visited, as well as all the paths that might be used to traversed from one screen to another;
- Widget logic: this part ensures that the software behind a widget will respond correctly when the corresponding widget is selected or activated by the application.
This paper propose a model called SNet (for Screen Net) to model screen navigation. It is a directed graph model with a node represents a screen, and a link between two nodes a navigation path from one screen to another. The conditions, precondition and post-conditions, for traversing from one screen to another are also specified on the link. Each navigation step (NStep) is defined by 5 components: the departure screen, the arrival screen, the navigation event, the precondition and the post-condition. Pre-conditions and post-conditions are specified by the states of the screens, which are further specified by the combination of the values of the GUI widgets inside the screen container.
The proposed model SNet has been automated with friendly user interface. A user can use the tool to interactively input the navigation information, and the tool will check the completeness and consistency of the input. Once the SNet has been specified, the tool can systematically generate all kinds of test cases based on various navigation paths and scenarios based on certain coverage criteria such as path coverage or node coverage. The test cases are written in a high-level description language. An example is shown below:
The tool has been constructed and used to test a variety of GUI applications successfully.
W. T. Tsai is currently Professor of Computer Science and Engineering at Arizona State University. He received his Ph.D. and M.S. in Computer Science from University of California at Berkeley. He has been involved in software engineering research.
Xiaoying Bai is currently a graduate student in the Department of Computer Science and Engineering at Arizona State University. She received her M.S. in Computer Science and Engineering from University of Minnesota, Minneapolis, MN 55455, 1999.
Baisu Huang is currently a Research Associate in the Department of Computer Science and Engineering at Arizona State University. She was Associate Professor at Peking University, Beijing, China. She received her Ph.D. from Northwestern Polytechnical University in China.
George Devaraj is current a graduate student in the Department of Computer Science and Engineering at University of Minnestoa, Minneapolis, MN 55455.
Ray Paul is current the Directorate at DoD OASD Y2K Office. He recently received his Ph.D. in Computer Science and Engineering.