liveBook · Manning

Specification

As explained in Vibe Engineering

A statement of required system behavior, constraints, or properties that defines what an implementation should satisfy.

A specification states what software must do, independent of how it does it. For AI-generated code, tests often serve as the inspectable specification: they define intent rather than merely checking an implementation. section 8.3 section 8.3.7

Reliable specifications expose requirements and their limits:

  • State required behavior, promises, and invariants directly; avoid encoding implementation choices. section 8.3.7
  • Treat passing tests as evidence that an expressed contract holds, not proof that the deeper requirement is correct. section 8.3.7
  • Separate specification-derived tests from tests written after implementation; circular tests can preserve the agent's misunderstanding. section 10.4.1
  • Escalate from examples to properties, and consider formal verification when bugs are catastrophic, domains are naturally formal, or regulation demands it. section 8.6 section 8.6.5

A behavioral specification in a test

The assertion `parse_markup("**bold**") == "<strong>bold</strong>"` specifies the required transformation without deciding whether the implementation uses regular expressions, parser combinators, or a state machine. By contrast, a discount test that expects 4.99 when the correct result is 5.00 merely confirms a shared implementation mistake. section 8.3.7 section 10.4.1

The central risk is not only incorrect code but an incorrect specification. Proofs can establish that code satisfies a specification while leaving open whether the specification expresses the intended behavior. section 8.6

How Vibe Engineering covers it

How deep it goes
Explains examples, properties, contracts, and formal proofs, while stopping short of teaching formal-methods construction.
Examples
Uses markup parsing, currency rounding, parser inputs, state machines, protocols, and safety-critical systems as specification cases.
What it assumes
Assumes familiarity with tests and software behavior, while teaching the shift from verifying code to defining intent.
What you can do after
Evaluate AI-generated implementations against explicit behavioral contracts and select stronger verification when risk justifies its cost.
How it connects
Connects specifications to tests, property-based testing, fuzzing, contract testing, mutation testing, and formal methods.

Also explained in

Compare how 12 books explain specification →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Vibe Engineering. The section links point to the parts of the book it draws on.