Show in graph

Software → quality-assurance

Unit Test

A test that verifies a small isolated unit of code, such as a function, class, or module.

Motivation

A unit test checks a small piece of behavior in isolation. It solves the problem of getting fast feedback when code changes.

Mental model

Unit tests are the safety net closest to the code.

Where it fits

Unit Test belongs to the Software track, inside Software Design. It connects to nearby concepts through the graph relationships on this page and in the graph explorer.

Common mistakes

  • Testing implementation details instead of behavior.
  • Mocking everything until the test proves little.
  • Writing tests that are slow, flaky, or hard to read.

Use the metadata panel or return to the graph to explore concepts that this one requires or relates to.