Software reliability is a primary concern in the construction of software, and thus a fundamental component in the definition of software quality. Analyzing software reliability requires a specification of the intended behavior of the software under analysis, and at the source code level, such specifications typically take the form of assertions. Unfortunately, software many times lacks such specifications, or only provides them for scenario-specific behaviors, as assertions accompanying tests. This issue seriously diminishes the analyzability of software with respect to its reliability. In this paper, we tackle this problem by proposing a technique that, given a Java method, automatically produces a specification of the method's current behavior, in the form of postcondition assertions. This mechanism is based on generating executions of the method under analysis to obtain valid pre/post state pairs, mutating these pairs to obtain (allegedly) invalid ones, and then using a genetic algorithm to produce an assertion that is satisfied by the valid pre/post pairs, while leaving out the invalid ones. The technique, which targets in particular methods of reference-based class implementations, is assessed on a benchmark of open source Java projects, showing that our genetic algorithm is able to generate post-conditions that are stronger and more accurate, than those generated by related automated approaches, as evaluated by an automated oracle assessment tool. Moreover, our technique is also able to infer an important part of manually written rich postconditions in verified classes, and reproduce contracts for methods whose class implementations were automatically synthesized from specifications.
翻译:软件的可靠性是软件建设中的主要关切,因此也是软件质量定义的一个基本组成部分。分析软件的可靠性需要具体说明所分析软件的预期行为,在源代码一级,这种规格通常采取声明的形式。不幸的是,软件许多次缺乏这种规格,或只是提供这些特定情景的行为,作为附带试验的证明。这个问题严重降低了软件在可靠性方面的可分析性。在本文件中,我们通过提出一种技术来解决这一问题,根据爪哇方法,自动以附加条件的描述形式对方法的当前行为作出说明。这一机制的基础是执行所分析的方法,以获得有效的先行/后行配对,使这些配对变异以获得(表面上的)无效的,然后使用基因算法来得出一种能为有效的先行/后行配对所满意的断言。在本文中,我们特别针对基于参考条件的类别执行方法,在公开源化的Java项目基准上进行了评估,表明我们的基因分析方法的精度,其精度,其精度,其精度,其精度,其精度,其精度,其精度,其精度,其精度,其精度,其精度,其精度,其精度,其精度,其精度,其精度,其精度,其精度,其精度,其精度,其精度,其精度,其精度,其精度,其精度,其精度,其精度,其精度,其精度,其精度,其精度,其精度,其精度,其精度,其精度,其精度,其精度,其精度,其精度,其精度,其次,其次,其次,其次,其次,其次,其次,其次,其次,其次,其次,其次,其次,其次,其次,其次,其次,其次,其次,其次,其次,其次,其次,其次,其次,其次,其次,其次,其次,其次,其次,其次,其次,其次,其次,其次,其次,其次,其次,其次,其次,其次,其次,其次,其次,其次,其次,其次,其次