Precondition Precondition

Precondition - Definition and Overview

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 section of code is free to do whatever it wants - format the hard disk, blow up the monitor, attempt to take over the world, etc. 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

Copyright 2009 WordIQ.com - Privacy Policy  :: Terms of Use  :: Contact Us  :: About Us
This article is licensed under the GNU Free Documentation License. It uses material from the this Wikipedia article.