Skip to main content

Assertions in Programming: From Scientific Theory to Engineering Practice

Keynote Address

  • Conference paper
  • First Online:
Soft-Ware 2002: Computing in an Imperfect World (Soft-Ware 2002)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 2311))

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints 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

Publish with us

Policies and ethics