What A Unit Test Actually Proves
Explain what unit tests are responsible for and when another test type is needed.
The move: make the proof smaller before you make the suite bigger. A useful unit test has a narrow job: set up a unit, exercise one behavior, and check the result. That result can be a return value, a state change on the object under test, or a recorded call when the behavior is an interaction. The test should not need a real network, a real database, or the full application running just to decide whether the behavior is correct. The mechanism is feedback quality. Small tests fail close to the cause, run often enough to matter, and document behavior…
Sign up free — one personalized lesson every day, matched to your role and goals.
Already have an account? Sign in