Skip to main content
QUICK REVIEW

[论文解读] A Genetic Algorithm based Approach for Test Data Generation in Basis Path Testing

Yeresime Suresh, Santanu Kumar Rath|arXiv (Cornell University)|Jan 21, 2014
Software Testing and Debugging Techniques参考文献 14被引用 28
一句话总结

本文提出一种基于遗传算法(GA)的方法,用于自动化基础路径测试的测试数据生成,利用GA的全局优化能力,高效探索复杂的谓词条件。该方法通过基于适应度的进化生成满足所有基础路径的最优测试用例,减少人工工作量并消除冗余测试数据,已在ATM取款用例中得到验证,成功收敛至有效测试输入。

ABSTRACT

Software Testing is a process to identify the quality and reliability of software, which can be achieved through the help of proper test data. However, doing this manually is a difficult task due to the presence of number of predicate nodes in the module. So, this leads towards a problem of NP-complete. Therefore some intelligence-based search algorithms have to be used to generate test data. In this paper, we use a soft computing based approach, genetic algorithm to generate test data based on the set of basis paths. This paper combines the characteristics of genetic algorithm with test data, making use of the merits of respective global and local optimization capability to improve the generation capacity of test data. This automated process of generating test data optimally helps in reducing the test effort and time of a tester. Finally, the proposed approach is applied for ATM withdrawal task. Experimental results show that genetic algorithm was able to generate suitable test data based on a fitness value and avoid redundant data by optimization.

研究动机与目标

  • 解决具有复杂谓词逻辑的软件模块生成最优测试数据的NP完全挑战。
  • 通过使用软计算技术自动化测试数据生成,减少人工测试工作量和时间。
  • 通过生成满足控制流图中提取的所有基础路径的测试数据,提高测试覆盖率和效率。
  • 通过基于适应度的选择和遗传算法框架中的进化优化,最大限度减少冗余测试用例。

提出的方法

  • 该方法首先从源代码构建控制流图(CFG),以识别所有基础路径。
  • 每个基础路径在遗传算法中表示为一条染色体,测试数据编码为基因序列。
  • 适应度函数评估测试用例满足路径谓词条件的程度,指导进化选择。
  • 应用交叉和变异算子生成新的测试数据候选,随代际改进适应度。
  • 算法持续进化测试数据,直至达到适应度阈值,表明已生成该路径的有效测试用例。
  • 该过程在所有基础路径上迭代执行,以生成完整且优化的测试套件。

实验结果

研究问题

  • RQ1遗传算法能否有效生成满足软件模块中所有基础路径的测试数据?
  • RQ2适应度函数如何影响生成测试用例的收敛性和质量?
  • RQ3与人工或穷举方法相比,该GA方法在多大程度上减少了冗余测试数据?
  • RQ4与传统测试数据生成技术相比,该方法在效率和覆盖率方面表现如何?

主要发现

  • 遗传算法在ATM取款用例中成功为所有基础路径生成了有效测试数据,证明了其可行性。
  • 基于适应度的评估有效引导搜索过程,减少冗余数据的生成。
  • 该方法通过自动化生成过程显著减少了人工测试设计的工作量。
  • 该算法在合理代数内收敛至最优或近似最优测试用例,表明具备可扩展性。

更好的研究,从现在开始

从论文设计到论文写作,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。