摘要: 统一建模语言(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
中图分类号:
曾一, 刘青香, 王翠钦, 洪豪. 带OCL约束的多态路径测试线索生成方法[J]. 计算机工程, 2013, 39(8): 92-96,102.
CENG Yi, LIU Jing-Xiang, WANG Cui-Qin, HONG Hao. Generation Method of Polymorphic Path Test Scenarios with OCL Constraints[J]. Computer Engineering, 2013, 39(8): 92-96,102.