软件测试中的一个重要问题是测试成本和测试效率的平衡问题.依据程序中错误分布的2-8定律,将测试分为两个阶段,以解决该问题.第1阶段采用最小代价发现软件中的错误,第2阶段针对第l阶段中发现的错误补充设计测试用例,探测软件中潜在的错误.重点是第1阶段的实现,依据确定性有限状态机和集合划分的理论,提出了确定性有限状态机的最小测试成本迁移覆盖准则,给出了最小测试成本迁移覆盖存在的充分和必要条件,设计了优化迁移覆盖和最小测试成本迁移覆盖的实现算法,并讨论了测试序列集合的有效性问题.在实验中,依据该方法不仅能够获得最小测试成本的测试用例集合,而且同样能够探测出确定性有限状态机中迁移上的错误.
A key problem in software testing is having the right cost/benefit tradeoffs for the software that is being tested. Based on the 2-8 law of fault distribution in programs, the paper divides the test process in two stages for solving this problem. The first stage is to find the faults in software at minimum cost, and the second stage is to add some additional test cases for those faults found in the first stage to detect more potential faults in software. The paper lays emphasis on the realization of the first stage. According to the theories of both the deterministic finite state machine (DFSM) and set partition, a DFSM-based minimum test cost transition coverage criterion is presented in this paper, and the criterion's sufficiency and necessary conditions are given. Moreover, two algorithms that realize the optimal transition coverage and the minimum test cost transition coverage are designed, and the effectiveness of the test set is also discussed. In the experiments, the method not only obtains a set of test cases with the minimal size and the shortest total length of all test cases, but also finds all faults in transitions of the DFSM.