gs-find-bad-tests
Find every test that guards no behavior, and report it. Change no file.
The examples are TypeScript. The rules apply to any language and any test framework.
0. Pick the scope
The user names the scope in prose. With a path, file, or module, work there. With none, work on the test files the current branch touched compared with the default branch, including uncommitted changes, and tell the user that is the scope. Find the default branch with git symbolic-ref --short refs/remotes/origin/HEAD, then git remote show origin, then main. Read the whole repo only when the user asks for it.
1. Find what each test depends on
Read every test in scope, and the production code it exercises. A good test depends on the intended behavior: it should change only when that behavior changes, and fail only when it regresses.
Report a test that depends on anything else. There are four categories.
The past: it guards code that no longer exists, so it has no reason of its own to change.
For example: