计算机与现代化 ›› 2011, Vol. 1 ›› Issue (8): 32-38.doi: 10.3969/j.issn.1006-2475.2011.08.010

• 软件工程 • 上一篇    下一篇

基于UML协作图和DFA的测试用例生成方法研究

李青松1,张 晔2   

  1. 1.江西省教育考试院,江西 南昌 330006; 2.南昌航空大学软件学院,江西 南昌 330063
  • 收稿日期:2011-04-06 修回日期:1900-01-01 出版日期:2011-08-10 发布日期:2011-08-10

Study on Approach for Test Case Generation Based on UML Collaboration Diagram and DFA

LI Qing-song1, ZHANG Ye2   

  1. 1. Jiangxi Provincial Education Examination Authority, Nanchang 330006, China;2. School of Software, Nanchang Hangkong University, Nanchang 330063, China
  • Received:2011-04-06 Revised:1900-01-01 Online:2011-08-10 Published:2011-08-10

摘要: UML协作图能够描述对象之间动态的交互关系及对象之间消息传递的过程,根据协作图中的消息流和控制流可以获取有用的场景模型并生成测试用例。本文在研究UML协作图和确定有穷自动机(DFA)之间对应关系的基础上,提出一种将UML协作图转换为DFA,再从DFA中提取测试场景生成测试用例的方法,并将该方法应用于实际项目的测试用例生成。最后,通过对结果进行数据对比和分析,说明该测试用例生成方法的有效性。

关键词: UML协作图, 确定有穷自动机, 测试用例

Abstract: UML collaborative diagram describes objects interaction and the message transferring procedure between objects. So the test scenarios can be generated according to the message flow and control flow in UML collaborative diagram. After analyzing the relationship between UML collaborative diagram and deterministic finite automata(DFA), this paper presents a method of converting an UML collaborative diagram to a DFA model, then generates test scenarios and test cases based on DFA. Finally, this method is applied to test case generation of one real project “manhour quota management system”. Through the data comparison and analysis of the results, the method is proved effective and practical.

Key words: UML collaborative diagram, deterministic finite automata, test case

中图分类号: