首页> 中文期刊>电子学报 >基于UML模型和OCL约束的类间交互测试用例生成方法研究

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

     

摘要

There are some features in object-oriented software ,such as classes ,encapsulation ,inheritance ,and dynamic con-nections .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 al-gorithm 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 (United Model Lan-guage )设计模型中的顺序图添加OCL (Object Constraints Language )约束,做类间交互的软件测试.本文提出执行图EG生成算法,将顺序图SD转换为执行图EG ,解决UML2.0顺序图新增特性中的alt、loop、opt、break四种常见组合片段及其嵌套和多态性问题;为得到最小完备的测试路径,本文提出了EG的遍历策略和测试路径生成算法;最后,根据测试路径确定测试场景,并删除无效场景,生成测试用例.经实验验证,此方法可以基于UML顺序图与OCL约束进行系统地测试.

著录项

相似文献

  • 中文文献
  • 外文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号