Skip to content

Correct Dependent Test detector (approved SRS exception) - #5

Merged
HeliosHawk merged 2 commits into
masterfrom
fix/dependent-test-detector
Nov 18, 2026
Merged

HeliosHawk merged 2 commits into
masterfrom
fix/dependent-test-detector

Conversation

@HeliosHawk

Copy link
Copy Markdown
Collaborator

What this changes

Corrects the Dependent Test detector, which could not report a smell under any
input. This modifies an engine file under an exception to the SRS engine
constraint, approved by the client on 16 November 2026.
The full record is in
documentation/srs-exceptions.md.

Two independent defects, either sufficient on its own:

  • The membership test compared a String to a Stream, so the condition was
    false for every method in every file and the element list was never populated.
  • The element was added without setHasSmell(true), and getHasSmell() counts
    only elements whose flag is set.

The fix uses contains() against a set of the test method names, calls
setHasSmell, and excludes a method calling itself as recursion rather than
dependency. No other engine file is touched.

tools/corpus/engine-checksums.txt is regenerated — the diff is one line, the
hash of the approved file.

Testing

Regression fixture added at fixtures/testAccount.java / fixtures/Account.java,
where testBalanceAfterDeposit() calls testDeposit().

Unmodified engine:  Dependent Test = false
Corrected engine:   Dependent Test = true

Identical input both times.

Fixture corpus coverage rises from 20 of 21 to 21 of 21 detectors. All other
detector results unchanged.

Shared cross-IDE corpus re-run: 5 matched, 5 declared divergences, 0 unexpected, 0 stale. No case in it contains a test calling another test, so no expected
result moves and no divergence declaration goes stale.

Full CI job simulated locally before pushing: checksums verify, engine compiles,
corpus comparison exits 0.

image

@HeliosHawk
HeliosHawk merged commit bfb5482 into master Nov 18, 2026
1 check passed
@HeliosHawk
HeliosHawk deleted the fix/dependent-test-detector branch November 18, 2026 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant