Assertion
The statement in a test that must hold, and the only part that can actually fail.
An assertion is the check inside a test that decides pass or fail. Everything else in a test is setup; the assertion is the specification.
Several properties separate a useful assertion from a decorative one.
It must be reachable. An assertion after a step that can throw never runs on a broken path. An assertion placed outside the claim it supports cannot fail inside that claim — a structural trap in any system where claims are recorded per assertion.
It must be able to fail. See Falsifiability and Vacuous Truth. Checking that a class is present when the question is whether the class resolves to anything is the commonest form of a passing assertion that proves nothing.
It should assert the invariant, not the incidental. An assertion pinned to a value that legitimately varies — a token count, an exact sentence, a generated identifier — will break on every unrelated regeneration and be read as a failure.
Its failure message should identify the problem. A message naming the expected condition saves more time than any amount of test structure.
A related discipline: when a test is written after a fix, revert the fix and watch the assertion go red before trusting it. The counts confirm it — a suite going from two failing to zero is evidence; a suite that was already green is not.
See also10
Test-Driven Development
Writing a failing test first, making it pass, then improving the code with the test as a net.
Testing & Verification12 connections
LLM-as-Judge
Using a language model to score another model's output against a rubric.
Agents & Language Models12 connections
Regression
A previously working behavior that a change has broken.
Method23 connections
Fail Fast
Crash at the point of misconfiguration rather than degrading quietly into a wrong state.
Method27 connections
Nondeterminism
The property that identical inputs may produce different outputs, and what it costs to test around.
Agents & Language Models24 connections
Silent Failure
A failure that produces no signal, so the absence of an error reads as success.
Method73 connections
Hallucination
Fluent, confident output that is not grounded in anything real.
Agents & Language Models21 connections
Defensive Programming
Writing code that anticipates misuse and bad input, checking assumptions and handling the unexpected rather than trusting callers, along with the debate over when defense should give way to failing loudly.
Testing & Verification11 connections
Design by Contract
Specifying what each function requires and guarantees, as checkable preconditions, postconditions, and invariants, so a violation says exactly whose bug it is.
Testing & Verification12 connections
Core Dump
A snapshot of a crashed program's memory saved for later inspection, how to get one, how to read one, and why it can leak secrets.
Systems & Tooling11 connections
Linked from16
- Binary SearchComputation & Algorithms
Finding a value in a sorted range by repeatedly discarding half of it.
- Core DumpSystems & Tooling
A snapshot of a crashed program's memory saved for later inspection, how to get one, how to read one, and why it can leak secrets.
- Defensive ProgrammingTesting & Verification
Writing code that anticipates misuse and bad input, checking assumptions and handling the unexpected rather than trusting callers, along with the debate over when defense should give way to failing loudly.
- Design by ContractTesting & Verification
Specifying what each function requires and guarantees, as checkable preconditions, postconditions, and invariants, so a violation says exactly whose bug it is.
- Fail FastMethod
Crash at the point of misconfiguration rather than degrading quietly into a wrong state.
- FalsifiabilityMethod
A claim is only worth something if you know what observation would refute it.
- Golden File TestingTesting & Verification
Comparing an output against a checked-in reference file the whole team agreed was correct, rather than an inline assertion.
- LLM-as-JudgeAgents & Language Models
Using a language model to score another model's output against a rubric.
- Mutation TestingTesting & Verification
A test-of-tests that injects small bugs into code and checks whether the existing suite catches them, exposing tests that assert nothing.
- NondeterminismAgents & Language Models
The property that identical inputs may produce different outputs, and what it costs to test around.
- Parameterized TestTesting & Verification
Running one test body against a table of inputs and expected outputs, so each case is a single readable row and each failure is reported on its own.
- Property-Based TestingTesting & Verification
Asserting a general property that should hold for all inputs, then letting the framework generate many random inputs to try to break it.
- Snapshot TestingTesting & Verification
Comparing a component or output's current rendering against a saved baseline, flagging any difference for a human to accept or reject.
- Test OracleTesting & Verification
Whatever decides whether a test's output is correct, and the often-overlooked hard part of testing when nobody knows the right answer in advance.
- Test-Driven DevelopmentTesting & Verification
Writing a failing test first, making it pass, then improving the code with the test as a net.
- Vacuous TruthMethod
A statement that holds only because its subject set is empty — a green result that measured nothing.