liveBook · Manning

Verification-first

As explained in Vibe Engineering

A development pattern in which human-authored checks or specifications are established before AI-generated implementation code.

AI-generated code can look plausible while violating unstated requirements. Verification-first addresses that risk by having the person who knows what correctness means write checks or specifications before the implementation exists. The human defines intent and anticipates failure modes before seeing generated code. section 1.4

For a single function, this resembles test-driven development with the model as implementer. For a feature, the contract can also include API schemas, invariants, performance gates, and error semantics. The common requirement is that verification precedes implementation. section 1.4

import pytest
# Assume is_valid_isbn13 is the function to be generated
def test_valid_isbn_with_hyphens():
    assert is_valid_isbn13("978-0-306-40615-7") is True
def test_valid_isbn_without_hyphens():
    assert is_valid_isbn13("9780306406157") is True
def test_invalid_checksum():
    assert is_valid_isbn13("978-0-306-40615-0") is False
def test_invalid_length():
    assert is_valid_isbn13("978-0-306-40615") is False
def test_contains_non_numeric_characters():
    assert is_valid_isbn13("978-0-306-40615-X") is False

These ISBN-13 tests define expected behavior before generation, including valid formats, an invalid checksum, incorrect length, and nonnumeric characters. section 1.4

Use the checks to judge the generated implementation, not its apparent fluency. A practical final question is whether you would be willing to go on-call for the resulting system. section 1.4

How Vibe Engineering covers it

How deep it goes
Explains the ordering and rationale, distinguishing function-level tests from feature contracts with schemas, invariants, performance gates, and error semantics.
Examples
Uses ISBN-13 validation tests for hyphenated and unhyphenated inputs, invalid checksums, incorrect length, and nonnumeric characters.
What you can do after
Practice writing checks before AI-generated code and assessing whether the resulting system is trustworthy enough to support on-call.
How it connects
Connects test-driven development, spec-driven development, and acceptance criteria through checks established before implementation.

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.