unit test
Domain: Testing Quality
π― Motivation
A unit test verifies a single function or method in isolation. Unit tests are fast, focused, and form the foundation of a healthy test pyramid, catching logic errors at the smallest level.
π Concrete Example
You test def is_even(n) with assert is_even(4) is True and assert is_even(3) is False, checking only the functionβs logic without any database or network.
π Analogy
A unit test is like checking each brick individually before building a wall. If the bricks are solid, the wall is more likely to stand.