Testing the GUI (Graphical User Interface) of a software application is typically accomplished by developing a GUI test script composed of sequences of events and assertions. A GUI test script is in a sense similar to the source code of a program, since events and assertions are like source-code statements, which are executed line by line. Therefore, like source code, a GUI test script may have bad smells, and refactoring is an effective technique that can eradicate bad smells, making the script better and easier to maintain. This paper studies the bad smells a GUI test script may have and the refactoring methods that can be applied to remove the bad smells. A total of 11 bad smells are identified and 16 refactoring methods are proposed. The refactoring methods have been implemented in a GUI testing tool, called GTT, to support the automatic refactoring of GUI test scripts.
展开▼