Bad Smells and Refactoring Methods for GUI Test Scripts

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.

[1]  Atif M. Memon,et al.  Automatically repairing event sequence-based GUI test suites for regression testing , 2008, TSEM.

[2]  Woei-Kae Chen,et al.  Integration of specification-based and CR-based approaches for GUI testing , 2005, 19th International Conference on Advanced Information Networking and Applications (AINA'05) Volume 1 (AINA papers).

[3]  Atif M. Memon,et al.  An event‐flow model of GUI‐based applications for testing , 2007, Softw. Test. Verification Reliab..

[4]  Woei-Kae Chen,et al.  GUI Test Script Organization with Component Abstraction , 2008, 2008 Second International Conference on Secure System Integration and Reliability Improvement.

[5]  Eduardo Martins Guerra,et al.  Refactoring Test Code Safely , 2007, International Conference on Software Engineering Advances (ICSEA 2007).

[6]  Chien-Hung Liu,et al.  A test case refactoring approach for pattern-based software development , 2011, Software Quality Journal.

[7]  Tom Mens,et al.  A survey of software refactoring , 2004, IEEE Transactions on Software Engineering.

[8]  Mary Lou Soffa,et al.  Hierarchical GUI Test Case Generation Using Automated Planning , 2001, IEEE Trans. Software Eng..

[9]  Woei-Kae Chen,et al.  GUI test-case generation with macro-event contracts , 2010, The 2nd International Conference on Software Engineering and Data Mining.