implementation detail
How code happens to be arranged inside, as opposed to the behaviour a caller can observe.
In more detail
Examples are private helper functions, the order in which collaborators are called, and internal data structures. A test that asserts on these ties itself to one arrangement of the code and breaks when it is tidied. Prefer assertions about outputs, visible state and messages that really leave the system.
Related terms
- refactoring — Restructuring working code to make it clearer or easier to change without changing what it does.
- over-mocking — Replacing so many collaborators with mocks that tests only check the script the test writer invented, not real behaviour.
- automated test — A small program that runs part of your code and checks that it did what you claimed it would.
Taught in
- The Cost And Value Of A Test — Automated Testing, TDD & Quality Engineering
- What To Look For In A Review — Automated Testing, TDD & Quality Engineering