Download PDFOpen PDF in browser

Utilizing Hoare Logic to Strengthen Testing for Error Detection in Programs

10 pagesPublished: June 22, 2012

Abstract

Hoare logic (also known as Floyd-Hoare logic) can be used to formally verify the correctness of programs while testing provides a practical way to detect errors in programs. Unfortunately, the former is rarely applied in practice and the later is difficult to detect all existing errors. In this paper, we propose a novel technique that makes good use of Hoare logic to strengthen testing. The essential idea is first to use specification-based testing to discover all traversed program paths and then to use Hoare logic to prove their correctness. During the proof process, all errors on the paths can be detected. A case study is conducted to show its feasibility; an example taken from the case study is used to illustrate how the proposed method is applied; and discussion on the potential challenges to the method is presented.

Keyphrases: hoare logic, program analysis, software testing, specification based testing

In: Andrei Voronkov (editor). Turing-100. The Alan Turing Centenary, vol 10, pages 229-238.

BibTeX entry
@inproceedings{Turing-100:Utilizing_Hoare_Logic_Strengthen,
  author    = {Shaoying Liu},
  title     = {Utilizing Hoare Logic to Strengthen Testing for Error Detection in Programs},
  booktitle = {Turing-100. The Alan Turing Centenary},
  editor    = {Andrei Voronkov},
  series    = {EPiC Series in Computing},
  volume    = {10},
  publisher = {EasyChair},
  bibsource = {EasyChair, https://easychair.org},
  issn      = {2398-7340},
  url       = {/publications/paper/476},
  doi       = {10.29007/fml1},
  pages     = {229-238},
  year      = {2012}}
Download PDFOpen PDF in browser