ISSN 1000-1239 CN 11-1777/TP

计算机研究与发展 ›› 2017, Vol. 54 ›› Issue (3): 623-632.doi: 10.7544/issn1000-1239.2017.20151051

• 软件技术 • 上一篇    下一篇



  1. 1(中国科学院软件研究所软件工程技术中心 北京 100190); 2(计算机科学技术国家重点实验室(中国科学院软件研究所) 北京 100190); 3(中国科学院大学 北京 100049) (
  • 出版日期: 2017-03-01
  • 基金资助: 

Cross-Browser Issues Detection in JavaScript-Based Web Applications Based on Record/Replay

Wu Guoquan1,2,3, He Meimei1,2,3, Wei Jun1,2,3, Zhong Hua1, Huang Tao1,2   

  1. 1(Technology Center of Software Engineering, Institute of Software, Chinese Academy of Sciences, Beijing 100190); 2(State Key Laboratory of Computer Science (Institute of Software, Chinese Academy of Sciences), Beijing 100190); 3(University of Chinese Academy of Sciences, Beijing 100049)
  • Online: 2017-03-01

摘要: 由于浏览器实现技术的差异以及对标准支持程度的不同,Web应用的跨浏览器不兼容性(cross-browser incompatibilities, XBI)已成为Web应用开发者面临的严重问题.现有的兼容性检测工具仅考虑用户交互事件而忽略了浏览器内部事件,无法保证在不同的浏览器平台上有相同的执行,导致检测结果出现大量误报和漏报.提出了一种基于捕获/重放技术的Web应用跨浏览器兼容性检测方法,在事件捕获阶段记录Web应用在参考浏览器平台运行时产生的各种非确定性事件,并在重放阶段在测试浏览器平台中进行远程重放.通过在重放过程中采集页面信息,保证了检测结果的准确性.为避免重复检测,设计了一种增量式的检测算法提高了检测效率.实验结果表明了所提出方法的有效性.

关键词: 跨浏览器兼容性, Web应用, JavaScript, 捕获/重放, 测试

Abstract: With the advent of Web 2.0 application, and the increasing number of browsers and platforms on which the Web applications can be executed, XBI (cross browser incompatibilities) is becoming a serious problem for organizations to develop Web based software with good user experience. Although some techniques and tools have been proposed to identify XBI, they cannot assure the same execution when Web application is rendered in different platforms as only user interactions events are considered, which may result in generating both false positives and false negatives. To address this limitation, by leveraging existing record/replay technique, this paper develops X-CHECK, a novel cross browser incompatibilities testing approach and tool, which can faithfully reproduce a previous execution and facilitate XBI detection by directly replaying the captured event trace in different platforms. The same execution in different platforms improves the accuracy in detecting XBI. By observing DOM mutations during the replay, X-CHECK also designs an incremental cross-browser detection algorithm, which only detects mutational content of Web page. This algorithm improves the performance in detecting XBI. The empirical evaluation shows that X-CHECK is effective, efficient and improves on the state of the art, and can provide useful support to developers for diagnosis and (eventually) elimination of XBI.

Key words: cross browser compatibility, Web application, JavaScript, record/replay, testing