Skip to main content
QUICK REVIEW

[论文解读] Searching for test data with feature diversity

Robert Feldt, Simon Poulding|arXiv (Cornell University)|Sep 18, 2017
Software Testing and Debugging Techniques参考文献 15被引用 6
一句话总结

本文提出基于搜索的方法,生成针对特定特征(如字符串长度、数字字符数量)的多样化测试数据,在二维特征空间中评估了10种方法。爬山搜索在覆盖目标特征区域方面最为高效,尽管随机采样也表现良好,表明在重复测试场景中,混合或模型辅助策略为最优选择。

ABSTRACT

There is an implicit assumption in software testing that more diverse and varied test data is needed for effective testing and to achieve different types and levels of coverage. Generic approaches based on information theory to measure and thus, implicitly, to create diverse data have also been proposed. However, if the tester is able to identify features of the test data that are important for the particular domain or context in which the testing is being performed, the use of generic diversity measures such as this may not be sufficient nor efficient for creating test inputs that show diversity in terms of these features. Here we investigate different approaches to find data that are diverse according to a specific set of features, such as length, depth of recursion etc. Even though these features will be less general than measures based on information theory, their use may provide a tester with more direct control over the type of diversity that is present in the test data. Our experiments are carried out in the context of a general test data generation framework that can generate both numerical and highly structured data. We compare random sampling for feature-diversity to different approaches based on search and find a hill climbing search to be efficient. The experiments highlight many trade-offs that needs to be taken into account when searching for diversity. We argue that recurrent test data generation motivates building statistical models that can then help to more quickly achieve feature diversity.

研究动机与目标

  • 解决现有研究中关于特征特定测试数据多样性的不足,其中多样性聚焦于特定输入特征而非普遍性。
  • 识别并评估多种基于搜索的方法,以生成符合用户定义特征(如输入大小或字符组成)的多样化测试数据。
  • 比较不同搜索策略(如爬山搜索、随机采样、元启发式方法)在探索指定特征空间时的效率与覆盖范围。
  • 研究统计模型(如高斯过程)在重复测试场景(如回归测试)中加速未来测试数据生成的潜力。
  • 提供一个框架,根据测试目标、特征空间特性及效率权衡,选择合适的搜索算法。

提出的方法

  • 将特征特定测试多样性(FSTD)问题定义为在多维特征空间的特定区域内生成多样且完整的测试输入集合。
  • 实现10种不同的搜索与采样策略,包括随机采样、爬山搜索、自适应随机测试以及元启发式搜索(如NMCS),以探索特征空间。
  • 使用能够生成数值型和结构化数据(如字符串)的测试数据生成框架,特征作为可度量属性提取(如长度、数字字符数量)。
  • 基于目标特征空间的覆盖范围和效率(单位时间内的覆盖量)评估方法,以二维特征空间作为测试基准。
  • 集成统计建模(如高斯过程)以建模从特征空间到参数空间的映射,实现在重复测试中更快、更智能的测试数据生成。
  • 评估NMCS中随机模型粒度的影响,发现更大、更详细的模型可提升所有方法的搜索性能。

实验结果

研究问题

  • RQ1在特征特定的测试数据生成任务中,哪种搜索策略能在最少的时间步内实现目标特征空间的最高覆盖?
  • RQ2爬山搜索、随机采样和元启发式方法在多样性覆盖和效率方面的性能特征如何比较?
  • RQ3统计模型(如高斯过程)在多大程度上能提升重复测试中测试数据生成的效率?
  • RQ4随机模型粒度的选择在多大程度上影响基于搜索的测试数据生成性能,特别是在NMCS中?
  • RQ5在选择用于特征特定测试多样性的搜索算法时,偏差、效率与鲁棒性之间的权衡是什么?

主要发现

  • 爬山搜索在目标特征空间覆盖方面表现最佳,且单位时间步效率最高,优于其他基于搜索的方法。
  • 随机采样表现出乎意料地好,提供了一种偏差更小的替代方案,尤其在结合更大规模的随机模型时,覆盖效果具有竞争力。
  • 随机模型的选择显著影响性能:更大、更详细的模型可提升所有搜索算法(包括NMCS)的效率。
  • 将随机采样与高级搜索方法(如NMCS)结合的混合方法展现出强大潜力,尤其在突破搜索空间中的局部约束方面。
  • 没有单一算法在所有情况下均占优;最优选择取决于测试场景、特征空间结构以及对偏差与效率平衡的需求。
  • 重复测试中的测试数据生成可从统计模型(如高斯过程)中获益,这些模型将特征值映射到参数空间,从而在回归测试中实现更快、更精准的多样性生成。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

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