论文标题
模糊类规范
Fuzzing Class Specifications
论文作者
论文摘要
通过可执行约束表达类规范对于各种软件工程任务(例如测试生成,错误查找和自动调试)很重要,但是开发人员很少编写它们。从代码中推断出规格的技术可以填补此空白,但它们旨在支持特定的主张,并且很难适应以支持不同的断言语言,例如增加对量化的支持或其他比较操作员,例如成员或遏制。 为了解决上述问题,我们提出了SpecFuzzer,这是一种新型技术,结合了基于语法的模糊,动态不变检测和突变分析,以自动产生类规范。 SpecFuzzer使用:(i)fuzzer作为从类定义自动获得的语法中得出的候选断言的生成器; (ii)一个动态不变检测器 - daikon-用于滤除测试套件无效的断言; (iii)基于突变的群集和等级主张的机制,因此将相似的约束分组,然后更强的优先级。基于语法的模糊功能使SpecFuzzer可以通过操纵模糊的语法(例如,包括其他操作员)来直接适应以支持不同规范语言。 我们根据评估最先进技术Gassert和Evospex的43种Java方法的基准评估了我们的技术。根据标准性能指标,我们的结果表明,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.