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

基于UML模型和OCL约束的类间交互测试用例生成方法研究
引用本文:柴玉梅,冯秋燕,王黎明. 基于UML模型和OCL约束的类间交互测试用例生成方法研究[J]. 电子学报, 2013, 41(6): 1242-1248. DOI: 10.3969/j.issn.0372-2112.2013.06.032
作者姓名:柴玉梅  冯秋燕  王黎明
作者单位:1. 郑州大学信息工程学院, 河南 郑州 450001;
2. 河南财经政法大学, 河南 郑州 450000
摘    要: 面向对象所具有的类、封装、继承、动态连接等特性,使得面向对象测试步骤的划分以及测试策略的选择有别于传统的测试思想.本文针对面向对象软件的特点,采用基于模型的软件测试方法,对UML(United Model Language)设计模型中的顺序图添加OCL(Object Constraints Language)约束,做类间交互的软件测试.本文提出执行图EG生成算法,将顺序图SD转换为执行图EG,解决UML2.0顺序图新增特性中的alt、loop、opt、break四种常见组合片段及其嵌套和多态性问题;为得到最小完备的测试路径,本文提出了EG的遍历策略和测试路径生成算法;最后,根据测试路径确定测试场景,并删除无效场景,生成测试用例.经实验验证,此方法可以基于UML顺序图与OCL约束进行系统地测试.

关 键 词:UML  顺序图  OCL  执行图(EG)  测试场景  测试用例
收稿时间:2011-10-01

Research on Methods for Generating Test Cases of Inter-Classes Interaction Based on UML Models and OCL Constraints
CHAI Yu-mei,FENG Qiu-yan,WANG Li-ming. Research on Methods for Generating Test Cases of Inter-Classes Interaction Based on UML Models and OCL Constraints[J]. Acta Electronica Sinica, 2013, 41(6): 1242-1248. DOI: 10.3969/j.issn.0372-2112.2013.06.032
Authors:CHAI Yu-mei  FENG Qiu-yan  WANG Li-ming
Affiliation:1. School of Information Engineering, Zhengzhou University, Zhengzhou, Henan 450001, China;
2. Henan University of Economics and Laws, Zhengzhou, Henan 450000, China
Abstract:There are some features in object-oriented software,such as classes,encapsulation,inheritance,and dynamic connections.They make the division of object-oriented testing procedures and the choice of strategy different from traditional testing ideas.According to the characteristics of object-oriented software,the paper adopts the methods based on models for testing software and adds OCL(Object Constraints Language)constraints for sequence diagram of UML(United Model Language)design model and tests interaction among classes.The paper proposes the algorithm for generating EG(Execution Graph)and transforms SD(Sequence Diagram) to EG,and SD is constrainted by OCL for testing interaction among classes.In this algorithm,the testing problem for four major combined fragments including alt,loop,opt,break in the new features,and their nesting among them and the polymorphism,will be solved in sequence diagram of UML 2.0.In order to get the smallest complete test pathes,strategy for traversing EG and algorithm for generating test paths are presented.Finally,the paper proposes algorithm for determining test scenarios by testing pathes,deleting invalid scenarios by OCL constraints,and generating test cases.Experimental validation shows that our solution can test software based on UML sequence diagram and OCL.
Keywords:UML(United Model Language)  sequence diagram  OCL(Object Constraints Language)  execution graph (EG)  test scenario  test case
点击此处可从《电子学报》浏览原始摘要信息
点击此处可从《电子学报》下载免费的PDF全文
设为首页 | 免责声明 | 关于勤云 | 加入收藏

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