precondition
A constraint that must be true when an operation is invoked.
See also postcondition.
Semantics
A precondition is a Boolean expression that must be true when an operation is called. It is the responsibility of the caller to satisfy the condition. The receiver should not have to check the condition. A precondition is not a guard condition. It is a condition that must be true, not a way to optionally execute an operation. As an implementation practice, it can be useful to test the precondition at the beginning of the operation, but this is in the nature of debugging a program. The condition is supposed to be true, and anything else is a programming error. If the condition is not satisfied, no statement can be made about the integrity ...
Get Unified Modeling Language Reference Manual, The, Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.