应用科学学报 ›› 2006, Vol. 24 ›› Issue (5): 491-497.

• 论文 • 上一篇    下一篇

基于UML Statecharts面向对象软件的测试框架

占学德1, 缪淮扣2   

  1. 1. 杭州电子科技大学财经学院, 浙江杭州 310018;
    2. 上海大学计算机学院, 上海 200072
  • 收稿日期:2005-06-07 修回日期:2005-10-11 出版日期:2006-09-30 发布日期:2006-09-30
  • 作者简介:占学德,博士,研究方向:软件工程、形式方法、软件测试,E-mail:zhanxuede@163.com;缪淮扣,教授,博导,研究方向:软件工程、形式方法,E-mail:hkmiao@mail.shu.edu.cn
  • 基金资助:
    国家自然科学基金(60373072);国家"863"(2002CB312001)资助项目

Test Framework of Object-Oriented Software Based on UML Statecharts

ZHAN Xue-de1, MIAO Huai-kou2   

  1. 1. Institute of Finance and Economics, Hangzhou Dianzi University, Hangzhou 310018, China;
    2. School of Computer Engineering and Science, Shanghai University, Shanghai 200072, China
  • Received:2005-06-07 Revised:2005-10-11 Online:2006-09-30 Published:2006-09-30

摘要: 直接从含有层次和并发结构的UML statecharts图产生面向对象软件类的测试用例是比较困难的,文中提出了基于UML statecharts图的测试框架:先利用现有的UML工具画出UML statecharts图,并产生XMI(XML metadatainterchange)格式的规格说明文件;然后根据UML statecharts的形式化语义,层次和并发结构被展平,将UML statecharts图的规格说明XML文件转换成FREE(flattened regular expression)模型的规格说明信息;最后根据FREE模型的规格说明信息,按照不同的充分性测试准则,分别产生测试用例集.同时提出了由FREE模型根据全ZOT路径覆盖准则产生有限迁移序列的算法,并且还实现了这个测试框架.

关键词: Z, FREE模型, 基于规格说明的测试, 测试框架, UML statecharts

Abstract: It is difficult to generate test cases of class directly from the UML statechart diagrams that contain a hierarchical and concurrent structure.This paper presents a test framework based on UML statecharts.The UML state chart diagram is first drawn using UML tools.The specification of the UML statechart is exported in XMI (XML metadata interchange).According to the formal semantics of UML statecharts, the UML statecharts are transformed into flattened regular expression (FREE) model diagrams.The hierarchical and concurrent structure of states is flattened in the FREE state model.The XML document of UML statechart diagram specification is converted into the specification of FREE model.Finally, test case sets of classes are generated separately based on different test coverage criteria from the specification of the FREE model.In addition, an algorithm generating transition sequence based on full ZOT path coverage criteria from a FREE model is presented.The test framework is implemented.

Key words: UML statecharts, specification-based software testing, test framework, Z, FREE model

中图分类号: