• 中国计算机学会会刊
  • 中国科技核心期刊
  • 中文核心期刊

计算机工程与科学

• 软件工程 • 上一篇    下一篇

面向测试生成的ASM模型约简研究

杨羊,何柳柳,尚颖,李征   

  1. (北京化工大学信息科学与技术学院,北京 100029)
  • 收稿日期:2016-11-08 修回日期:2017-02-15 出版日期:2018-06-25 发布日期:2018-06-25
  • 基金资助:

    国家自然科学基金(61170082,61472025,61672085);教育部新世纪优秀人才计划项目(NCET120757)

ASM reduction for test generation

YANG Yang,HE Liuliu,SHANG Ying,LI Zheng   

  1. (College of Information Science & Technology,Beijing University of Chemical Technology,Beijing 100029,China)
  • Received:2016-11-08 Revised:2017-02-15 Online:2018-06-25 Published:2018-06-25

摘要:

基于模型的Web应用程序测试是软件测试的一个重要方法。ASM模型从源码解析的角度,基于Web应用程序表示层建立模型,描述了Web应用程序的交互性、动态性和低耦合性。基于ASM模型的测试用例生成,考虑用户的非预期行为,在主要路径的基础上,通过添加无效访问状态和无效迁移路径,扩充测试用例。然而,随着Web应用程序规模的扩大,无效访问状态和无效迁移路径的增加导致测试用例空间爆炸。在研究ASM模型的基础上,通过定义基于ASM模型测试生成的等价迁移和等价状态,合并迁移和状态,从而有效地对ASM模型进行约简,减少了无效访问状态和无效迁移路径的数量,实现测试用例空间约减。
对一个实际Web应用程序系统的评估结果表明,基于模型约简的测试用例优化,有效约减了74.38%的测试用例空间,并且对原子段的覆盖率和错误检测数目没有产生影响。
 
 

关键词: ASM模型, 状态空间爆炸, 模型约简, 测试用例空间约减

Abstract:

Model based web application testing is a crucial approach in software testing. The ASM model is based on the presentation layer of web applications, and presents interactive, dynamic and low coupling features of web applications via source code analysis. The test case generation based on the ASM model, allowing for testing the unexpected behavior of users, is expanded by adding the states of invalid access and the edges of invalid transition to the primary path. However, with the expansion of web applications, the space of test cases is exploded due to the increase of the states of invalid access and the edges of invalid transition. To solve the problem, the ASM model is reduced by merging the equivalent states and equivalent transitions, which are defined for ASMbased test generation through the research on the ASM. In this way, the states of invalid access and the edges of invalid transition are consequently reduced, and thus the test case space is effectively decreased. Experiments on a realworld web application show that the test case space of the ASM model is reduced by 74.38%  without decreasing the coverage of atomic sections and the number of detected errors.

 

Key words: ASM model, state space explosion, model reduction, test case reduction