Recovering fitness gradients for interprocedural Boolean flags in search-based testing

Recovering fitness gradients for interprocedural Boolean flags in search-based testing
复制标题

DOI:
10.1145/3395363.3397358
复制
发表时间:
2020-07
期刊:
Proceedings of the 29th ACM SIGSOFT International Symposium on Software Testing and Analysis
影响因子:
--
通讯作者:
Yun Lin;Jun Sun;G. Fraser;Ziheng Xiu;Ting Liu;J. Dong
Yun Lin;Jun Sun;G. Fraser;Ziheng Xiu;Ting Liu;J. Dong
中科院分区:
其他
文献类型:
--
作者:
Yun Lin;Jun Sun;G. Fraser;Ziheng Xiu;Ting Liu;J. Dong

文献摘要

相似文献

在基于搜索的软件测试(SBST)中,测试生成的指导下的适应性功能,这些功能估计测试案例达到未覆盖的测试目标(例如,分支)。流行的健身函数估计有条件语句评估到True或false的距离,即分支距离。但是,当条件读取布尔变量(例如,如果(x && y))时,分支距离不提供搜索的梯度,因为布尔值可以是真实的。可以通过转换单个程序来解决此标志问题,以便用布尔标志替换为数字比较,从而为搜索提供更好的指导。不幸的是,定义一种适用于外域案例中的语义传播转换,在范围内,布尔标志以参数和返回值传递,这是一项艰巨的任务。因此,它尚未得到现代测试生成器的支持。这项工作基于以下洞察力,即可以使用运行时信息可以恢复健身梯度:鉴于未覆盖的核心旗分支,我们的方法(1)计算所有控制流量的上下文敏感分支距离,可能会返回所需的标志,以返回所需的标志, (2)递归将这些距离汇总为连续值。我们在Java的EvoSuite框架上实施了方法,并从经验上将其与最先进的可检验性转换进行了比较。我们的实验表明,我们的方法对具有统计意义和可接受的运行时开销的主题方法的覆盖率更高。
In Search-based Software Testing (SBST), test generation is guided by fitness functions that estimate how close a test case is to reach an uncovered test goal (e.g., branch). A popular fitness function estimates how close conditional statements are to evaluating to true or false, i.e., the branch distance. However, when conditions read Boolean variables (e.g., if(x && y)), the branch distance provides no gradient for the search, since a Boolean can either be true or false. This flag problem can be addressed by transforming individual procedures such that Boolean flags are replaced with numeric comparisons that provide better guidance for the search. Unfortunately, defining a semantics-preserving transformation that is applicable in an interprocedural case, where Boolean flags are passed around as parameters and return values, is a daunting task. Thus, it is not yet supported by modern test generators. This work is based on the insight that fitness gradients can be recovered by using runtime information: Given an uncovered interprocedural flag branch, our approach (1) calculates context-sensitive branch distance for all control flows potentially returning the required flag in the called method, and (2) recursively aggregates these distances into a continuous value. We implemented our approach on top of the EvoSuite framework for Java, and empirically compared it with state-of-the-art testability transformations on non-trivial methods suffering from interprocedural flag problems, sampled from open source Java projects. Our experiment demonstrates that our approach achieves higher coverage on the subject methods with statistical significance and acceptable runtime overheads.