Tous les livres

Professionnel

Applis À propos Coach Connexion Commencer la lecture

Computer Science · Glossaire

Qu'est-ce que « Precondition, postcondition, specification » ?

Aussi appelé : precondition · postcondition · specification

Definition 12.1 University Computer Science — Year 1 · Chapitre 12 — Program Correctness

A precondition is a condition on the inputs, and on the state, that a caller must ensure before calling a function. A postcondition is a condition relating the result and the final state to the inputs, which the function guarantees when it returns. The pair is the function’s specification: a contract, in which the function owes nothing to a caller who broke the precondition.

Lire dans le chapitre →