作者投稿和查稿 主编审稿 专家审稿 编委审稿 远程编辑

计算机工程 ›› 2013, Vol. 39 ›› Issue (8): 92-96,102. doi: 10.3969/j.issn.1000-3428.2013.08.019

• 体系结构与软件技术 • 上一篇    下一篇

带OCL约束的多态路径测试线索生成方法

曾 一,刘青香,王翠钦,洪 豪   

  1. (重庆大学计算机学院,重庆 400030)
  • 收稿日期:2012-03-22 出版日期:2013-08-15 发布日期:2013-08-13
  • 作者简介:曾 一(1961-),男,教授,主研方向:软件测试,面向对象技术;刘青香、王翠钦、洪 豪,硕士

Generation Method of Polymorphic Path Test Scenarios with OCL Constraints

ZENG Yi, LIU Qing-xiang, WANG Cui-qin, HONG Hao   

  1. (College of Computer Science, Chongqing University, Chongqing 400030, China)
  • Received:2012-03-22 Online:2013-08-15 Published:2013-08-13

摘要: 统一建模语言(UML)无法精确描述系统模型,只能从某一层面描述系统信息,从而导致基于UML模型的多态测试不完备。为此,提出一种带OCL约束的多态路径测试线索生成方法。通过在类图中加入OCL约束信息,考虑类图中多态性对测试的影响,结合UML类图、状态图及协作图,设计并构造OCL约束下包含多态和状态信息的消息间受限控制流图(MRCFG),应用唯一MRCFG路径覆盖准则生成测试线索。通过建立原型工具自动生成包含多态信息的测试线索,从而证明该方法提高了测试的自动化程度,并且生成的多态测试线索更完备。

关键词: 统一建模语言, 对象约束语言, 多态性, 协作图, 消息间受限控制流图, 测试线索

Abstract: As the Unified Modeling Language(UML) can not describe the system model accurately and single model can only describe the system information from one level, it makes the polymorphism test incomplete. Therefore, it puts forward a method of polymorphic path test clues generation with Object Constraint Language(OCL) constraints. By adding OCL constraints into class diagram, taking into account the influence on testing caused by polymorphism of the class diagram and combining with UML class diagram, state diagram, as well as collaboration diagram, it designs the Inter-messages Restricted Control Flow Graph(MRCFG) under the OCL constraint, which includes the information of polymorphism and state. The test clues is generated by employing MRCFG path coverage criteria. The prototyping tool based on the above mentioned theory is realized, and proves this method enhances the degree of testing automation, and generated polymorphic test scenarios is more complete.

Key words: Unified Modeling Language(UML), Object Constraint Language(OCL), polymorphism, collaboration diagram, Inter- messages Restricted Control Flow Graph(MRCFG), test scenarios

中图分类号: