基于UML模型和OCL约束的类间交互测试用例生成方法研究  被引量:5

Research on Methods for Generating Test Cases of Inter-Classes Interaction Based on UML Models and OCL Constraints

在线阅读下载全文

作  者:柴玉梅[1] 冯秋燕[2] 王黎明[1] 

机构地区:[1]郑州大学信息工程学院,河南郑州450001 [2]河南财经政法大学,河南郑州450000

出  处:《电子学报》2013年第6期1242-1248,共7页Acta Electronica Sinica

摘  要:面向对象所具有的类、封装、继承、动态连接等特性,使得面向对象测试步骤的划分以及测试策略的选择有别于传统的测试思想.本文针对面向对象软件的特点,采用基于模型的软件测试方法,对UML(United Model Language)设计模型中的顺序图添加OCL(Object Constraints Language)约束,做类间交互的软件测试.本文提出执行图EG生成算法,将顺序图SD转换为执行图EG,解决UML2.0顺序图新增特性中的alt、loop、opt、break四种常见组合片段及其嵌套和多态性问题;为得到最小完备的测试路径,本文提出了EG的遍历策略和测试路径生成算法;最后,根据测试路径确定测试场景,并删除无效场景,生成测试用例.经实验验证,此方法可以基于UML顺序图与OCL约束进行系统地测试.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, win 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.

关 键 词:UML 顺序图 OCL 执行图(EG) 测试场景 测试用例 

分 类 号:TP311.5[自动化与计算机技术—计算机软件与理论]

 

参考文献:

正在载入数据...

 

二级参考文献:

正在载入数据...

 

耦合文献:

正在载入数据...

 

引证文献:

正在载入数据...

 

二级引证文献:

正在载入数据...

 

同被引文献:

正在载入数据...

 

相关期刊文献:

正在载入数据...

相关的主题
相关的作者对象
相关的机构对象