翻訳と辞書 |
Postcondition : ウィキペディア英語版 | Postcondition In computer programming, a postcondition is a condition or predicate that must always be true just after the execution of some section of code or after an operation in a formal specification. Postconditions are sometimes tested using assertions within the code itself. Often, postconditions are simply included in the documentation of the affected section of code. For example: The result of a factorial is always an integer and greater than or equal to 1. So a program that calculates the factorial of an input number would have postconditions that the result after the calculation be an integer and that it be greater than or equal to 1. Another example: a program that calculates the square root of an input number might have the postconditions that the result be a number and that its square be equal to the input . ==Postconditions in object-oriented programming== In object-oriented programming, postconditions, along with preconditions and class invariants, are components of the software construction method design by contract. The postcondition for any routine is a declaration of the properties which are guaranteed upon completion of the routine's execution.〔Meyer, Bertrand, ''Object-Oriented Software Construction, second edition,'' Prentice Hall, 1997, p. 342.〕 As it relates to the routine's contract, the postcondition offers assurance to potential callers that in cases in which the routine is called in a state in which its precondition holds, the properties declared by the postcondition are assured.
抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)』 ■ウィキペディアで「Postcondition」の詳細全文を読む
スポンサード リンク
翻訳と辞書 : 翻訳のためのインターネットリソース |
Copyright(C) kotoba.ne.jp 1997-2016. All Rights Reserved.
|
|