Rzemiosło · The Craft
What is The CraftLevelsGet startedChapters Search Download PLEN
Level 2 · Technical ~2 min read

In one sentence: Every change is verified, not declared — tests and real checks instead of “probably works”.

This chapter in plain terms

The chapter distinguishes two things that are easy to confuse:

  • Tests — an automatic safety net you run many times; it Guard — A test that enforces a project rule (e.g. “every module is in the AI_README”) and stops the commit when it’s broken. A rule without a guard is only a wish — a long session will break it in good faith. more in the glossary → against tomorrow’s change breaking something.
  • Verification — proof that this specific change does what it should, seen with your own eyes, not assumed.

Both are mandatory. Tests passing doesn’t yet mean the feature works in the browser; and a manual click without tests doesn’t protect against a regression next week.

The heart — “verify, don’t declare”: instead of writing “it works”, you show proof (an HTTP status code, a number from the database, a screenshot). And you report honestly: if the tests failed, you say so with the result, you don’t hide it.

The default way of working is TDD — Test-Driven Development: first you write a test (what you expect), then the code that satisfies it. The test stays in the project and guards that a change broke nothing — proof instead of “it probably works”. more in the glossary →: first you write a test that describes what you expect, and it fails (red); then with the smallest change you get it to green. A hard rule: a Commit — A saved, labelled point in the project’s history — a confirmation of a specific batch of changes. Small, described commits make a history you can return to any working state from. more in the glossary → that changes behaviour but carries no test is incomplete.

A guard proves itself on the incident, not the Fixture — Prepared data or state a test runs against (e.g. a small database with a few records). A test is only repeatable if it always starts from the same point. more in the glossary →. A check written after a failure (so that bug can’t return) you first run on the real data of that failure — confirm it catches. A fixture written by the same head that wrote the bug can miss it; a guard that passes its own case is worse than none — it turns an open question into false calm.

Example of the test pyramid: many fast unit tests (checking single functions) at the base, and few e2e ones (clicking a whole path in the browser) at the top — because the latter are slow and brittle.

Read more: software testing · TDD (test-driven development) · the test pyramid (Martin Fowler).

03 — Testing and verification

Commandment III: verify, don’t declare. Tests are the net you run again and again; verification is observed proof that this change does what it should. Both are mandatory.

Rules

  1. Every Commit — A saved, labelled point in the project’s history — a confirmation of a specific batch of changes. Small, described commits make a history you can return to any working state from. more in the glossary → that changes behavior carries a test. New Endpoint — A single “address” in an API you send a request to for a specific thing (e.g. the list of orders). Apps talk through endpoints — one endpoint = one function you expose. more in the glossary → → route test; new threshold or fallback → threshold test; fixed bug → a test that reproduced it first. A behavior change without a test is an incomplete commit. TDD — Test-Driven Development: first you write a test (what you expect), then the code that satisfies it. The test stays in the project and guards that a change broke nothing — proof instead of “it probably works”. more in the glossary → (red → green → refactor) is the default mode.
  2. Show proof, don’t ask the user to check: HTTP code / redirect, a confirming HTML fragment, numbers from the database (integrity_check: ok), a screenshot for visual changes.
  3. Smoke test — A quick “does it even work” test right after a deploy — checks the most important paths (e.g. login). Catches disasters in 30 seconds before a user sees them. A cheap way to sleep well after a deploy. more in the glossary → check the right page, not just 200 — a marker proving the expected content rendered. Test auth from both sides: anonymous is bounced, logged-in sees the content.
  4. After a Deploy — Releasing a new version of the app “live”, where real people use it. It’s the moment a change reaches real people — which is why it happens only on an explicit “deploy”. more in the glossary →, smoke the live server (via localhost — The address a computer (or server) uses to connect to itself. On a server it lets you check the new version “from inside” before users see it. more in the glossary → behind the Maintenance window — A short, planned period when users see a “work in progress” page while the database or configuration changes behind it. It guarantees the app never runs, even briefly, on half-changed data. more in the glossary → flag).
  5. Report honestly: failures with their output; skipped steps as skipped; a failure caused by data drift (stale Fixture — Prepared data or state a test runs against (e.g. a small database with a few records). A test is only repeatable if it always starts from the same point. more in the glossary →) named as such, with a follow-up — not hidden, not used as a blocker.
  6. Numbers come from the source, not from memory or docs: SELECT COUNT(*) doesn’t lie.
  7. A Guard — A test that enforces a project rule (e.g. “every module is in the AI_README”) and stops the commit when it’s broken. A rule without a guard is only a wish — a long session will break it in good faith. more in the glossary → is proven by the incident, not by the fixture. A check written after an outage is replayed against that outage’s real data before it’s trusted — fixtures share the author’s blind spot (a freshness check once passed nine green tests and missed its own outage: > where >= was needed). Then freeze the boundary in a fixture, with a test on the boundary.
  8. Test the contract, not the implementation; keep the suite fast and deterministic (isolate I/O, seed randomness, serialize tests that share a port/DB). CI (continuous integration) — Automation that builds the project and runs the tests by itself after every change to the repository. A bug shows up minutes after the commit, not a week later in production. more in the glossary → gates Merge — Combining the changes from one branch into another. A merge brings in every commit from the source branch — other people’s too — so first you check what exactly comes in. more in the glossary → and deploy.
  9. Web projects carry by default: per-page SEO — Making sure search engines understand a site and show it high in the results. A site nobody can find effectively doesn’t exist. more in the glossary → meta, Canonical — A tag that tells search engines which address is “the real one” for a piece of content. It prevents duplicates (e.g. the same product under several addresses) that split your Google ranking. more in the glossary → + hreflang — A tag that tells the search engine what language a page is in and where its versions in other languages are. Without it a multilingual site confuses Google — the language versions “fight” over the same phrase. more in the glossary →, JSON-LD — Structured data: a description of the page invisible to humans that the search engine reads (e.g. FAQ, author, breadcrumbs). Opens “rich snippets” in Google — richer results, higher CTR. more in the glossary →, colour contrast and keyboard navigation, language parity as a failing test, no dead internal links.

Anti-patterns

  • 🚫 “Should work” as a conclusion.
  • 🚫 One test run, “suite green” declared.
  • 🚫 No smoke after deploy “because the tests passed”.
  • 🚫 “It compiles” confused with “it works for the user”.
  • 🚫 Weakening a test or guard to make it green.
Chapter deep-dive 03Why these rules, examples and stories from projects — what the core deliberately leaves out.

The canonical doctrine is written in English.