一句话:提出 G-EvoSuite,将文法变异融入搜索式测试,协同演化生成结构化测试输入,提升 JSON 解析类分支覆盖。
软件测试中,搜索式测试擅长生成测试用例结构但难以产生高度结构化输入,而基于文法的模糊测试虽能生成结构化数据却不生成测试用例结构。本文提出将二者结合的方法 G-EvoSuite:对搜索式测试算法收集的输入数据施加基于文法的变异,使输入数据与测试用例结构协同演化。作者在来自三个最流行 JSON 解析器的 20 个 Java 类上,跨多个搜索预算进行实证研究。结果表明,该方法在 JSON 相关类上平均提升分支覆盖 15%,最高提升 50%,且未对其他类产生负面影响。
Software testing is an important and time-consuming task that is often done manually. In the last decades, researchers have come up with techniques to generate input data (e.g., fuzzing) and automate the process of generating test cases (e.g., search-based testing). However, these techniques are known to have their own limitations: search-based testing does not generate highly-structured data; grammar-based fuzzing does not generate test case structures. To address these limitations, we combine these two techniques. By applying grammar-based mutations to the input data gathered by the search-based testing algorithm, it allows us to co-evolve both aspects of test case generation. We evaluate our approach, called G-EvoSuite, by performing an empirical study on 20 Java classes from the three most popular JSON parsers across multiple search budgets. Our results show that the proposed approach on average improves branch coverage for JSON related classes by 15 % (with a maximum increase of 50 %) without negatively impacting other classes.
@inproceedings{paperbot5927,
title = {Generating highly-structured input data by combining search-based testing and grammar-based fuzzing},
author = {Mitchell Olsthoorn and Arie van Deursen and Annibale Panichella},
booktitle = {ASE},
year = {2020},
doi = {10.1145/3324884.3418930}
}