Refinement type contracts for verification of scientific investigative software

09/01/2019
by   Maxwell Shinn, et al.
0

Our scientific knowledge is increasingly built on software output. User code which defines data analysis pipelines and computational models is essential for research in the natural and social sciences, but little is known about how to ensure its correctness. The structure of this code and the development process used to build it limit the utility of traditional testing methodology. Formal methods for software verification have seen great success in ensuring code correctness but generally require more specialized training, development time, and funding than is available in the natural and social sciences. Here, we present a Python library which uses lightweight formal methods to provide correctness guarantees without the need for specialized knowledge or substantial time investment. Our package provides runtime verification of function entry and exit condition contracts using refinement types. It allows checking hyperproperties within contracts and offers automated test case generation to supplement online checking. We co-developed our tool with a medium-sized (≈3000 LOC) software package which simulates decision-making in cognitive neuroscience. In addition to helping us locate trivial bugs earlier on in the development cycle, our tool was able to locate four bugs which may have been difficult to find using traditional testing methods. It was also able to find bugs in user code which did not contain contracts or refinement type annotations. This demonstrates how formal methods can be used to verify the correctness of scientific software which is difficult to test with mainstream approaches.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
07/09/2019

solc-verify: A Modular Verifier for Solidity Smart Contracts

We present solc-verify, a source-level verification tool for Ethereum sm...
research
08/22/2019

SmartEmbed: A Tool for Clone and Bug Detection in Smart Contracts through Structural Code Embedding

Ethereum has become a widely used platform to enable secure, Blockchain-...
research
02/07/2018

Experience Report: Formal Methods in Material Science

Increased demands in the field of scientific computation require that al...
research
07/05/2023

Formally Verifying a Real World Smart Contract

Nowadays, smart contracts have become increasingly popular and, as with ...
research
03/14/2018

Integrating UML with Service Refinement for Requirements Modeling and Analysis

Unified Modeling Language (UML) is the de facto standard for requirement...
research
05/12/2019

Software System Design based on Patterns for Newton-Type Methods

A wide range of engineering applications uses optimisation techniques as...
research
08/26/2017

Fast and Precise Type Checking for JavaScript

In this paper we present the design and implementation of Flow, a fast a...

Please sign up or login with your details

Forgot password? Click here to reset