规范和实现构建的语义指导和反馈
Semantic Guidance and Feedback for the Construction of Specifications and Implementations
摘要:
编写一个准确反映开发人员意图的规范的问题长期以来一直被认为是一个基本问题。我们提出了一种方法和一个支持工具来编写和检查规范和实现使用一组用例,\ie输入输出对,开发人员提供。这些都是好的(正确的)和坏的(不正确的)行为的例子。我们假设用例是准确的,因为生成用例比编写准确的规范更容易。我们逐步构建一个规范(前置条件和后置条件)的基础上产生的语义反馈,从这些用例。我们使用两种算法检查构造的规范的准确性。第一个算法检查规范的准确性,根据自动生成的规范,从提供的有限域的用例。第二个检查规范的准确性,通过减少其域到一个有限的,但同样可满足的域,如果可能的话。当规范成熟时,我们也开始构造满足规范的程序。然而,如果需要,我们的方法为继续修改规范做好了准备。我们用两个例子来说明我们的方法;线性搜索和文本对齐。
英文摘要:
The problem of writing a specification which accurately reflects the intent of the developer has long been recognized as fundamental. We propose a method and a supporting tool to write and check a specification and an implementation using a set of use cases, \ie input-output pairs that the developer supplies. These are instances of both good (correct) and bad (incorrect) behavior. We assume that the use cases are accurate, as it is easier to generate use cases than to write an accurate specification. We incrementally construct a specification (precondition and postcondition) based on semantic feedback generated from these use cases. We check the accuracy of the constructed specification using two proposed algorithms. The first algorithm checks the accuracy of the specification against an automatically generated specification from a supplied finite domain of use cases. The second checks the accuracy of the specification via reducing its domain to a finite yet equally satisfiable domain if possible. When the specification is mature, we start to also construct a program that satisfies the specification. However, our method makes provision for the continued modification of the specification, if needed. We illustrate our method with two examples; linear search and text justify.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。