Which tests should we rerun when a shared component changes?
Start with the behaviour a change can affect, then follow dependencies into the checks that would notice a regression. Keep a full reference run so a fast selection policy can be challenged.
Work through the decision
Its unit tests cover display precision. The invoice PDF and the account export consume the same formatter through different paths. Only running tests in the edited folder misses both consumers.
| Step | Evidence to keep |
|---|---|
| Map callers | Include exports and background consumers as well as imports. |
| Select checks | Choose a decimal-boundary test, a PDF assertion and an export fixture. |
| Verify recall | Run a broader suite on the same revision and investigate any omitted failure. |
What changes the decision
Treat changed lines as a starting point. If the dependency map is stale or the change alters shared state, expand the selection before accepting the faster result.