Safe Coding

Read full text
Authors: Christoph A. Kern
Cited by: 0
References: 10

Abstract

Safe coding embodies a modular, compositional approach to building and reasoning about the safety of large, complex systems. Difficult and subtle reasoning about the safety of abstractions is localized to their implementations; the safety of risky operations within an abstraction must rely solely on assumptions supported by the abstraction's APIs and type signatures. Conversely, the composition of safe abstractions with safe code is automatically verified by the implementation language's type checker. While not a formal method itself, safe coding is grounded in principles and techniques from rigorous, formal software verification. It pragmatically adapts concepts such as function contracts and modular proofs for practical large-scale use by lifting safety preconditions into type invariants of custom data types within the chosen implementation language.

Fields of Study & Subjects

Logic programming and type systems Formal Methods in Verification Safety Systems Engineering in Autonomy

Publication details

Journal / source
Communications of the ACM
Volume
69
Issue
3
Pages
44–55
Publication date
26 February 2026
Language
EN