Unit Tests vs. Regression Tests: Why the Same Feature Gets Tested Twice
Look through a maintenance tool’s test suite long enough and you’ll run into a small puzzle: a function already has a test, so why does another file add a second one for what looks like the same behavior? Two tests that appear to cover the same ground can actually exist for entirely different reasons. This post walks through the distinction between “unit tests” and “regression tests,” using real test code from this project as the example. Unit tests: verifying a function in isolation Note: a unit test checks the smallest testable piece of a program — a function, class, or method — independently from the rest of the system. A …