Promptles
Testing & Quality

Unit Test

beginner

Definition

A small, fast test that checks one tiny piece of an app on its own, a single calculation, one rule, one function, without any of the surrounding parts. Unit tests are quick to run and form the bulk of most teams' testing because they catch problems instantly.

In the wild

A developer writes a small function that calculates the discount price after a coupon is applied. He writes a unit test that says 'a $50 item with a 10% off coupon should cost $45.' The test runs in a fraction of a second. And any future change that breaks that math will be caught immediately.

More from Testing & Quality