Computer Engineering and Applications ›› 2009, Vol. 45 ›› Issue (17): 57-60.DOI: 10.3778/j.issn.1002-8331.2009.17.018

• 研发、设计、测试 • Previous Articles     Next Articles

Generation and analysis of test cases based on Petri nets

LIN Hong-chang,HU Jue-liang,DING Zuo-hua   

  1. Center of Math. Computing & Software Engineering,Zhejiang Sci-Tech University,Hangzhou 310018,China
  • Received:2008-10-13 Revised:2009-01-17 Online:2009-06-11 Published:2009-06-11
  • Contact: LIN Hong-chang

基于Petri网的软件测试用例的产生及分析

林红昌,胡觉亮,丁佐华   

  1. 浙江理工大学 数学计算与软件工程中心,杭州 310018
  • 通讯作者: 林红昌

Abstract: Software testing must consider correctness of functional requirements,complete coverage and test case feasibility.One of the common used methods to generate test case is path coverage,which generates test case by analyzing the control flow.But it is possible to generate infeasible test path.In this paper,Petri nets is used to describe programs,and the Petri nets is decomposed based on some mathematics rules.Then we can get the Independent Segment Group(ISG) and thus generate the test cases.Finally an algorithm is designed to find the minimal test sets which also satisfy the coverage criteria.

Key words: Petri nets, independent segment group, test case, feasibility

摘要: 软件测试不仅要考虑到功能的正确性、覆盖的完整性,也应该考虑到测试用例的可行性。一种常用的产生测试用例的方法是路径覆盖,它是通过分析控制流来产生的,但是这样很可能产生不可行路径。论文运用Petri网来描述程序,并且按照一定的数学规则将此Petri网进行分解,得到独立的段组(Independent Segment Group,ISG)并产生测试用例,最后设计一个算法找到满足覆盖准则的最少测试用例。

关键词: Petri网, 独立段组(ISG), 测试用例, 可行性