Documentation Testing Vocabulary
5 exercises — Practice vocabulary for testing documentation quality: running code samples in CI, broken link checking, auto-generated screenshots, readability testing, and zero 404s.
0 / 5 completed
1 / 5
A technical writer says: "We run code samples in CI to catch outdated docs." A developer asks how this works. Which explanation is correct?
Running docs code samples in CI is the highest-leverage practice for keeping documentation accurate — it converts documentation maintenance from a human memory task to an automated quality gate.
Implementation approaches: (1) Doctest (Python) — executable examples embedded in docstrings, run by pytest; (2) mdBook / runbook tools — markdown code blocks marked as "runnable" are extracted and executed; (3) Custom test harnesses — scripts that extract code blocks from markdown by language/tag and execute them against a test API environment; (4) Jupyter notebooks — entire documentation notebooks executed as part of CI. The key insight: outdated code samples are the most-complained-about documentation problem because they directly waste developer time. If the first code sample a developer tries doesn't work, trust in the documentation collapses. Automation converts this from "we try to remember to update docs when the API changes" to "the build fails if docs aren't updated."
Key vocabulary:
• docs-as-code — treating documentation with the same tooling and practices as software code (version control, CI, tests, code review)
• runnable code sample — a documentation code example that is also executed as part of CI to verify its correctness
• documentation CI pipeline — automated checks (link checking, code execution, spell checking) run on documentation changes
Implementation approaches: (1) Doctest (Python) — executable examples embedded in docstrings, run by pytest; (2) mdBook / runbook tools — markdown code blocks marked as "runnable" are extracted and executed; (3) Custom test harnesses — scripts that extract code blocks from markdown by language/tag and execute them against a test API environment; (4) Jupyter notebooks — entire documentation notebooks executed as part of CI. The key insight: outdated code samples are the most-complained-about documentation problem because they directly waste developer time. If the first code sample a developer tries doesn't work, trust in the documentation collapses. Automation converts this from "we try to remember to update docs when the API changes" to "the build fails if docs aren't updated."
Key vocabulary:
• docs-as-code — treating documentation with the same tooling and practices as software code (version control, CI, tests, code review)
• runnable code sample — a documentation code example that is also executed as part of CI to verify its correctness
• documentation CI pipeline — automated checks (link checking, code execution, spell checking) run on documentation changes