COLOR: Correct Locator Recommender for Broken Test Scripts using Various Clues in Web Application

Test automation tools such as Selenium are commonly used for automating end-to-end tests, but when developers update the software, they often need to modify the test scripts accordingly. However, the costs of modifying these test scripts are a big obstacle to test automation because of the scripts’ fragility. In particular, locators in test scripts are prone to change. Some prior methods tried to repair broken locators by using structural clues, but these approaches usually cannot handle radical changes to page layouts. In this paper, we propose a novel approach called COLOR (correct locator recommender) to support repairing broken locators in accordance with software updates. COLOR uses various properties as clues obtained from screens (i.e., attributes, texts, images, and positions). We examined which properties are reliable for recommending locators by examining changes between two release versions of software, and the reliability is adopted as the weight of a property. Our experimental results obtained from four open source web applications show that COLOR can present the correct locator in first place with a 77% – 93% accuracy and is more robust against page layout changes than structure-based approaches.

[1]  Coen De Roover,et al.  Prevalence and Maintenance of Automated Functional Tests for Web Applications , 2014, 2014 IEEE International Conference on Software Maintenance and Evolution.

[2]  Paolo Tonella,et al.  Capture-replay vs. programmable web testing: An empirical assessment during test case evolution , 2013, 2013 20th Working Conference on Reverse Engineering (WCRE).

[3]  Claire Le Goues,et al.  GenProg: A Generic Method for Automatic Software Repair , 2012, IEEE Transactions on Software Engineering.

[4]  Rob Miller,et al.  Sikuli: using GUI screenshots for search and automation , 2009, UIST '09.

[5]  Myra B. Cohen,et al.  Repairing GUI Test Suites Using a Genetic Algorithm , 2010, 2010 Third International Conference on Software Testing, Verification and Validation.

[6]  Paolo Tonella,et al.  Robula+: an algorithm for generating robust XPath locators for web testing , 2016, J. Softw. Evol. Process..

[7]  Gregg Rothermel,et al.  WATERFALL: an incremental approach for repairing record-replay tests of web applications , 2016, SIGSOFT FSE.

[8]  Hareton K. N. Leung,et al.  Insights into regression testing (software testing) , 1989, Proceedings. Conference on Software Maintenance - 1989.

[9]  Paolo Tonella,et al.  PESTO: A Tool for Migrating DOM-Based to Visual Web Tests , 2014, 2014 IEEE 14th International Working Conference on Source Code Analysis and Manipulation.

[10]  Xiao Li,et al.  ATOM: Automatic Maintenance of GUI Test Scripts for Evolving Mobile Applications , 2017, 2017 IEEE International Conference on Software Testing, Verification and Validation (ICST).

[11]  Martin Monperrus,et al.  Automatic Software Repair , 2018, ACM Comput. Surv..

[12]  Abhik Roychoudhury,et al.  Angelix: Scalable Multiline Program Patch Synthesis via Symbolic Analysis , 2016, 2016 IEEE/ACM 38th International Conference on Software Engineering (ICSE).

[13]  Paolo Tonella,et al.  APOGEN: automatic page object generator for web testing , 2016, Software Quality Journal.

[14]  Chen Fu,et al.  Maintaining and evolving GUI-directed test scripts , 2009, 2009 IEEE 31st International Conference on Software Engineering.

[15]  Dawei Qi,et al.  SemFix: Program repair via semantic analysis , 2013, 2013 35th International Conference on Software Engineering (ICSE).

[16]  Gregg Rothermel,et al.  A safe, efficient regression test selection technique , 1997, TSEM.

[17]  Paolo Tonella,et al.  Using Multi-Locators to Increase the Robustness of Web Test Cases , 2015, 2015 IEEE 8th International Conference on Software Testing, Verification and Validation (ICST).

[18]  Alessandro Orso,et al.  WATER: Web Application TEst Repair , 2011, ETSE '11.

[19]  Gregg Rothermel,et al.  Why do Record/Replay Tests of Web Applications Break? , 2016, 2016 IEEE International Conference on Software Testing, Verification and Validation (ICST).

[20]  Paolo Tonella,et al.  Visual vs. DOM-Based Web Locators: An Empirical Study , 2014, ICWE.

[21]  Fan Long,et al.  Staged program repair with condition synthesis , 2015, ESEC/SIGSOFT FSE.

[22]  Saurabh Sinha,et al.  Robust test automation using contextual clues , 2014, ISSTA 2014.

[23]  Paolo Tonella,et al.  Why Creating Web Page Objects Manually If It Can Be Done Automatically? , 2015, 2015 IEEE/ACM 10th International Workshop on Automation of Software Test.

[24]  Paolo Tonella,et al.  Reducing Web Test Cases Aging by Means of Robust XPath Locators , 2014, 2014 IEEE International Symposium on Software Reliability Engineering Workshops.

[25]  Saurabh Sinha,et al.  Automated Modularization of GUI Test Cases , 2015, 2015 IEEE/ACM 37th IEEE International Conference on Software Engineering.