当前位置: X-MOL 学术arXiv.cs.SE › 论文详情
Our official English website, www.x-mol.net, welcomes your feedback! (Note: you will need to create a separate account there.)
EvoSpex: An Evolutionary Algorithm for Learning Postconditions
arXiv - CS - Software Engineering Pub Date : 2021-02-26 , DOI: arxiv-2102.13569
Facundo Molina, Pablo Ponzio, Nazareno Aguirre, Marcelo Frias

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.

中文翻译:

EvoSpex:一种学习后置条件的进化算法

软件可靠性是软件构建中的主要关注点,因此也是定义软件质量的基本组成部分。分析软件可靠性需要对所分析软件的预期行为进行规范,并且在源代码级别上,此类规范通常采用断言的形式。不幸的是,软件常常缺少这样的规范,或者仅为特定于场景的行为提供它们,如伴随测试的断言。此问题严重降低了软件在可靠性方面的可分析性。在本文中,我们通过提出一种技术来解决此问题,该技术在给定Java方法的情况下,以后置条件断言的形式自动生成该方法当前行为的规范。该机制基于生成待分析方法的执行以获取有效的前/后状态对,将这些对进行突变以获得(据称)无效对,然后使用遗传算法产生由有效前/后状态满足的断言发布配对,同时删除无效的配对。该技术针对特定于基于引用的类实现的特定方法,并在开源Java项目的基准上进行了评估,表明该遗传算法能够生成比相关Java生成的条件更强大,更准确的后置条件。自动方法,由自动oracle评估工具评估。此外,我们的技术还能够推断出经过验证的类中手动编写的丰富后置条件的重要部分,
更新日期:2021-03-01
down
wechat
bug