Abstract
An assertion in a computer program is a logical formula (Boolean expression) which the programmer expects to evaluate to true on every occasion that program control reaches the point at which it is written. Assertions can be used to specify the purpose of a program, and to define the interfaces between its major components. An early proponent of assertions was Alan Turing (1948), who suggested their use in establishing the correctness of large routines. In 1967, Bob Floyd revived the idea as the basis of a verifying compiler that would automatically prove the correctness of the programs that it compiled. After reading his paper, I became a member of a small research school devoted to exploring the idea as a theoretical foundation for a top-down design methodology of program development. I did not expect the research to influence industrial practice until after my retirement from academic life, thirty years ahead. And so it has been.
In this talk, I will describe some of the ways in which assertions are now used in Microsoft programming practice. Mostly they are used as test oracles, to detect the effects of a program error as close as possible to its origin. But they are beginning to be exploited also by program analysis tools and even by compilers for optimisation of code. One purpose that they are never actually used for is to prove the correctness of programs. This story is presented as a case study of the way in which scientific research into ideals of accuracy and correctness can find unexpected application in the essentially softer and more approximative tasks of engineering.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2002 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Hoare, T. (2002). Assertions in Programming: From Scientific Theory to Engineering Practice. In: Bustard, D., Liu, W., Sterritt, R. (eds) Soft-Ware 2002: Computing in an Imperfect World. Soft-Ware 2002. Lecture Notes in Computer Science, vol 2311. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-46019-5_27
Download citation
DOI: https://doi.org/10.1007/3-540-46019-5_27
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-43481-8
Online ISBN: 978-3-540-46019-0
eBook Packages: Springer Book Archive