Assertion (software development): Difference between revisions

Content deleted Content added
FrescoBot (talk | contribs)
m Bot: removing misplaced special no-break space character and minor changes
Clarify. Assertion checking is incidental to an assertion.
Line 1:
{{About|the computer programming concept|assertions in the context of the [[Security Assertion Markup Language]] (SAML) open standard|Security Assertion Markup Language#Assertions}}
 
In [[computer programming]], an '''assertion''' is a [[Statement (computer science)|statement]] that a [[Predicate (mathematical logic)|predicate]] ([[Boolean-valued function]], i.e. a true–false [[Expression (computer science)|expression]]) is expected to always be true at that point in thecode codeexecution. If anIt assertioncan evaluateshelp toa falseprogrammer atread runthe timecode, anhelp assertiona failurecompiler resultscompile it, whichor typically causeshelp the program to [[Crash (computing)|crash]], or to throw andetect assertionits [[exceptionown handling|exception]]defects.
 
For the latter, some programs check assertions by actually evaluating the predicate as they run and if it is not in fact true, an assertion failure, the program considers itself to be broken and typically deliberately [[Crash (computing)|crashes]] or throws an assertion failure [[exception handling|exception]].
 
== Details ==