arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2201.10874cs.SE
收藏

Fuzzing类规格

Fuzzing Class Specifications

Facundo Molina, Marcelo d'Amorim, Nazareno Aguirre

摘要:

通过可执行约束表达类规范对于各种软件工程任务(如测试生成、错误发现和自动调试)很重要,但开发人员很少编写它们。从代码中推断规范的技术存在以填补这一空白,但它们被设计为支持特定种类的断言,并且难以适应于支持不同的断言语言,例如,添加对量化的支持,或添加其他比较运算符,如成员资格或包含。为了解决上述问题,我们提出了SpecFuzzer,一种新的技术,结合了基于语法的模糊,动态不变检测和突变分析,自动产生类规范。SpecFuzzer使用:(i)一个模糊器作为候选断言的生成器,该候选断言来自于从类定义自动获得的语法;(ii)一个动态不变检测器(Daikon),用于过滤掉被测试套件无效的断言;以及(iii)一个基于变异的机制,用于对断言进行聚类和排名,以便将类似的约束分组,然后将较强的约束优先化。基于语法的模糊化使得SpecFuzzer能够通过操纵模糊化语法,直接地适应于支持不同的规约语言,以包括额外的操作员。我们评估我们的技术的基准43 Java方法采用的评估国家的最先进的技术GAssert和EvoSpex。我们的研究结果表明,SpecFuzzer可以很容易地支持一个更具表现力的断言语言,这是更有效的比GAssert和EvoSpex在推断规范,根据标准的性能指标。

英文摘要:

Expressing class specifications via executable constraints is important for various software engineering tasks such as test generation, bug finding and automated debugging, but developers rarely write them. Techniques that infer specifications from code exist to fill this gap, but they are designed to support specific kinds of assertions and are difficult to adapt to support different assertion languages, e.g., to add support for quantification, or additional comparison operators, such as membership or containment. To address the above issue, we present SpecFuzzer, a novel technique that combines grammar-based fuzzing, dynamic invariant detection, and mutation analysis, to automatically produce class specifications. SpecFuzzer uses: (i) a fuzzer as a generator of candidate assertions derived from a grammar that is automatically obtained from the class definition; (ii) a dynamic invariant detector -- Daikon -- to filter out assertions invalidated by a test suite; and (iii) a mutation-based mechanism to cluster and rank assertions, so that similar constraints are grouped and then the stronger prioritized. Grammar-based fuzzing enables SpecFuzzer to be straightforwardly adapted to support different specification languages, by manipulating the fuzzing grammar, e.g., to include additional operators. We evaluate our technique on a benchmark of 43 Java methods employed in the evaluation of the state-of-the-art techniques GAssert and EvoSpex. Our results show that SpecFuzzer can easily support a more expressive assertion language, over which is more effective than GAssert and EvoSpex in inferring specifications, according to standard performance metrics.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑