Correctness-by-Construction (CbC) is an incremental program construction process to construct functionally correct programs. The programs are constructed stepwise along with a specification that is inherently guaranteed to be satisfied. CbC is complex to use without specialized tool support, since it needs a set of predefined refinement rules of fixed granularity which are additional rules on top of the programming language. Each refinement rule introduces a specific programming statement and developers cannot depart from these rules to construct programs. CbC allows to develop software in a structured and incremental way to ensure correctness, but the limited flexibility is a disadvantage of CbC. In this work, we compare classic CbC with CbC-Block and TraitCbC. Both approaches CbC-Block and TraitCbC, are related to CbC, but they have new language constructs that enable a more flexible software construction approach. We provide for both approaches a programming guideline, which similar to CbC, leads to well-structured programs. CbC-Block extends CbC by adding a refinement rule to insert any block of statements. Therefore, we introduce CbC-Block as an extension of CbC. TraitCbC implements correctness-by-construction on the basis of traits with specified methods. We formally introduce TraitCbC and prove soundness of the construction strategy. All three development approaches are qualitatively compared regarding their programming constructs, tool support, and usability to assess which is best suited for certain tasks and developers.
翻译:正确构造(CbC)是一种逐步构造功能正确程序的程序构造过程。程序是随着规范逐步构建的,其本质上有保证满足的规范。在没有专门的工具支持的情况下,CbC很难使用,因为它需要一组预定义的粒度固定的细化规则,这些规则是在编程语言之上添加的其他规则。每个细化规则都引入了特定的编程语句,开发人员无法偏离这些规则来构建程序。CbC允许以结构化和逐步的方式开发软件,以确保正确性,但CbC的有限灵活性是其不足之处。在本文中,我们比较了经典CbC和CbC-Block和TraitCbC。CbC-Block和TraitCbC都与CbC有关,但它们具有新的语言结构,可以实现更灵活的软件构造方法。我们为两种方法提供了编程指南,类似于CbC,可以导致良好的程序结构。CbC-Block通过添加一个细化规则来插入任何语句块来扩展CbC。因此,我们将CbC-Block引入为CbC的扩展。TraitCbC基于具有指定方法的trait 实现基于构造的正确性。我们正式介绍了TraitCbC,并证明了构造策略的正确性。针对编程构造,工具支持和可用性, qualitatively比较了这三种开发方法,以评估哪种最适合特定任务和开发人员。