李益, 吴军华. 一种混合测试用例约简和生成的方法[J]. 微电子学与计算机, 2018, 35(6): 17-21, 27.
引用本文: 李益, 吴军华. 一种混合测试用例约简和生成的方法[J]. 微电子学与计算机, 2018, 35(6): 17-21, 27.
LI Yi, WU Jun-hua. An Approach Hybridized Test Case Reduction and Generation[J]. Microelectronics & Computer, 2018, 35(6): 17-21, 27.
Citation: LI Yi, WU Jun-hua. An Approach Hybridized Test Case Reduction and Generation[J]. Microelectronics & Computer, 2018, 35(6): 17-21, 27.

一种混合测试用例约简和生成的方法

An Approach Hybridized Test Case Reduction and Generation

  • 摘要: 软件测试是软件开发的重要的环节, 如何实现路径覆盖、提高测试效率是测试研究的关键问题.从测试需求着手, 通过路径分析进行测试需求的约简; 利用条件概率判定条件语句间的相关性以检测不可达路径; 综合遗传算法和萤火虫算法, 根据层接近度和分支距离设计适应度函数, 根据萤火虫位置的更新进行遗传操作, 从而减少冗余的测试用例, 提高算法收敛性.将所提方法应用于基准程序, 并与同类方法比较可知, 该方法生成路径覆盖测试用例具有高效性.

     

    Abstract: Software testing plays a vital role in software development life cycle. How to achieve path coverage, increase testing efficiency is the heart of the matter. This paper starts with test requirements for test requirements reduction by path analysis, and checks the dependency among conditional statements by calculating conditional probability to detect infeasible paths in program. In addition, this paper combines genetic algorithm(GA) with firefly algorithm(FA), calculates fitness function by branch distance and layer approach, considers the location update of FA as genetic operation of GA, thus reducing redundant test cases and improving the astringency of the algorithm. The proposed method is applied to benchmark and industrial programs, and is compared with other alternative approaches. The experimental result demonstrates that the proposed method is efficient in generating test cases for path coverage.

     

/

返回文章
返回