Practices

  • Acceptance test: A test of a specified acceptance criterion, written before the code from what the user should see, which the code must then pass.
  • Approval testing: A person approves an output once, and every later run must reproduce it until a new one is approved.
  • Architectural fitness function: An automated check that gives an objective verdict on one characteristic of the architecture, run like a test.
  • Characterization test: A test records what the code does today, right or not, so that a change to it cannot go unseen.
  • Code generator (scaffolding): A command lays down the files of a new part of the code from a template, so they start in the shape the project expects.
  • Code mode: The agent writes a program that calls its tools, run in one step, rather than calling each tool itself and reading every result.
  • Codemod: A program rewrites the code base mechanically, the same change at every place a pattern matches, instead of a person or an agent making each edit.
  • Contract test: One suite of tests runs against both a fake and the real implementation, so the fake the other tests use is known to behave like the real one.
  • Decision table testing: Every combination of a finite set of conditions is listed with its expected outcome, and each row becomes a test.
  • Domain-driven design: The code is shaped on a model of the business, written in the words its experts use, and kept apart from the technical concerns around it.
  • Equivalence partitioning and boundary value analysis: Inputs are split into classes the code should treat alike, and each class is tested once inside it and at each of its limits.
  • Fuzzing: A program is fed random or malformed input to find the inputs that make it crash or hang.
  • Golden master: The output of a reference run is kept, and every later run is compared with it to catch any change in behaviour.
  • Hexagonal architecture (ports and adapters): The application talks to the outside only through ports, each served by an adapter, so its core depends on nothing outside it.
  • Language server: One server per language answers an editor or an agent about the code, its definitions, references and errors, through a common protocol.
  • Make illegal states unrepresentable: Types are shaped so that a state the program must never reach cannot be written, and the compiler refuses it.
  • Metamorphic testing: When the right output is unknown, two runs whose inputs are related are checked for outputs that relate the same way.
  • Model-View-ViewModel (MVVM): A view binds to a view model that holds its state and commands, so the interface's logic can be tested without the interface.
  • Mutation testing: Small faults are planted in the code, and a test suite that still passes on one of them has a gap to fill.
  • Parse, don't validate: Input is checked once, at the boundary, into a type that keeps what was checked, so the rest of the program never meets an invalid value.
  • Property-based testing: Generated inputs are checked against a property that must always hold, and a failing input is shrunk to the smallest one that still fails.
  • Ratchet: The violations a code base already has are accepted and recorded, and the check fails on any new one, so the count can only go down.
  • Separation of duties: The one who does the work is not the one who checks it, because a measure the doer controls stops measuring.
  • Smoke test: A quick run of the main paths of the whole system, end to end, to see that it works at all before deeper testing.
  • Snapshot testing: A test framework stores an output the first time a test runs and fails when a later run produces a different one.
  • Stateful (model-based) testing: Generated sequences of commands are run against the system and against a simple model of it, and the two must agree at every step.
  • Test sizes: A test is small, medium or large by what it touches, one process, one machine or beyond, which decides its speed and its flakiness better than unit or integration.
  • Unit testing: A test exercises a small part of the code, such as one function or class, fast enough to run on every change, with its collaborators real or replaced.

A practice missing? Propose a practice.

+ Propose a practice