首页 | 本学科首页   官方微博 | 高级检索  
     

针对JavaScript浏览器兼容性的变异测试方法
引用本文:程勇,秦丹,杨光.针对JavaScript浏览器兼容性的变异测试方法[J].计算机应用,2017,37(4):1143-1148.
作者姓名:程勇  秦丹  杨光
作者单位:北京化工大学 信息科学与技术学院, 北京 100029
基金项目:国家自然科学基金资助项目(61672085)。
摘    要:针对JavaScript浏览器兼容性问题缺乏有效的测试方法的问题,基于变异测试技术,对Web应用程序中的JavaScript语言在主流浏览器中的兼容性进行了分析,设计了18个针对浏览器兼容性错误的变异算子并开发了自动化的测试工具Compatibility Mutator。该程序使用抽象语法树(AST)分析JavaScript语法,使用Selenium WebDriver自动调用多个浏览器核心并行执行变异测试。通过对7个广泛使用的JavaScript框架的实验,验证了此方法对每一个框架都能够生成一定数量的变异体,其中对jQuery和YUI框架的变异测试的变异得分分别为43.06%和7.69%,表明了所设计的变异算子能够触发浏览器兼容性方面的错误,并且能够评估测试用例集的完备性。

关 键 词:变异测试  JavaScript  兼容性  变异算子  测试工具  
收稿时间:2016-08-17
修稿时间:2016-09-23

Mutation test method for browser compatibility of JavaScript
CHENG Yong,QIN Dan,YANG Guang.Mutation test method for browser compatibility of JavaScript[J].journal of Computer Applications,2017,37(4):1143-1148.
Authors:CHENG Yong  QIN Dan  YANG Guang
Affiliation:College of Information Science and Technology, Beijing University of Chemical Technology, Beijing 100029, China
Abstract:Since the research on testing technology for JavaScript browser compatibility problems is insufficient, based on mutation testing method and the analysis on the compatibility of JavaScript in Web applications in major browsers, eighteen mutation operators was designed, and an automated testing tool named Compatibility Mutator was implemented. Compatibility Mutator analyze JavaScript syntax with Abstract Syntax Tree (AST), calls various browsers with Selenium WebDriver to run mutation testing automatically and concurrently. The experiments on 7 widely-used JavaScript frameworks showed that the proposed mutation operators could generate a certain amount of mutants, the mutation scores got from mutation testing on jQuery and YUI were 43.06% and 7.69% respectively. Experimental results prove that the proposed operators can trigger the compatibility issues effectively, and evaluate the completeness of test suite effectively in finding the browser compatibility issues.
Keywords:mutation testing                                                                                                                        JavaScript                                                                                                                        compatibility                                                                                                                        mutation operator                                                                                                                        testing tool
点击此处可从《计算机应用》浏览原始摘要信息
点击此处可从《计算机应用》下载全文
设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号