Todos los libros

Profesional

Apps Acerca de Coach Iniciar sesión Empezar a leer

Computer Science · Glosario

¿Qué es Specification?

Definition 1.1 High School Computer Science · Capítulo 1 — Specifications, Assertions and Tests

The specification of a function states, without describing how the function works, what it computes: its name and parameters, the values its parameters may take, and the result it returns or the change it makes for each of those values.

Ejemplos

Example 1.5 (The specification of a maximum)

For a function largest(t): the precondition is “t is a non-empty list of numbers”; the postcondition is “the result is an element of t, and no element of t is larger”. The empty list is excluded because it has no largest element: the specification forces the author to decide this case instead of leaving it to chance.

Leer en el capítulo →