BIGpedia.com - Precondition - Encyclopedia and Dictionary Online
encyclopedia search

Precondition

In logic a precondition is a condition that has to be met, before a main argument can have any value.

In computer programming, a precondition is a fact that must always be true just prior to the execution of some section of code. Preconditions are sometimes tested using assertions within the code itself. Often, preconditions are simply included in the documentation of the affected section of code. If a precondition is violated, the effect of the section of code becomes undefined and thus may or may not carry out its intended work. Security problems can arise due to incorrect preconditions - e.g. a section of code that has the precondition that the input is correct, when it may not be.


See also



The contents of this article are licensed from Wikipedia.org under the GNU Free Documentation License.
How to see transparent copy

01-04-2007 01:21:04