Choosing Assertions from a Useful Interface Contract

Assertions used in a proof or analysis should capture the observable requirements and the facts needed to establish them.

Source
Anbloq
Language
English
Created
Updated
Chapters
2
Reading time
1 min
In this article2 chapters
  1. Trace a bounded result
  2. Use a revealing test

Trace a bounded result

A clamp promising a value in zero through ten can be checked with both inequalities after its operation. A caller may also need it to preserve valid inputs. See postconditions.

Use a revealing test

An implementation returning zero always satisfies the range alone. Input seven checks preservation. Inputs separating wrong results help find missing promises.[1]

References

  1. Benjamin C. Pierce et al., Software Foundations ↩